Live data from Hacker News

UTC vs. UT1 time and other nuances (2020)

mperdikeas.github.io

21–30 of 35 posts

Re: UTC vs. UT1 time and other nuances (2020)

#21

How in the world did astronomers & their software developers manage to push off onto the rest of the software world (and society at large) the atrocious concept of leap seconds.

Leap seconds are problematic for astronomers whom either are doing things that don't care (e.g. 1 star calibrated against the sky, that calibration approximately incorporates whatever difference between UT1 and their local clock exists) or where they do care they have to back the leap seconds out in order to apply a more accurate model of UT1.

It's actually quite tricky to back out leap seconds accurately because the underlying time will be discontinuous for you and you can't reliably tell when leap seconds have or haven't been applied... you might even, without knowing it, be being fed leap-smeared time which could evenmake your sidereal tracking wrong and can't be backed out because different smearers do it differently. Because leapseconds they're infrequent, you also don't get many live fire tests.

I'm aware of multiple observatories that just shut down operations across leap seconds. The significant amount of work to handle leapseconds correctly and be confident you're correct isn't justified vs taking some downtime.

Re: UTC vs. UT1 time and other nuances (2020)

#22
post #17
post #12

Earlier quoted context omitted.

UT1 might not work for engineering applications with tight tolerances, as the length of a UT1 second varies. Personally, in my non-expert opinion, we should stop adding or subtracting leap seconds from UTC (that is, UTC would thereafter be at a constant offset from TAI), and leap seconds would instead be added to the timezone DB. That way local time (like Aug 14 2022 xx:53) would still retain the familiarity with 12:…

If people don't like leap seconds, there is no need to redefine UTC; they can just use TAI today. That gives them the additional advantage of not having to handle leap seconds in the past, because software that handles historical UTC timestamps will always need to know about the leap seconds that have already happened.

Spoken like someone who hasn't attempted this. :)

All our computer and protocol infrastructure is setup to handle and distribute UTC. Everything else you talk to is speaking UTC.

Trying to use TAI in a UTC world doesn't save you from dealing with leapseconds in the slightest: You get all the leapsecond induced problems just obtaining TAI from your UTC feeds and them you get them again at every boundary where you need to communicate with something else that is using UTC.

At least if you use UTC across the board you'll only fail around leap seconds (or false leap seconds created by issues in leapsecond distribution infrastructure). If you attempt to use TAI you'll get those failures plus many extra ways to fail.

> that handles historical UTC timestamps will always need to know about the leap seconds that have already happened

That's static data that can be hardcoded and tested, massively easier and safer than events which are being inserted (or accidentally failed to be inserted) in real time.

The big problems with leapseconds arise because of the realtime discontinuity and because the offset function changes in unpredictable ways.

In many applications there just isn't any old dates to begin with. E.g. in my code that points my telescopes (and determines where they're pointed from the encoders) I have a pile of nonsense to hopefully handle leapseconds, which may or may not actually work right when one happens as its really hard to test how other software will behave. But the same software never needs to handle times more than a day (or a few days) in the past.

If leap seconds stopped being issued bugs in software impacting billions of people would just vanish. Not every bug-- some things might also mishandle historical leap seconds, but most of the issues come from realtime bugs. If you go too far back times wouldn't have been known to 1 second in any case, so bugs with historical data would mostly be in the form of things breaking due to inconsistent time difference calculations.

Re: UTC vs. UT1 time and other nuances (2020)

#23
post #11

Even more confusing, the time printed by our computers may appear to be UTC, but is probably POSIX (or Unix) time. It is very close to UTC but ignores leap seconds. https://en.wikipedia.org/wiki/Unix_time During a positive leap second, the POSIX second repeats itself (an alternative mental model could be that the given POSIX-second lasts 2 UTC-seconds). During a negative leap second, the given POSIX-second disappears…

The often made and only technically true claim that posix/unix time "ignores leap seconds" is actually a major source of leapsecond handling bugs, because it makes people think that posix time is TAI (with some offset). Instead posix time is UTC with some seconds that have unusual lengths (0 or two SI seconds, as you note).

