Proposal for new ISO C 9x time API

Ken Pizzini ken at halcyon.com
Wed Oct 7 09:12:22 UTC 1998


Markus Kuhn <Markus.Kuhn at cl.cam.ac.uk> wrote:
>  If you have a TAI timestamp and what to
> print it as a TAI timestamp, then you just pass to strfxtime the TAI
> timestamp and specify NULL as the time zone. NULL means that the output
> shall be a "UTC time", but since the relationship between xtime and
> broken-down time is identical for both TAI and UTC, you will get the
> correct TAI output as well with NULL. Therefore, strfxtime can also be
> passed TAI timestamps with a NULL timezone_t in order to print correct
> TAI timestamps and strftime() does not even have to know about that this
> is a TAI timestamp.

I'm sorry, I still fail to follow this.  1972-01-01 00:00:00 UTC
has a TIME_UTC xtime of {86400*365*2,0} and TIME_TAI has an xtime
of {8600*365*2+10,0}, and TIME_UTC counts non-leapseconds while TIME_TAI
counts all seconds, including leapseconds.  So the xtime values for the
same instant in time on these two clocks will always differ by (TAI-UTC)
seconds, and values on these two clocks will differ for the same
broken-down time representation (except perhaps for the brief period of
history when TAI==UT1 held, if you want to speculate on the pre-1972
relationship between TAI and "UTC").

		--Ken Pizzini



More information about the tz mailing list