correct • elegant • free

△ uk.misc △

◅ Boycott the Police

Free calls to ISPs ▻

UK Appeal - Keep Summer Time

In article <63k5b3$jhc$>,
Ian G Batten  <> wrote:
>The problem with Unix clocks is that leap seconds are handled by
>stepping the clock, rather than by noting that a leap second took

The specific problem is that some applications get upset by the
(system's idea of) time going backwards.

A minor issue is that---last time I looked---xntpd stepped the clock a
few seconds after the leap second had actually occurred.  Timestamps
generated during those few seconds are wrong.

>        In other words, although you can take a time_t from the past,
>push it through localtime() and get the right answer (in other words,
>historical daylight time is handled correctly) you can't be sure that it
>hasn't been mangled by the addition of leap seconds.

The advantage of stepping the clock for each leap second is that you
don't need leap second tables in order to know the current UTC time.
Effectively, every time a leap second is inserted, the NTP epoch shifts.

But no matter what your clock ticks, you need a table of leapseconds if
you need to do accurate (to the second) conversions between historical
civil times and system timestamps.

A corollary is that it is absolutely impossible to perform accurate
conversions between future civil times and system timestamps, because
you don't know when leap seconds will occur in the future.

>                                                      I think the
>no-leap-second standard is TAI, and there are regular mutterings that
>clocks really should tick that.

It is (Temps Atomique International), and my system clock already does.

The argument is that, since you need a table of leap seconds to do
historical time correctly, you might as well use the table when
calculating current time, too.  Then you can have your system clock tick
TAI, and never have to step it.

The Arthur Olsen timezone code, which all but the most benighted Unix
systems use, supports a TAI system clock and a table of leap seconds.
(Unfortunately, POSIX forbids its use in this mode, but POSIX needs to
be fixed.)

Of course, this stuff is all pretty abstruse.  The NTP model has never
caused me any real life problems; I'm just an epicure of time.  We're
not talking about anything like the fundamental brokenness of the
Windows 95 time model.

Tim Goodwin | "Gateways are designed for the purpose of losing information;
Cygnus, UK  | some do better than others." -- Dave Crocker

Original headers:

From: (Tim Goodwin)
Newsgroups: uk.telecom,uk.misc
Subject: Re: UK Appeal - Keep Summer Time
Date: 3 Nov 1997 11:17:45 GMT
Organization: Cygnus Solutions Ltd, UK
Message-ID: <63kbsp$an0$>
References: <>
  <63f08m$> <63hr3o$>
X-Newsreader: trn 4.0-test58 (13 May 97)

△ uk.misc △

◅ Boycott the Police

Free calls to ISPs ▻