[LEAPSECS] [time-nuts] Leap Quirks

Magnus Danielson magnus at rubidium.dyndns.org
Mon Jan 5 05:45:57 EST 2009


Zefram skrev:

> 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. 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.


Actually, this is just implementing the POSIX UTC to time_t mapping.

2008-12-31T23:59:60Z and 2009-01-01T00:00:00Z maps to the same POSIX
time_t second so by reversing the stepping of second just done at the
beginning of the leap second implements this.

The NTP time follows the same jump fashion, but with a different offset.

The figure at the bottom of
http://www.cis.udel.edu/~mills/leap.html
shows graphically what is going on and the table give the same in
numbers. A POSIX time_t column could be added, but it would just be a
static offset from the NTP seconds.

A simplified model of the POSIX time_t would be

time_t = d*86400 + h*3600 + m*60 + s

which helps to have written out when comparing the two cases.

Cheers,
Magnus


> -zefram

> _______________________________________________

> LEAPSECS mailing list

> LEAPSECS at leapsecond.com

> http://six.pairlist.net/mailman/listinfo/leapsecs



More information about the LEAPSECS mailing list