Hacker News new | past | comments | ask | show | jobs | submit login

UTC is generally a good idea for storing, but there are still some ways to have that bite you. If a user enters a local date time for a future event in a particular time zone, converting that to UTC could result in incorrect behavior if the timezone definition changes. It depends on if the user meant that UTC time or if they meant the local time.



It can also cause trouble if you store past events but do not store the user's local offset or timezone at the time of the event. If you aggregate these events later into a dataset of "events by hour", they may be grouped wrong (from a user's perspective) if you convert them all to the user's _current_ timezone.


> if the timezone definition changes

Or if DST kicks in/out. No need to have the definitions change.


Depends on how naive the conversion is. If you consider DST while making the conversion that’s not really a problem


That's why I do it at the time the query is made. I don't ever store UTC.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: