[tz] tzfiles contain Unix epoch for the first transition time

Eric Erhardt Eric.Erhardt at microsoft.com
Thu Aug 13 16:21:47 UTC 2015


I am working on enabling the .NET TimeZoneInfo class to read time zone information from tzfiles.

I've hit a snag with the latest tzdata 2015f.  (I'm not sure when this change started, but the problem doesn't occur with the tzfiles that are shipped with an Ubuntu 14.04 distribution.)
The problem is that the 2015f version of the tzdata contains an initial "Transition Time" that is out of order. The beginning of the America/Chicago tzfile looks like the following:
Transition Time

Transition Offset

01/01/1970 00:00:00

-05:50:36

11/18/1883 18:00:00

-06:00:00

03/31/1918 08:00:00

-05:00:00 DST

10/27/1918 07:00:00

-06:00:00

Notice the first entry is for 1970, and then the next entry is for 1883. This breaks the documentation in 'man tzfile':
The above header is followed by tzh_timecnt four-byte values of type long, sorted in ascending order. These values are written in "standard" byte order. Each is used as a transition time (as returned by time(2)) at which the rules for computing local time change.
This causes the TimeZoneInfo parsing code to throw an exception because it is assuming these transitions are sorted in ascending order.
Is this an intentional change in the tzfiles?  If so, will the tzfile man page be updated for this change?
Eric Erhardt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20150813/23c93a2d/attachment.html>


More information about the tz mailing list