When you want to know the number of SI seconds between two dates in either posix or UTC you need an accurate table of past leapseconds. If you want to compute TAI from posix or UTC you need an accurate table of leap seconds that your UTC clock has applied (which may not be the same as the table of leap seconds, since you might have missed the most recent one!).

Re: UTC vs. UT1 time and other nuances (2020)

#24
post #12

Earlier quoted context omitted.

UT1 might not work for engineering applications with tight tolerances, as the length of a UT1 second varies. Personally, in my non-expert opinion, we should stop adding or subtracting leap seconds from UTC (that is, UTC would thereafter be at a constant offset from TAI), and leap seconds would instead be added to the timezone DB. That way local time (like Aug 14 2022 xx:53) would still retain the familiarity with 12:…

I think the problem is that we already have the networks and protocols to synchronize time (NTP, PTP, etc.), but not for timezone DB data.

RFC 7808 specifies a TZDIST service.

But most operating systems already have their own mechanism to update their timezone database. This is not a problem. Shifting timezones by 15 minutes every few thousand years would work with current software.

All we need to do is to agree that UTC will have no more leap seconds.

Re: UTC vs. UT1 time and other nuances (2020)

#25
post #11

Even more confusing, the time printed by our computers may appear to be UTC, but is probably POSIX (or Unix) time. It is very close to UTC but ignores leap seconds. https://en.wikipedia.org/wiki/Unix_time During a positive leap second, the POSIX second repeats itself (an alternative mental model could be that the given POSIX-second lasts 2 UTC-seconds). During a negative leap second, the given POSIX-second disappears…

Your computer periodically syncs with other computers to compensate for the time drift. Posix is just an API and a set of conventions. What your computer syncs with (typically via NTP), is a bunch of very precise clocks. Without that, you'd have a lot of time drift. The reason POSIX ignores leap seconds is because a leap second is well below the margin of error that most computer clocks have. They simply are not prec…

> That's also why the leap second correction is not a big deal because it just happens when computers sync. A few seconds correction is just a routine correction. Happens all the time.

That may be how things work for someone's word processor appliance, but on Linux/etc. NTPD or chrony continually estimate your local clocks drift and compensate for it and change their polling rate as a function of uncertainty (e.g. from temperature effects). They save the estimate drift rate in a persistent file on disk (chrony can optionally compensate for temperature effects; see tempcomp in the manpage).

On some random supermicro server here the crhony drift file says that the clock is slow by -33.208515 parts per million (not atypical for a non-temp-compensated oscillator), with an uncertainty of 0.031571 in that measurement.

As a result other than leap seconds there is no discontinuity in your local time, no few seconds correction that you suggest. Just a continuous clock that is steered smoothly to agree with UTC.

This is really important when you're dealing with subsecond events that must be synchronized among distributed systems.

Hosts on my network here that have no special handling of their time keeping will have time that agrees with each other within +/- 100 microseconds (and with UTC, for that matter, thanks to the local gps disciplined clock). Without a local GPS clock you'll get extra uncertainty from network path asymmetry, but that uncertainty is limited to the round trip time... which is a lot less than 1s if your network is at all usable interactively. :)

A 1 second jump would be gargantuan.

For many applications +/- 1 second is fine. But for others it isn't fine. Modern computers with network time available should have no problem being accurate much much better than 1 second.

Re: UTC vs. UT1 time and other nuances (2020)

#26
The author argues that only TAI would make sense to an alien civilization, but I don't think that's true at all. I think they miss the fact that it also is only defined within the reference frame of the Earth and also that it depends on many technically subtle aspects.

Especially if one only wants to communicate times between the civilizations, such as meet here at 13:00 in exactly three years from now. This is much easier to communicate based on rotation angles of the Earth than on a atomic time scale that would need to be transferred very precisely to be useful at all.

Re: UTC vs. UT1 time and other nuances (2020)

