[LEAPSECS] Some definitions --> practically stated

Paul Sheer p at 2038bug.com
Tue Mar 8 21:12:49 EST 2011



If it helps, perhaps we can revisit some terminology....


NTP Time

NTP time is a 32-bit logical second count since 1900 (with a 32-bit
subsecond part) with 86400 logical seconds per day. On the leap second,
NTP time subtracts by 1 full second - i.e. it has a step jump of 1 full
second *back* in time. NTP time tracks GPS time less the number of leap
seconds.


Unix time in practice

Unix time is the realization in practice of Posix time on Unix (and
Unix-like and other OS) computers. It has 86400 logical seconds per day.
It tracks NTP time with one exception: on the leap second it *stops*
(usually) for one full second *instead* *of* going backward by one full
second. It is a 32/64-bit (signed) value of logical seconds since 1970,
or exactly NTP time minus 2208988800. Unix time is the time most of the
world's computers display. Unix time (as ascii) is the time most of the
world *thinks* is legal time. They are mostly right about this, except
near the leap second.


Posix time

Posix time is just a definition of the relationship between days and
logical seconds: i.e. there are 86400 of them in a day and the first day
is 1970-01-01. Posix time is a 32/64-bit (signed) logical second value.


UTC

UTC is the human readible (ASCII) realization of time with proper
inclusion of the leap second so that some minutes have 61 seconds,
for example 2012-12-31 23:59:60. Except near the leap second, Unix
time, NTP time, and UTC can be converted between each other precisely
and losslessly (reversibly). Unix time (as displayed in ASCII) and UTC
differ only in that Unix time pauses on the leap second for a full extra
second, whereas UTC counts up to 60. They otherwise tick over
identically. Almost no computers on earth display proper UTC across the
leap second, but few lay people know this (or care).


Olson right time

Olson right time is the computer-internal realization of UTC, *even*
*though* *no* *standard* *defines* *this* (I think).

Olson right time is one of two time scales the Olson library supports:
right time and regular unix (aka "posix") time. Olson right time is an
SI (caesium) second count since 1970 as a 32/64-bit value. Olson right
time can *always* be converted to UTC and back again *losslessly* even
on a leap second. Olson right time cannot be used on a Unix system
because:

1) Olson right time has days that are sometimes 86401 seconds,
2) Olson right time values are offset with Unix time values (currently)
by 24 seconds,
3) OS+NTP support does not generate Olson right time time stamps, and
4) there is no such thing as a perfect *future* Olson right time because
one doesn't know if a leap second will be inserted that will offset it
by say 1 second.

For these reasons of incompatability (with millions of existing Unix
programs), the Olson time library is always installed to use its other
"broken" posix time scale.

Olson right time is GPS time plus 9.


GPS time

GPS time is Olson right time less 9, and TAI less 19. GPS time has an
extra field for the current leap second count since 1980 (when there
were only 9 leap seconds).


TAI time

TAI time is the number of SI seconds since 1970 plus 10. TAI is Olson
right time plus 10. TAI is also a second count, but unlike Olson time,
its precision is arbitrary.


UTC-SLS

UTC-SLS is Unix time without a 1 second pause. Instead, time adjusts
with a well-defined gradient over a course of time near the leap second.

-paul







More information about the LEAPSECS mailing list