Skip to content
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

Should we store all datetimes in UTC? #39

Closed
ErikBjare opened this issue Apr 2, 2017 · 4 comments
Closed

Should we store all datetimes in UTC? #39

ErikBjare opened this issue Apr 2, 2017 · 4 comments

Comments

@ErikBjare
Copy link
Member

Found this article, I think it makes a convincing argument with the DST madness. The issues with Python aware vs naive datetime I (hope) think is a non-issue for us right now. But the DST thing annoys me a bit.

Link: http://lucumr.pocoo.org/2011/7/15/eppur-si-muove/

@johan-bjareholt
Copy link
Member

I read through the article and found this

One gives the time in UTC, the other in local time. However it will not tell you what local time is (because it does not have a timezone information object, at least before 3.3), and it does not give you way to know which one was UTC.

Went to the python docs and then found this

Changed in version 3.3: Equality comparisons between naive and aware datetime instances don’t raise TypeError.

So according to the articles conclusion, as long as we continue and don't forget to set it to UTC everywhere we will hopefully be fine.

@ErikBjare
Copy link
Member Author

Yeah it's really not the aware vs naive thing that I'm afraid of as that has been fixed in Python as you've discovered.

I'm more concerned about changes to and from DST.

@ErikBjare
Copy link
Member Author

I'm closing this for now, doesn't seem like we will be doing this until we get a better argument in favor of it.

@ErikBjare
Copy link
Member Author

We ended up doing this. Now looking to add timezones as a separate field in the database representation of the event model: #109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants