142 points · by enz · 2y ago · 141 comments
A. A day is divided into a fixed number of smaller units.
B. Each smaller time unit is of a fixed physical duration.
C. The day cycle corresponds to the cycle of the solar day on Earth.
TAI picks A and B, allowing the solar cycle to drift from the time.UTC picks B and C, adding leap seconds to keep track with Earth's solar day cycle.
UT1 picks A and C, redefining the "second" to the changing rate of earth's solar day cycle.
TAI is an absolute time based on atomic vibrations. UT1 is a relative time based on astrometric systems.
Also, there is no such thing as absolute time, because of relativity. We take pains to account for this by only measuring TAI on the Earth's geoid, but even so the uncertainty never reaches zero. Two "stationary" atomic clocks on the geoid are expected to drift by about a second every billion years or so. Sure, that's pretty good, but definitely no "absolute".
When you really think about it, the cesium atom and the earth's day/night cycle are both equally valid clocks. But the cesium atom measures time more similarly to the way we perceive time on a small scale. But, of course, our lives are scheduled based on the day/night cycle. So they both matter. UTC is the way we reconcile the two.
Now the BIPM decided to "get rid" of leap seconds in UTC a couple years ago. I hope they come to their senses before 2035 when the change takes effect. Here's what will happen:
Rather than inserting a leap second every 1-2 years to keep UTC in sync with solar time, they plan to defer the problem to once every 100 or so years, and just insert like 50 leap seconds all at once. Think about that for a second. If leap seconds are so bad, how in the hell is the world going to deal with 50 of them at once after a century of oblivious complacency? They won't. They'll just say "Look, it's not worth it to have leap seconds in UTC anymore". Then, UTC will forever be just a constant offset away from TAI.
But we already have TAI. Why not just use TAI as your "source of truth", and let UTC be UTC? We'll have to introduce a new system to take the place of UTC and be in-sync with solar time; like how UTC used to be.
I don't get the insistence on keeping nominal seconds-alignment (or even minutes-alignment) between the clock and the sun's position; we already don't experience it in practice.
Timezone regions are fudged all over the world[1] for political and practical reasons, but even if they weren't, people living near one timezone edge don't experience the "sun noon" at the same time as people living near the other edge, even though they share the same clock time.
[1] just look at the map here: https://en.wikipedia.org/wiki/Time_zone
> B. Each smaller time unit is of a fixed physical duration
This just gave me Timecube flashbacks
99.999998% of time_t ticks from 1970 until now have been 1 second long. 27 have been 2 seconds long. Therefore B ("each smaller time unit is of a fixed physical duration") is the variant.
POSIX time does not generally work that way. It may seem that way for 1-second resolution timestamps, but at higher resolutions (say millisecond resolution), the clock does not completely stop. It keeps going, jumps backward 1 second, then continues.
https://robotsinplainenglish.com/e/2022-11-20-stopwatch-time...
Contrary to this, since at least 2008[0], the POSIX standard (which is just paper not necessarily how real systems worked at that time) has said that "every day shall be accounted for by exactly 86400 seconds." That means that in modern systems using NTP, your Unix timestamps will be off from the expected number of TAI seconds. And yes, it means that a Unix timestamp _can repeat_ on a leap second day.
There's really no perfect way of doing things though. Should Unix time - an integer - represent the number of physical seconds since some epoch moment, or a packed encoding of a "date time" that can be quickly mapped to a calendar day? "The answer is obvious" say both sides simultaneously :^)
EDIT: I know DJB is calling out POSIX's choices in this article, but it seems like his "definition" does diverge from what the count actually meant to a lot of people.
[0] Also: "The relationship between the actual time of day and the current value for seconds since the Epoch is unspecified." https://pubs.opengroup.org/onlinepubs/9699919799.2008edition...
Either way arguably POSIX time is the worst of both worlds, not being either of those. This is one of those cases where middleground compromise is worse than either option. Having datetime be just 15:17 bit structure (date:time_of_day) or more practically just int:int struct, it would be infinitely better than current POSIX time. Or just have it be plain SI seconds since epoch counter would also be better than POSIX time. Or even have both options available. There are so many better options, it is almost baffling how POSIX ended up with the worst possible one
If you're using TAI, it's more obvious that you have to account for leap seconds in order to convert to a human-readable civil time format (year, month, day, hour, minute, second). You know that you have to incorporate the official leap second list from IANA or some other authority. UTC makes it seem simpler than it actually is, and that's why there are so many problems.
You can always convert from TAI to civil time. You cannot always go the other way.
- You can subtract two SI-based timestamps to get a SI-based time difference. This will give you the correct number of nanoseconds.
- You can subtract two UTC-based timestamps to get a UTC-based time difference. This will not give you a number of nanoseconds.
Note that, if you have a list of when leap seconds are, then you can convert between SI-based and UTC-based timestamps which are counted from the epoch; in this way it is possible to get a SI-based time difference from UTC-based timestamps if you need it.
It is not as simple as just subtracting them of course, but if your application is meant to use precise time differences then you can just use SI-based timestamps instead of UTC-based timestamps, so that you can simply subtract them from each other. Programs that need to deal with days and calendars instead, are likely to prefer to use UTC-based timestamps instead.
Most people seem to prefer ignoring leap seconds, pretending they don't exist by "smearing" them across the surrounding day, or even getting rid of them entirely. https://news.ycombinator.com/item?id=33658541 https://news.ycombinator.com/item?id=32226414
The arrogance of programmers who think it is possible to ignore reality to suit them :-)
I suspect the reality is many are unaware of TAI which would be more than 'good enough' and make life much easier for them.
EDIT: Downvotes simply for stating facts and opinions from outside the IT industry hardly prompts useful discussion!
Leap seconds won't even be like the automobile, let alone newspapers or hotdogs, they're a fleeting idea we thought might be good, now we realise it's not good, so bye bye.
There are two "realities" here. TAI is the monotonically increasing "Seconds are the same length and happen in order" clock time that it turns out well suits a lot of human enterprises. The exact details have been worked out pretty well. A Day in TAI is 24 hours of 60 minutes of 60 SI seconds, always, forever.
UT1 is a descendant of "Solar time" now based on the Earth's rotational angle. A Day in UT1 is the full rotation, how long that is in SI seconds varies very slightly and arbitrarily.
UTC wants to have the steady monotonicity of TAI except it wants to match UT1's days exactly, this is not a thing, so the "leap seconds" are conjured to kludge it. This kludge is what's going away, it's not part of "reality" it's a kludge to try to fit a square peg in a round hole and we're giving up the kludge.
It has been a long time since humans worked purely from direct observation of the "solar time" or rotation. Once the clock gets invented, so millennia ago, that's out and humans are measuring (albeit not very precisely at first) what we now call TAI. Giving up leap seconds is us finally accepting that while UT1 is astronomically interesting, it's not actually a sensible basis for day to day living.
For day-to-day operations, we don't need the exact position of the sun in the sky, in fact, with time zones, we can be off by hours and still do business. Using the sun would be inconvenient anyways, as each location would need its own time. So for that, a few seconds is completely negligible.
Not many people care about the precise position of the sun in the sky as seen from an arbitrary location, so there is no real need to skew our overall more useful atomic clocks for this.
Maybe, in a distant future, people will need to update their time zones to catch up with what would be a noticeable shift, big deal...
Each clock would run at a slightly different rate, based on imperfections in the equipment, the altitude of the laboratory and the amount of nearby mass in its vicinity. National clocks would drift, relative to each other, and so would everybody's timestamps. CET would be perhaps +1:00:00.000002 ahead of GMT rather than being exactly +1:00.
You'd have to continually measure and publish this drift in some kind of timezone-to-timezone comparison service, so that people who make network connections across the world don't end up finding that packets appear to arrive before they've been sent (due to National Clock drifts)
It's an interesting thought experiment. But I prefer where all the worlds' labs work together to produce a consensus universal time, and we just add fixed political offsets to it.
Sidenote, "Tai" in the title should be TAI.
If your operating system uses UTC, your logging library uses UTC, your SSL cert issuer uses UTC, your TOTP tokens use UTC, your NTP client uses UTC, your e-mail headers use UTC, your string formatter uses UTC, your serialised data parsing libraries use UTC, everyone who sends you data uses UTC, and everyone you send data to wants to receive UTC - why swim against the current?
How do I know this? Because I've tried it. Let me assure you, for every bug you avoid using TAI, you'll experience 500 bugs due to UTC/TAI confusion.
It really doesn't matter if UTC drifts away from solar time by an hour every few thousand years.
You could even align it with a DST transition in countries that have those where you simply skip one to apply the change.
https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-TF.2511-2022...
There will be no more leap seconds after 2035, AFAIK.
The complications are around clocks, UNIX timestamp and NTP, where a steadily and monotonously increasing number would make the most sense, and that's not UTC.
https://gavinhoward.com/2023/02/make-the-leap-second-first-c...
That has to be justified before scrapping something we don't necessarily understand and a lot of programmers are just grateful we have libraries to handle this complexity for us.
Because one cannot ignore nature?
I suspect the vast majority of those programmers who have problems with leap seconds should really be using (and are unaware of) TAI.
Anyway, that's an explanation of my opinion. Many people will disagree with it.
Why not? Time zones change constantly. Dealing with changing time zones is something we already know how to do easily.
Downvoting is meant for text that detracts from the conversation. Not as a tool for suppressing well made arguments one disagrees with.
1)daylight savings should be completely abolished. It just causes confusion.
2)timezones should be completely abolished. They also cause confusion. If you live in California, instead of getting up at say 8am you get up at say 3pm. There is never any confusion with anyone globally about scheduling anything.
3)Months should be the same length. Instead of 12 months of 30, 31, 28 or sometimes 29 days, with a varying number of weeks in each month depending on the year, you have exactly 13 months of 4 weeks each (28 days). 13*28=364 which gives you an extra day "New years day" or "Christmas day" or whatever but that isn't a day of the week. If it's a leap year the day after that Christmas day is "Leap day" and it also isn't a day of the week. Then a particular date is always the same day of the week, months are all 4 weeks, quarters are exactly 3 months and 1 week each and have the same end dates every year etc. Tons of benefits.
Literally the only downside people come up with when I mention it is "yeah but imagine if your birthday is now a Monday, that would SUCK!"
But, err, "am" and "pm" refer to where the sun is in the sky. That's their literal meaning. It's useful information. Timezones are (obviously) a physical thing. Abolishing them to aide the comparatively tiny number of people worldwide who need to schedule a phone call with someone in another country is pretty bonkers IMO.
Furthermore, I don't want to be booking a flight home from Australia to the UK, pick a 9am departure from SYD only to discover it's in the evening.
[1] Notionally. Obviously the sun is not often in the sky in London.
For example I literally have 3 emails in my inbox at the moment that arrived overnight from people in California saying some variation on "I saw a slot in your calendar for xpm PST, is that too late for you in London?".
Good luck selling a large swaithe of humanity that Tuesday will turn into Wednesday at some point during their working day.
There are other operating system specifications too, but I also wanted to make one operating system design, and I also wanted to avoid many of the problems with POSIX.
I did not konw that POSIX says that 2100 is a leap year, and clearly that is no good.