-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Issue with timezone. #979
Comments
Timezones open a whole big discussion which I'm not sure I want to dig in at this time. My suggestion would be to run your Go app using UTC timezone always, and make sure your database also runs in UTC. You can do so by setting
Let me know if you actually need to use your app in a specific timezone, and if so, why you need it, as it would help me prioritize it. |
Actually, to go into more detail about your question, you are right that the timezone information gets lost, as I believe it just saves the time in UTC right now, which you might want to request as a feature. Just to make sure, is the time itself actually correct? As the returned time would be UTC, does it still actually have the correct time, even if it's a different timezone? Or is it shifting the time by 2 hours whenever you save and find the item again? |
Hi, About your questions, the time itself is correct, the reported "logs" are with the right timezones. The DB save it in UTC. Before adding the timezone on Go, the saved datetime was right (both in UTC). I dunno your timeline on new features, btw tnx to resurrect this library :), I can try to look bit deeper on the issue to have more context |
Hi,
I'm having some issues with the timezone and how they are handled. I've created a small demo repo with the issue here.
Looks like the timezone, for the example it was set on "Europe/Rome", is lost when it goes to write on db.
If I do a
time.Now()
I'll get the right timeIf I do the insert calling
time.Now()
I lose the timezone on the DB.doing a bit of debug, in the
engine/request.go
on theDo
method when it do the request thepayload.Query
looks fine, or at least with the right time.but then in the response the timezone was lost
Am i doing something wrong? or am i missing something?
The text was updated successfully, but these errors were encountered: