Re: System time, UTC and leap seconds

xxxxx@pmatrix.com said:

My understanding is NT actually uses something closer to TAI time than
UTC time, except I believe the time service sets the current TAI time
to current UTC time.

The UNIX (or at elast Linux) documentation is explicit in what
it going on. The processor time is:

time since 00:00:00 GMT, January 1, 1970, measured in seconds.

The kernel therefore need not account for leap-anything. The library
functions localtime(3) and friends account for DST, Leap years and
leap seconds. The documentation is explicit in the matter of leap
seconds:

tm_sec The number of seconds after the minute, normally in
the range 0 to 59, but can be up to 61 to allow for
leap seconds.

Time calculations (i.e. time differences) are best done on processor
time and not UTC.

I know nothing of how NT manages calendar time (it should not bother,
leaving it instead to the C library) but the UNIX way seems reasonably
sensible.

Steve Williams “The woods are lovely, dark and deep.
xxxxx@icarus.com But I have promises to keep,
xxxxx@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep.”

Jan Bottorff wrote:

My understanding is NT actually uses something closer to TAI time than UTC
time, except I believe the time service sets the current TAI time to
current UTC time. It doesn’t handle leap seconds at all. So the reported
UTC time glosses over leap second events, and calculation on time don’t
account for leap seconds.

Interesting. So assuming that NT depends on an external source for
adjusting the time to account for leap seconds, I could ensure that it
actually uses TAI by ensuring that no leap second adjustment is done on the
system clock. At the expense of getting the wrong answer from any
application which believes the documentation and expects UTC, of course.

… The whole concept of time
calculation on UTC time values is just amazingly ugly.

I agree. What’s more, for the system to claim that it is giving you UTC
without adjusting for leap seconds is just plain wrong.

Jan Mikkelsen.