[tz] Leap seconds

Zefram zefram at fysh.org
Fri Nov 4 19:19:31 UTC 2011


Thom Hehl wrote:
>        or does that mean that it uses the actual time and I have to
>adjust first with leap seconds if I want an accurate conversion?

You do not make extra adjustment for leap seconds.  The standard
arrangement is that time() does not count leap seconds; time() % 86400 ==
0 at every UT midnight.  zic also has an option to support a non-standard
arrangement where time() does count leap seconds since 1972 (but doesn't
count the pre-1972 partial leaps, and makes no leap-like adjustment for
the pre-UTC era).  You should use the tzfiles that match your system.
If you're working independently of your system's time_t, it's almost
certainly more convenient to use the tzfiles for the standard arrangement
(which the Makefile calls "posix"), in which case you don't need to make
any provision at all for leap seconds.

-zefram



More information about the tz mailing list