[tz] Decoding timezone data

Zefram zefram at fysh.org
Mon Nov 7 19:25:18 UTC 2011


Thom Hehl wrote:
>2661690496, 2693140096, 2759063296, ...

You've interpreted a signed 32-bit field as unsigned.  2661690496 is
really -1633276800, which is 1918-03-31T08:00:00Z, which corresponds to

Rule    US      1918    1919    -       Mar     lastSun 2:00    1:00    D

in 1918 with a -6:00 standard offset as called for by

Zone America/Kentucky/Louisville -5:43:02 -     LMT     1883 Nov 18 12:16:58
                        -6:00   US      C%sT    1921

and similarly for the others.  tzfile(5) says the field is "of type
long", which in C is implicitly a signed type; unsigned would have to
be explicitly stated.  You might find the 64-bit version of the offsets
clearer, where instead of the 0x9ea62c80 that you're misinterpreting
you'll see 0xffffffff9ea62c80.

-zefram



More information about the tz mailing list