[LEAPSECS] [time-nuts] Leap Quirks

M. Warner Losh imp at bsdimp.com
Mon Jan 5 10:11:29 EST 2009


In message: <20090105102452.GJ14473 at fysh.org>
Zefram <zefram at fysh.org> writes:

: M. Warner Losh wrote:

: >So time_t is effectively defined in POSIX to be:

: >

: > d * 86400 + min(tod(x), 86399)

: >

: >where d is the number of days since 01-01-1970, and tod is the second

: >since midnight within the day.

:

: Actually it's simpler than that. The expression given by POSIX amounts to

:

: d * 86400 + tod(x)

:

: so a leap second appears identical to the first second of the next day,

: rather than a repeat of the previous second.


That's what the broken down time translation results in. However, I
don't think that POSIX specifies the 'proper' value for the leap
second because leap seconds are explicitly excluded from the spec.
The reason it maps to the above is due to the normalization rules for
the '60' part of the broken down time, not because it is a leap second
and is defined to map there.


: What's actually implemented

: by particular kernels varies; Linux, for example, does something in

: between these, jumping backwards (by 1) a few milliseconds after the

: start of the leap second.


FreeBSD too. Any NTP based kernel does this.

Warner


More information about the LEAPSECS mailing list