by fuoqi · 9mo ago · 0 comments
[0]: https://en.wikipedia.org/wiki/International_Atomic_Time
We convert timestamps to and from date+times all the time. Having each day be exactly 86400 seconds simplifies this a lot, and practically every app benefits from that. Leap second smearing will ensure smooth and continious time.
Taking leap seconds into account is only needed in a very, very few contexts - maybe astronomy, or certain kinds of high-speed physics? Those rare users should be able to figure stuff out.
Go with UTC, don't optimize for rare usecases at the expense of everyone else.
How is this achieved - no leap seconds, smeared leap seconds, hard time jump every few thousands years - does not really matter.
This is never going to happen. If handling 1 leap second every year or two is so hard and destructive, imagine the anxiety of introducing 30 all at once after 100 years of complacent software development with very few people alive who even remember the last adjustment. Of course our children will just say "screw that".
TAI always has 86400-second days. UTC can have 86401 (or 86399 theoretically, but that's never happened in practice). Eliminating leap seconds from UTC is so dumb because TAI already exists and is basically just UTC but without leap seconds. But, for some reason, the BIPM would rather allow UTC to drift from UT1, but it will always have the ~40 historical historical leap seconds that have already occurred. It will become a strictly weirder version of TAI.
I predict that in hundreds of years, as UTC-UT1 reaches several minutes, people will start talking about inventing a "new" time keeping standard with leap seconds to stay in sync with the Earth, and shift to using that for civil time keeping instead of drifty UTC. Then we'll finally be where we should have been the whole time: effectively using TAI as the source of truth, and converting to civil time by introducing leap seconds (but the new "TAI" will be weirder than the old TAI, which we should've just been using the whole time).
Making an assumption that a day 86400 seconds breaks at least twice a year in many parts of the world, and that's before we introduce leap seconds or possibility of your code running on hardware that itself travels across timezones.
So you have to do the conversion at some point _anyway_.
If your app presents me data making the assumption that _my_ day is always 86400s, it will be _wrong_.
>We convert timestamps to and from date+times all the time.
If you do not account for time zones during this conversion, then you are not qualified to implement such conversions.
It's fine to use 86400 seconds for durations (e.g. "this computation will finish in 1d 8h 20m 34s"), but it's absolutely not fine to use it while dealing with datetimes.
[0]: https://en.wikipedia.org/wiki/Leap_second#Phase-out_and_futu...
Now, if I cannot really add a month anymore (and I cannot in TAI, because months don't even really exist in TAI, since TAI isn't a solar year) in my internal time format, all that convenience goes away. I now must always worry about leap seconds and timezones and all the stuff I don't really need to think about in the vast majority of cases.
…Yeah, well, I'm really not sure. I am not convinced, and am honestly kinda relieved by the fact I won't have to find out. But it's an interesting point nevertheless. And, no, UTC w/o leap seconds is not the same thing. In fact, UTC w/o leap seconds is kinda the polar opposite: it's clearly the wrong abstraction, because it ignores the (not even so hard) problem somebody doesn't want to deal with, which doesn't really go away, but is very practical.
Unless there's a leap second in that month. Then it would be 13:59. Maybe you don't care, but some people do. It could have legal or technical ramifications.
> Now, if I cannot really add a month anymore (and I cannot in TAI, because months don't even really exist in TAI, since TAI isn't a solar year).
What do you mean by month? Calendar months are obviously irregular (thanks February). "30 days" makes perfect sense in TAI. Indeed, 14:00 today + 30 days would always be 14:00 in TAI.