3 ms·
I can see how this could work for recording timestamps as they happen, or for events that have already happened. In this case, you still need to keep around the
by grzm 10y ago
I can see how this could work for recording timestamps as they happen, or for events that have already happened. In this case, you still need to keep around the tables of time zone changes if you ever want to compare two timestamps.
How do you handle future timestamps when time zone data changes? Update all future timestamps? Keep a separate timestamp recording the timestamp at which the future timestamp was last updated?
Storing timestamps at UTC solves this at the expense of knowing how to view the timestamp at a specific time zone.
- detaro 10y agoThat's exactly the point, but the other way around. If the timestamp is defined in local time (e.g. "a meeting is scheduled for 15:00 every second thursday") and you generate a list of the next events as UTC, and then the DST rules change, you have to go in and fix all the UTC timestamps for future events. If you store local time + timezone name, the stored time doesn't have to change, and if you need it in UTC for display you can calculate it on the fly, using the most recent rules you know. If intervals are more important (e.g. do something every 30 minutes, or exactly every 24 hours), then UTC is better, or if you are recording events as they happen.
- grzm 10y agoYou're right. For future events it does make sense to record the local time zone. Thanks for the clear explanation.