Time

Ashley Yakeley ashley at semantic.org
Thu Jan 27 08:00:47 EST 2005


In article 
<3429668D0E777A499EE74A7952C382D1031137AF at EUR-MSG-01.europe.corp.microso
ft.com>,
 "Simon Marlow" <simonmar at microsoft.com> wrote:

> This is quite a subtle point.  What people have been referring to as
> "UTC seconds" I would call time t.  time t does not include leap seconds
> in its count; rather the actual duration of a second gets longer around
> a leap second.

Yes. Unlike UTC, TAI etc., time_t is ambiguous at leap seconds. Even 
knowing when leap seconds occur, we can't perfectly convert time_t to 
UTC or TAI.

Unfortunately time_t is what gettimeofday and the other system calls 
return.

> UTC is a calendar in which some minutes have 61 seconds.
> 
> My library in fact maps both seconds to 23:59:59 at a leap second:

The alternative would be to allow ctSec to go up to 60. I prefer a 
(days,ticks) format for representing UTC rather than CalendarTime, but 
either way, it ought to be possible to represent UTC unambiguously even 
if time from the system clock is broken. That way we play well with 
someone else's better clock function.

-- 
Ashley Yakeley, Seattle WA



More information about the Libraries mailing list