[tz] Question about leap seconds

Zefram zefram at fysh.org
Wed Sep 11 15:55:49 UTC 2013


random832 at fastmail.us wrote:
>Two things: Can a transition time ever reasonably fall _on_ a leap
>second,

Reasonably, no.  Where the underlying base time scale has leap seconds,
timezones to be used with that time scale can only use offsets of
integral minutes.  In that context it would be most strange to use a
transition time that was not on a minute boundary.  Every timezone used
in practice has been that way since Liberia switched from LMT in 1972.
It's theoretically possible to have a non-minute transition, of course,
but transitioning on a leap second would further require that the
authority defining the timezone specifically intends it to be used with
leap seconds (unusual), and specifically intends to be awkward.

>        and can the zic input format represent this case?

Textually the leap second can be represented uniquely as ...:60, and from
inspection of the source I believe zic will actually accept it, but it
doesn't preserve the distinction between that and the following second.

>POSIX timestamps so the data regarding one time zone is independent of
>whether leap seconds are enabled or not.

Generalising a bit: it is sensible to represent a timezone's behaviour
in a way that's independent of the local interpretation of time_t.
Decoding time_t to a UTC time should be a separate step from converting
a UTC time to local time.

-zefram


More information about the tz mailing list