Time Libraries Rough Draft

David Menendez zednenem at psualum.com
Fri Feb 11 19:15:09 EST 2005


Daan Leijen writes:

> clock: measures passage of absolute time (time difference). Best       
>     available unit is (TAI) SI seconds (ie. cesium atom
>   oscillations)
> 
> calendar: gives time *stamps* to human related notion of time. Can be
>             used to calculate calendar time differences, ie. human
>             notions of time difference, like days and months, and yes,
>             *calendar* seconds (ie. not absolute SI seconds).
> 
> TAI is a clock. Sometimes they give it as date, but really, it is just
> SI-seconds since some epoch (specified as an UTC calendar date!)

This could be correct, but my understanding is that TAI and UTC are both
calendars that are based on the same clock. The difference is that the
UTC clock/calendar conversion requires a leap-second table and the TAI
conversion does not.

The problem is that NTP is based on a different clock where some seconds
are longer than others.

> Now what I understand about implementation:
> 
> - gettimeofday() returns the number of seconds since epoch (a UTC
> date)
> 
> What kind of seconds does it return?  Well, (A) sometimes these are
> just SI-seconds (which means we can derive TAI from that), but
> sometimes (B) it returns UTC-seconds -- ie. the absolute SI-second
> count, plus/minus any leap seconds that have occurred.

I think you mean "POSIX-seconds" instead of "UTC-seconds" here.
Otherwise, (A) and (B) seem identical to me.
-- 
David Menendez <zednenem at psualum.com> | "In this house, we obey the laws
<http://www.eyrie.org/~zednenem>      |        of thermodynamics!"


More information about the Libraries mailing list