Time zone confusion and implementation hints

Olson, Arthur David (NIH/NCI) [E] olsona at dc37a.nci.nih.gov
Tue Jul 6 21:02:31 UTC 2010

> After looking into the resulting files, I have the impression that the
> transition timestamps are all 32-bit, even in the 64-bit v2 section
> (half of the bytes in that area are 0). I assume that zic only creates
> transition records until before 2038. How can I extend that range? I
> didn't find a good place in the code.

Some 64-bit timestamps are created--take a look, for example, at America/Godthab.
But for those places whose current time zone rules can be represented by POSIX-style environment strings, the POSIX string is written at the very end of the file and is used for times after the last transition time recorded in the file, reducing the number of explicit transitions needed.

Even for places (such as Godthab) that CAN'T be represented by POSIX rules, only 400 years of transitions are written.
Since the Gregorian calendar is on a grand 400-year cycle (January 1, 2000 falls on a Saturday; January 1, 2400 falls on a Saturday) localtime can handle far-future timestamps using modular arithmetic.

Transition times through 2037 are written for the benefit of old systems that don't handle the POSIX-style string at the end.


More information about the tz mailing list