-
Notifications
You must be signed in to change notification settings - Fork 2.3k
datetime timezone bug #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We changed that because we don't have a reliable way to convert between timezones when server and client are on different machines and - worst case - their clocks are off. See the discussion in #9. |
@arnehormann How do I fix this behavior? I am storing data sampling taken on client, which by-desgin may have a different timezone than any another client. This is a huge problem when frameworks start assuming something for developer... I need to preserve TZ information. If I did not need to, I would be dealing with this in my code. |
This is a general MySQL question. It isn't specific to this driver. My recommendation is store time in UTC always. |
As @methane says. I'll just defer to @xaprb here, follow his advice if at all possible: http://www.xaprb.com/blog/2014/01/30/timestamps-in-mysql/ |
@slene, What was the value stored in mysql table in this case? |
Go-MySQL-Driver version 1.0.3
go version go1.2 linux/amd64
Before version 1.0.3 (included) everything is ok. But after this version. Has a timezone bug.
example:
In linux:
In Mysql 5.5
In go
Before version 1.0.3 (included) output is
Latest version output is. The timezone always is UTC. Can not detect the current timezone.
What's wrong with this. May I miss something?
The text was updated successfully, but these errors were encountered: