TAI zone?

Guy Harris guy at alum.mit.edu
Fri Jul 1 16:51:31 UTC 2011


On Jul 1, 2011, at 5:45 AM, Clive D.W. Feather wrote:

> Guy Harris said:
> 
>> There *is* no "UTC clock" in POSIX.  You cannot use only the POSIX APIs to convert a time_t, as returned by the POSIX time(), to the corresponding UTC time label, where the time label has HH:MM:SS; gmtime() will not do that for you, because gmtime() thinks that every minute ("minute" in the sense of period of time in which the minute counter of a clock ticks over) has exactly 60 seconds, which, for UTC time's minute counter, is not true.
> 
> Not quite. The conversion is well-defined,

...in the sense that "we have a formula that takes a time_t and spits out year/month/day/hour/minute/second".

> but sometimes two values on one side map to one value on the other side.

...so that there's no way to get the right UTC label for 2008-12-31 23:59:60 out of POSIX.

I.e., you cannot use only the POSIX APIs to convert a time_t, as returned by the POSIX time(), to the corresponding UTC time label for all values of time_t.



More information about the tz mailing list