3 ms·
It depends on the purpose of the app, but you often have to store user entered times with time zone information. The rules for things like daylight savings time
by nitwit005 7y ago
It depends on the purpose of the app, but you often have to store user entered times with time zone information. The rules for things like daylight savings time can and do change, and you don't want future scheduled events drifting by an hour.
- gmueckl 7y agoLet's not forget events spanning time zones. Just some random thing that came to my mind: how would you handle calendar entries where half the participants made a DST transition since the entry was created and the other half didn't? This happens for example when half of the team is in the US and the other half in the EU. The transition dates are a week apart.
- Misdicorl 7y agoNone of these edge cases are solved by using off the shelf libraries instead of running your own.
- gmueckl 7y agoNone of these edge cases have a chance of being handled correctly without an accurate time zone database to detect the problem at all. Good luck maintaining that on the side! I am fairly certain that you would get it wrong. There's a reason why most software relies on zoneinfo.
- perl4ever 7y agoI remember seeing a thick dead tree type of book with the history of time zones in the US, for figuring out times in historical documents when things were less standardized. It was practically the size of a phone book; I think it probably covered county level history or something like that.
- macintux 7y agoI have a book covering, among other things, Indiana time zones for a few years during IIRC the 1960s. It’s frankly amazing how much they changed every year. Different counties, and sometimes towns/cities within counties, would jump back and forth year to year. It would have been awful to manage if computers had been more important at that time.
- Misdicorl 7y agoYes, as I said above, if you need to localize then you'll need more detail.
- e12e 7y agoWhen do you not?
- lmm 7y agoWhen you need some system activity to happen regularly (e.g. every 10 minutes) but not at a specifically human-meaningful time. When you need to know what order events occurred in or how far apart two events are, but don't need to correlate those times with external events (or can easily establish "system" times for any relevant external events). You can cover a lot of cases without having to touch "human time" at all.