#27

> Essentially, UTC is a compromise devised to satisfy the needs of two communities of users:* Astronomers and navigators, * Physicists and engineers I think author is wrong about astronomers, for whom UTC is an unwanted complication. Astronomers use sidereal time, which is unrelated to ther apparent motion of the sun. For short intervals, physicists and engineers may as well use atomic time. The WP article on UTC has…

UT1 (and therefore UTC) is however a better starting point for calculating the sidereal time than TAI since it is connected to the rotation of the Earth, whereas TAI is not. This way the relation to calculate the (L)ST only depends on fixed constants and the time and date.

Also UT1 is actually measured based on distant celestial objects, because it is easier to measure those at very high precision than the precise transit time of the Sun.

Re: UTC vs. UT1 time and other nuances (2020)

#28
After reading the comments, it seems to me a theme is that everyone thinks somebody else is mistaken or misunderstanding the subject. This is not a complaint, but an observation on how difficult and slippery this subject is! I, at least, hardly understand it at all.

Re: UTC vs. UT1 time and other nuances (2020)

#29
post #22
post #17

Earlier quoted context omitted.

If people don't like leap seconds, there is no need to redefine UTC; they can just use TAI today. That gives them the additional advantage of not having to handle leap seconds in the past, because software that handles historical UTC timestamps will always need to know about the leap seconds that have already happened.

Spoken like someone who hasn't attempted this. :) All our computer and protocol infrastructure is setup to handle and distribute UTC. Everything else you talk to is speaking UTC. Trying to use TAI in a UTC world doesn't save you from dealing with leapseconds in the slightest: You get all the leapsecond induced problems just obtaining TAI from your UTC feeds and them you get them again at every boundary where you need…

[deleted]

Re: UTC vs. UT1 time and other nuances (2020)

#30

> Essentially, UTC is a compromise devised to satisfy the needs of two communities of users:* Astronomers and navigators, * Physicists and engineers I think author is wrong about astronomers, for whom UTC is an unwanted complication. Astronomers use sidereal time, which is unrelated to ther apparent motion of the sun. For short intervals, physicists and engineers may as well use atomic time. The WP article on UTC has…

UT1 (and therefore UTC) is however a better starting point for calculating the sidereal time than TAI since it is connected to the rotation of the Earth, whereas TAI is not. This way the relation to calculate the (L)ST only depends on fixed constants and the time and date. Also UT1 is actually measured based on distant celestial objects, because it is easier to measure those at very high precision than the precise tr…

That depends on if UTC alone is an accurate enough estimate of UT1 for you. If you only need to know UT1 to within +/- 0.9 seconds, then you can just use UTC and you're done.

If you'd like greater accuracy, UTC isn't a great starting point because UTC's leap seconds complicate getting an accurate estimate of UT1. Its hard to tell if your local idea of UTC has had the latest leap second applied or has had false leap seconds applied (or worse, accidentally received a leap smeared source, which can't be backed out to convert to UT1).

If you're going to produce a more accurate estimate of UT1 either using interpolations of IERS bulletin B predictions or a model based on the daily USNO ultra-rapid UT1 VLBI measurements the leap seconds don't do anything to help you, but they can mess up your calculations because you need to correctly and consistently back them out.

So essentially the practice of leap seconds helps applications that need UT1 to within better than an hour or two (otherwise just using TAI with offset or TAI plus a static linear correction is good for thousand of years), but hurts applications that need subsecond UT1 accuracy, hurts anyone that needs consistent or accurate duration, and creates a lot of software bugs including ones that can show up when there hasn't actually been a leap second.

I would argue that today the number of applications that need UT1 at all are much smaller and less significant than ones that need subsecond consistent durations or times. And that of the applications that want UT1 most either don't need leapseconds at all (e.g. TAI or TAI plus the simplest static linear correction is enough) or would prefer better than 1 second accuracy, where at best leapseconds don't help and in practice they add a lot of complexity and still sometimes cause failure.

Post reply on HN