Inconsistancy between mktime and system time accross leapsecond
Garrett Wollman
wollman at csail.mit.edu
Sat Aug 6 19:12:53 GMT 2005
<<On Sat, 06 Aug 2005 13:00:24 -0600 (MDT), "M. Warner Losh" <imp at bsdimp.com> said:
> You are right that all other :60 situations should normalize to the
> next day. There are many things that depend on this behavir.
> However, :60 means 'the next second after :59'. For all non-leap
> second days, this is the first second of the next day. For leap
> second days, this is the repated second...
In POSIX, there are no "leap second days" and "non-leap second days".
The behavior of mktime() must be equivalent to the formula in XBD
section 4.4. The Standard is clear and conforming implementations
must implement the behavior described:
# The relationship between the tm structure (defined in the <time.h>
# header) and the time in seconds since the Epoch is that the result
# shall be as specified in the expression given in the definition of
# seconds since the Epoch (see the Base Definitions volume of IEEE Std
# 1003.1-2001, Section 4.14, Seconds Since the Epoch) corrected for
# timezone and any seasonal time adjustments, where the names in the
# structure and in the expression correspond.
(XSH page 765 in the original edition of the Standard.)
The Standard may be wrong, but the committee has been unable to make
progress on this issue in more than a decade of sometimes-contentious
debate, so the existing language stands.
-GAWollman
More information about the freebsd-standards
mailing list