<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am working on enabling the .NET TimeZoneInfo class to read time zone information from tzfiles.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;ve hit a snag with the latest tzdata 2015f.&nbsp; (I&#8217;m not sure when this change started, but the problem doesn&#8217;t occur with the tzfiles that are shipped with an Ubuntu 14.04 distribution.)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The problem is that the 2015f version of the tzdata contains an initial &quot;Transition Time&quot; that is out of order. The beginning of the America/Chicago tzfile looks like the following:<o:p></o:p></p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
<thead>
<tr>
<td width="149" style="width:111.75pt;border:solid windowtext 1.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"><b><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">Transition Time<o:p></o:p></span></b></p>
</td>
<td width="120" style="width:1.25in;border:solid windowtext 1.5pt;border-left:none;padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"><b><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">Transition Offset<o:p></o:p></span></b></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td width="149" style="width:111.75pt;border:solid windowtext 1.5pt;border-top:none;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333;background:yellow;mso-highlight:yellow">01/01/1970 00:00:00<o:p></o:p></span></p>
</td>
<td width="120" style="width:1.25in;border-top:none;border-left:none;border-bottom:solid windowtext 1.5pt;border-right:solid windowtext 1.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333;background:yellow;mso-highlight:yellow">-05:50:36<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="149" style="width:111.75pt;border:solid windowtext 1.5pt;border-top:none;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">11/18/1883 18:00:00<o:p></o:p></span></p>
</td>
<td width="120" style="width:1.25in;border-top:none;border-left:none;border-bottom:solid windowtext 1.5pt;border-right:solid windowtext 1.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">-06:00:00<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="149" style="width:111.75pt;border:solid windowtext 1.5pt;border-top:none;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">03/31/1918 08:00:00<o:p></o:p></span></p>
</td>
<td width="120" style="width:1.25in;border-top:none;border-left:none;border-bottom:solid windowtext 1.5pt;border-right:solid windowtext 1.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">-05:00:00 DST<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="149" style="width:111.75pt;border:solid windowtext 1.5pt;border-top:none;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">10/27/1918 07:00:00<o:p></o:p></span></p>
</td>
<td width="120" style="width:1.25in;border-top:none;border-left:none;border-bottom:solid windowtext 1.5pt;border-right:solid windowtext 1.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,sans-serif;color:#333333">-06:00:00<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Notice the first entry is for 1970, and then the next entry is for 1883. This breaks the documentation in 'man tzfile':<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.2in">
The above header is followed by tzh_timecnt four-byte values of type long, <b>sorted in ascending order</b>. These values are written in &quot;standard&quot; byte order. Each is used as a transition time (as returned by time(2)) at which the rules for computing local
 time change.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This causes the TimeZoneInfo parsing code to throw an exception because it is assuming these transitions are sorted in ascending order.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is this an intentional change in the tzfiles?&nbsp; If so, will the tzfile man page be updated for this change?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Eric Erhardt<o:p></o:p></p>
</div>
</body>
</html>