[LEAPSECS] Time math libraries, UTC to TAI

John Sauter John_Sauter at systemeyescomputerstore.com
Tue Dec 27 09:56:49 EST 2016


On Tue, 2016-12-27 at 01:28 +0000, 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.
> 
> Tony.

By not specifying the exact time of the Epoch, the standard causes
"seconds since the Epoch" to mean just an encoding of UTC into an
integer, rather than also the number of seconds since a fixed time.  I
did an experiment recently in which I used the time function to ask the
kernel for the "seconds since the Epoch", then subtracted that many
seconds from the current time, using the Tony Finch table of leap
seconds between 1958 and 1972.  The result I got was 1970-01-
01T00:00:28Z.  Next year it will be 1970-01-01T00:00:29Z.

"Seconds since the Epoch" is worse than a simplified gloss.  It is
misleading, though not quite false, since the standard doesn't say what
the Epoch is.  The name implies incorrectly that it is a count of
seconds since some vaguely-defined but fixed time.
    John Sauter (John_Sauter at systemeyescomputerstore.com)

-- 
PGP fingerprint E24A D25B E5FE 4914 A603  49EC 7030 3EA1 9A0B 511E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <https://pairlist6.pair.net/pipermail/leapsecs/attachments/20161227/220c9b08/attachment-0001.pgp>


More information about the LEAPSECS mailing list