[LEAPSECS] Time math libraries, UTC to TAI

Brooks Harris brooks at edlmax.com
Wed Dec 28 12:33:17 EST 2016



On 2016-12-26 08:28 PM, Tony Finch wrote:
> Brooks Harris <brooks at edlmax.com> wrote:
>> The time_t 1970 epoch is fixed with respect to internal POSIX calculations,
>> but it "slips" a second with respect to UTC with each (positive) Leap Second
>> introduction because "23:59:60" goes missing.
> "Slip" makes it sound like a retrospective change in the relationship
> between UTC and time_t, with the scales sliding against each other, but it
> doesn't change - there's a fixed relationship between UTC second labels
> and time_t second labels, which remains the same however many leap seconds
> there are. In fact time_t is defined in terms of that relationship, and
> "seconds since the epoch" is just a simplified gloss.
Hi Tony,

"Slip" might not be the best term, but the effective alignment between 
time_t and UTC changes with each Leap Second.

POSIX "the epoch" origin, time_t = zero, is said to be coincident with 
"1970-01-01 00:00:00 UTC".

The YMDhms count progression across the first Leap Second 
(1972-06-30T23:59:60 (UTC)) as yielded by POSIX gmtime() is expected to be

time_t gmtime()                UTC
78796799 = 1972-06-30 23:59:59 = 1972-06-30T23:59:59 (UTC)
78796800 = 1972-07-01 00:00:00 = 1972-06-30T23:59:60 (UTC) << Leap Second
78796800 = 1972-07-01 00:00:00 = 1972-07-01T00:00:00 (UTC) << time_t reset
78796801 = 1972-07-01 00:00:01 = 1972-07-01T00:00:01 (UTC)

time_t must be reset after the Leap Second to maintain the alignment of 
the POSIX and UTC YMDhms representations. In effect the time_t origin 
has become coincident with "1972-01-01 00:00:00 UTC plus one Leap 
Second", or "1972-01-01 00:00:01 UTC". As David Mills says "... In 
effect, a new timescale is reestablished after each new leap second."

The NTP Timescale and Leap Seconds
3. How NTP and POSIX Reckon with Leap Seconds
https://www.eecis.udel.edu/~mills/leap.html

[ As discussed on the list many times, POSIX's use of the term "UTC" in 
describing "the epoch" as "1970-01-01 00:00:00 UTC" is troublesome 
because it lies before 1972-01-01T00:00:00 (UTC) in the "rubber band 
era", the development period of TAI and UTC when the TAI-UTC offset was 
not integral seconds. The name of the timescale and the TAI-UTC values 
during that span is somewhat controversial. In any event, as a practical 
matter, the origin of POSIX "the epoch" is usually taken to mean 
63072000 seconds before 1972-01-01 00:00:10 (TAI) = 1972-01-01T00:00:00 
(UTC) ].


-Brooks

>
> Tony.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist6.pair.net/pipermail/leapsecs/attachments/20161228/c9e9d179/attachment.html>


More information about the LEAPSECS mailing list