Bug #45340 | timestamp values not getting the correct timestamp | ||
---|---|---|---|
Submitted: | 4 Jun 2009 18:36 | Modified: | 4 Jun 2009 20:59 |
Reporter: | Roberto Jimeno | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 5.1.30 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | GMT, timestamp, timezone, UTC |
[4 Jun 2009 18:36]
Roberto Jimeno
[4 Jun 2009 19:21]
Mark Matthews
Configure your MySQL server to use a UTC timezone, and you avoid this issue. Connector/J can't change the on-wire form of the timestamp, if you think that all timezones should be UTC on the wire, you should re-open a different bug on the server. The JDBC driver can only work with the data that is presented to it.
[4 Jun 2009 20:51]
Roberto Jimeno
That means that it is impossible for MySQL Connector/J to open the connection as UTC to pass all timestamps as UTC to the client? Should all the servers be configured in UTC for proper functioning? I would like you to state it in the documentation and give a fatal error if someone tries to start MySQL on a server with a timezone different than UTC, if so.
[4 Jun 2009 20:59]
Roberto Jimeno
Opened server bug #45342
[8 Jun 2009 15:51]
Mark Matthews
I think you might be confused with how java.sql.Timestamp is defined in the documentation. It's *not* presented in UTC, it's not in the UTC timezone even. The value is *stored* as milliseconds since the epoch in the UTC timezone, but if you ever *touch* it, it's going to be converted to some other timezone depending on how you're presenting it.