Re: [LEAPSECS] What problems do leap seconds *really* create?

From: Markus Kuhn <Markus.Kuhn_at_CL.CAM.AC.UK>
Date: Thu, 30 Jan 2003 15:23:03 +0000

John Cowan wrote on 2003-01-30 13:01 UTC:
> Markus Kuhn scripsit:
> > Unix timestamps have always been meant to be an encoding of a
> > best-effort approximation of UTC.
> Unix is in fact older than UTC.

This is getting slightly off-topic, but Unix slowly evolved and was
reimplemented various times during the first half of the 1970s and the
early versions probably didn't have a clock. It didn't exist in practice
outside Bell Labs before 1976. Gory details are on:

> > They have always counted the non-leap seconds since 1970-01-01.

> The Posix interpretation is only a few years old, and a break with Unix
> history. Before that, time_t ticked SI seconds since the epoch (i.e.
> 1970-01-01:00:00:00 GMT = 1970-01-01:00:00:10 TAI).

Sorry, you just make this up. Unix machines ticked the seconds of their
local oscillator from boot to shutdown. Local oscillator seconds differ
from SI seconds by typically +/- 10^-5 s or worse. Unix time had
multiple or fractional inserted and deleted leap seconds whenever the
administrator brutally readjusted the local clock using the
settimeofday(2) system call closer to UTC. Only much later in the 1980s
did the Berkeley Unix version add the adjtime(2) system call to allow
smooth manual adjustment towards UTC by changing the length of the Unix
second relative to the local oscillator second by IIRC up to 1%. The
entire question of the relation of Unix time to UTC and TAI came only up
at roughly the same time as POSIX in the late 1980s when people started
to get interested in time synchronization over LANs and (in Europe)
DCF77 radio receivers.

> The time(2) man
> page in the Sixth Edition (unchanged in the Seventh) of Research
> Unix says:
> .I Time
> returns the time since 00:00:00 GMT, Jan. 1, 1970, measured
> in seconds.

Today we distinguish between "civilian" (UTC non-leap) seconds and
physical (SI) seconds. The authors of that manual very obviously didn't
make that distinction and you should not misrepresent them by claiming
that they did.

> IOW, it is a count of elapsed time since a certain moment, measured in
> SI seconds, and not an encoding of anything.

In practice, the source code shows that time_t values are converted to
UTC clock displays without a leap second table, therefore they clearly
are just meant to be an encoding of UTC clock display values and nothing
else. Implementations that do anything else are purely experimental, not
widely used, and can cause serious disruption in practice.

> Even today, you can install the ADO (and probably GNU) packages in
> either of two ways: "posix", in which there are no leap seconds and
> time_t's get the POSIX interpretation you reference; and "right", in
> which there are leap seconds and time_t is a count of seconds.
> Try setting your TZ to "right/<whatever>" and see what you get.

The so-called "right" mode in Olson's timezone library on that makes
time_t an encoding of TAI+10s instead of UTC, as well as Dan Bernstein's
libtai are both commonly regarded to be experimental implementations and
not recommended for general use. I don't know anyone who uses TAI+10s on
Unix in practice and it violates various standards. The reasons for why
it shouldn't be used have been discussed in great detail on Olson's tz
mailing list. You have completely misunderstood Unix time if you think
that the Olson "right" configuration has anything to do with it.


Markus Kuhn, Computer Lab, Univ of Cambridge, GB | __oo_O..O_oo__
Received on Thu Jan 30 2003 - 07:23:09 PST

This archive was generated by hypermail 2.3.0 : Sat Sep 04 2010 - 09:44:54 PDT