[LEAPSECS] Leap seconds ain't broken, but most implementations are broken

Zefram zefram at fysh.org
Fri Jan 6 17:33:29 EST 2017


Brooks Harris wrote:
>It is often repeated on LEAPSECS that "Windows doesn't even know leap
>seconds". That's just not true. It knows very well about Leap Seconds in the
>same way other systems do but it (typical desktop versions) is lazy about
>when it updates

No, what it does doesn't involve knowing about leap seconds.  It's not
just applying the leap second late; it doesn't understand that a leap
second is pending.  Rather, it merely discovers, upon the next NTP query,
that its clock is wrong by a second.  It steps the clock to correct
the discrepancy, but even then has no understanding of how the error
came about.  If it does not consult an NTP server, then it will never
correct for the leap second.

Knowledge of the leap second would imply, at minimum, that the system
will eventually apply the leap second to its clock without any need to
consult an external source.  Putting aside this foolish notion of "lazy
update", one would expect a system with knowledge of the leap second to
show the correct time immediately after the leap.

>In Windows, FILETIME (an unsigned 64-bit value) is directly analogous to
>POSIX time_t except it has a 1601-01-01 00:00:00 epoch.

Also unable to represent the leap second itself.

>Note the fact that Microsoft updates Leap Seconds at midnight *local time* in
>Azure.

Wasn't it established that the report of that behaviour was mistaken?

>The approach makes some sense to me, actually. The "simultaneous with UTC"
>common practice creates a terribly complex and scattered matrix of Leap
>Second appearances in local time YMDhms representations.

Whereas applying a leap second at local midnight breaks the simple hour
offsets between zones.

>All this brings up a wider point; any Leap Second-to-Gregorian fix

Misplaced use of "Gregorian" here.  I think you want "TAI" there.

>applicable to many systems, not just POSIX and Linux.

Conveniently, library code to handle UTC<->TAI conversions and related
computations will tend to run happily even in the benighted lands
of Windows.

-zefram


More information about the LEAPSECS mailing list