On 2014-01-18 10:21, Poul-Henning Kamp wrote:
> In message <52da845e.4000...@hfx.eastlink.ca>, "Eric R. Smith" writes:
> 
>>> As you are no doubt aware, the POSIX time_t does not do that.
>>
>> Doesn't it? If POSIX time_t were in fact a count of SI seconds since the
>> epoch then the nature of the "leap second problem" would be quite
>> different. time_t uses at least the concept of "day".
> 
> No, in fact it doesn't, it just counts seconds, one after the other.
> 

Except leap seconds. That's a pretty important "except" for the purposes
of this list!

> The reason why leapseconds is a problem is that people assume that
> it *also* counts minutes, hours and days also.

My version of the POSIX standard is a bit old, but it basically defines
time_t in terms of days, hours, minutes, and seconds:

"A Coordinated Universal Time name (specified in terms of seconds,
minutes, hours, days since January 1 of the year, and calendar year
minus 1900) is related to a time represented as seconds since the epoch
according to the expression below.
...
[time_t =] tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
(tm_year-70)*31536000 + ((tm_year-69)/4)*86400"


AFAIK the only change to this in later POSIX standards is that the leap
year calculation was fixed.

So the "seconds" that time_t counts are defined in terms of days and
years, and are not in fact SI seconds.

In the rationale there is a discussion of leap seconds, including the
charming statement:

"...most systems are probably not synchronized to any standard time
reference. Therefore, it is inappropriate to require that a time
represented as seconds since the Epoch precisely represent the number of
seconds between the referenced time and the Epoch."


_______________________________________________
LEAPSECS mailing list
LEAPSECS@leapsecond.com
http://six.pairlist.net/mailman/listinfo/leapsecs

Reply via email to