21 ms·
I don't see how the countdown timer can fail to reach zero when the conference starts, if we have calculated the correct number of seconds between now and the c
by kazinator 8y ago
I don't see how the countdown timer can fail to reach zero when the conference starts, if we have calculated the correct number of seconds between now and the conference, and do not change the conference time based on whether or not daylight savings time is canceled, to preserve it apparent local time.
If we decide that the conference's start may be a moving target based on changing DST rules, then our coutdown timer cannot smoothly count down. At every tick, it has to evaluate the amount of time left to the conference start, and show that. The conference start's local time is always converted to UTC based on the current rules; when the rules change, it jumps by one hour and so the countdown timer adjusts itself at the next tick to show an extra hour.
You can't smoothly count-down toward something that starts at X or at X + 1h, and you don't know which until later.
- fendy3002 8y agoWhich is why storing the time data in UTC isn't a correct approach, because it just become countdown timer. A user may need to be reminded at specific time in a future, on a specific time zone. And it can't be reached by merely put a countdown timer.
- kazinator 8y agoThat doesn't follow. If the DST rules change, then, effectively, any event whose local time stays the same has actually moved. The sun will be in a different spot of the sky when that meeting is held than it would have been. All the dates stored in UTC which move due to a DST rule change have to be traversed and updated, as do any dependent countdown timers. That doesn't mean it wasn't "correct" to store them that way. "Correct" means that we handle all the cases in our specifications and design, and they are translated to code without mistakes. People like countdown timers. If there is going to be a countdown timer to an event whose time is uncertain, that countdown timer has to update itself when the exact time is pinned down. Until then, it should probably use the shorter countdown so that it errs on the side of too early. It has to be updated whether the time is stored as local time or as UTC. The behavior of the countdown timer cannot depend on how the time is stored in some database.