tz-how-to.html revision 1.7
11.1Schristos<!DOCTYPE html
21.1Schristos	PUBLIC "-//W3C//DTD HTML 4.01//EN"
31.1Schristos	"http://www.w3.org/TR/html4/strict.dtd">
41.1Schristos<html>
51.3Schristos<head>
61.3Schristos<title>How to Read the tz Database</title>
71.3Schristos<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
81.5Schristos<style type="text/css">
91.5Schristospre {margin-left: 2em; white-space: pre-wrap;}
101.5Schristos</style>
111.3Schristos</head>
121.1Schristos<body>
131.1Schristos<h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
141.1SchristosDatabase</a> Source Files</h2>
151.1Schristos<h3>by Bill Seymour</h3>
161.1Schristos<p>This page uses the <code>America/Chicago</code> and
171.1Schristos<code>Pacific/Honolulu</code> zones as examples of how to infer
181.4Schristostimes of day from the <a href="tz-link.html">tz database</a>
191.1Schristossource files. It might be helpful, but not absolutely necessary,
201.1Schristosfor the reader to have already downloaded the
211.2Schristoslatest release of the database and become familiar with the basic layout
221.1Schristosof the data files. The format is explained in the &ldquo;man
231.1Schristospage&rdquo; for the zic compiler, <code>zic.8.txt</code>, in
241.1Schristosthe <code>code</code> subdirectory.</p>
251.1Schristos
261.1Schristos<p>We&rsquo;ll begin by talking about the rules for changing between standard
271.1Schristosand daylight saving time since we&rsquo;ll need that information when we talk
281.1Schristosabout the zones.</p>
291.1Schristos
301.1Schristos<p>First, let&rsquo;s consider the special daylight saving time rules
311.1Schristosfor Chicago (from the <code>northamerica</code> file in
321.1Schristosthe <code>data</code> subdirectory):</p>
331.1Schristos
341.1Schristos<table border="1">
351.1Schristos<tr>
361.1Schristos  <th colspan="6">From the Source File</th>
371.1Schristos</tr>
381.1Schristos<tr>
391.1Schristos  <td colspan="6" align="center"><table><tr><td>
401.1Schristos<pre>
411.1Schristos#Rule NAME    FROM TO   TYPE IN  ON      AT   SAVE LETTER
421.1SchristosRule  Chicago 1920 only  -   Jun 13      2:00 1:00 D
431.1SchristosRule  Chicago 1920 1921  -   Oct lastSun 2:00 0    S
441.1SchristosRule  Chicago 1921 only  -   Mar lastSun 2:00 1:00 D
451.1SchristosRule  Chicago 1922 1966  -   Apr lastSun 2:00 1:00 D
461.1SchristosRule  Chicago 1922 1954  -   Sep lastSun 2:00 0    S
471.1SchristosRule  Chicago 1955 1966  -   Oct lastSun 2:00 0    S
481.1Schristos</pre>
491.1Schristos  </td></tr></table></td>
501.1Schristos</tr>
511.1Schristos<tr>
521.1Schristos  <th colspan="6">Reformatted a Bit</th>
531.1Schristos</tr>
541.1Schristos<tr>
551.1Schristos  <th>From</th>
561.1Schristos  <th>To</th>
571.1Schristos  <th colspan="2">On</th>
581.1Schristos  <th>At</th>
591.1Schristos  <th>Action</th>
601.1Schristos</tr>
611.1Schristos<tr align="center">
621.1Schristos  <td colspan="2">1920 only</td>
631.1Schristos  <td colspan="2">June 13<small><sup>th</sup></small></td>
641.1Schristos  <td rowspan="6">02:00 local</td>
651.1Schristos  <td>go to daylight saving time</td>
661.1Schristos</tr>
671.1Schristos<tr align="center">
681.1Schristos  <td>1920</td>
691.1Schristos  <td>1921</td>
701.1Schristos  <td rowspan="5">last Sunday</td>
711.1Schristos  <td>in October</td>
721.1Schristos  <td>return to standard time</td>
731.1Schristos</tr>
741.1Schristos<tr align="center">
751.1Schristos  <td colspan="2">1921 only</td>
761.1Schristos  <td>in March</td>
771.1Schristos  <td rowspan="2">go to daylight saving time</td>
781.1Schristos</tr>
791.1Schristos<tr align="center">
801.1Schristos  <td rowspan="2">1922</td>
811.1Schristos  <td>1966</td>
821.1Schristos  <td>in April</td>
831.1Schristos</tr>
841.1Schristos<tr align="center">
851.1Schristos  <td>1954</td>
861.1Schristos  <td>in September</td>
871.1Schristos  <td rowspan="2">return to standard time</td>
881.1Schristos</tr>
891.1Schristos<tr align="center">
901.1Schristos  <td>1955</td>
911.1Schristos  <td>1966</td>
921.1Schristos  <td>in October</td>
931.1Schristos</tr>
941.1Schristos</table>
951.1Schristos
961.1Schristos<p>We&rsquo;ll basically just ignore the <code>TYPE</code> column.
971.1SchristosIn the 2007j release, the most recent as of this writing, the
981.1Schristos<code>TYPE</code> column never contains anything but a hyphen,
991.1Schristosa kind of null value. (From the description in <code>zic.8.txt</code>,
1001.1Schristosthis appears to be a mechanism for removing years from a set
1011.1Schristosin some localizable way. It&rsquo;s used in the file, <code>pacificnew</code>,
1021.1Schristosto determine whether a given year will have a US presidential election;
1031.1Schristosbut everything related to that use is commented out.)
1041.1Schristos
1051.7Schristos<p>The <code>SAVE</code> column contains the local (wall clock) offset from
1061.1Schristoslocal standard time.
1071.1SchristosThis is usually either zero for standard time or one hour for daylight
1081.1Schristossaving time; but there&rsquo;s no reason, in principle, why it can&rsquo;t
1091.1Schristostake on other values.
1101.1Schristos
1111.1Schristos<p>The <code>LETTER</code> (sometimes called <code>LETTER/S</code>)
1121.1Schristoscolumn can contain a variable
1131.1Schristospart of the usual abbreviation of the time zone&rsquo;s name, or it can just
1141.1Schristosbe a hyphen if there&rsquo;s no variable part. For example, the abbreviation
1151.1Schristosused in the central time zone will be either &ldquo;CST&rdquo; or
1161.1Schristos&ldquo;CDT&rdquo;. The variable part is &lsquo;S&rsquo; or &lsquo;D&rsquo;;
1171.1Schristosand, sure enough, that&rsquo;s just what we find in
1181.1Schristosthe <code>LETTER</code> column
1191.1Schristosin the <code>Chicago</code> rules. More about this when we talk about
1201.1Schristos&ldquo;Zone&rdquo; lines.
1211.1Schristos
1221.1Schristos<p>One important thing to notice is that &ldquo;Rule&rdquo; lines
1231.1Schristoswant at once to be both <i>transitions</i> and <i>steady states</i>:
1241.1Schristos<ul>
1251.1Schristos<li>On the one hand, they represent transitions between standard and
1261.1Schristosdaylight saving time; and any number of Rule lines can be in effect
1271.1Schristosduring a given period (which will always be a non-empty set of
1281.1Schristoscontiguous calendar years).</li>
1291.1Schristos<li>On the other hand, the <code>SAVE</code> and <code>LETTER</code>
1301.1Schristoscolumns contain state that exists between transitions. More about this
1311.1Schristoswhen we talk about the US rules.</li>
1321.1Schristos</ul>
1331.1Schristos
1341.1Schristos<p>In the example above, the transition to daylight saving time
1351.1Schristoshappened on the 13<small><sup>th</sup></small> of June in 1920, and on
1361.1Schristosthe last Sunday in March in 1921; but the return to standard time
1371.1Schristoshappened on the last Sunday in October in both of those
1381.1Schristosyears. Similarly, the rule for changing to daylight saving time was
1391.1Schristosthe same from 1922 to 1966; but the rule for returning to standard
1401.1Schristostime changed in 1955. Got it?</p>
1411.1Schristos
1421.1Schristos<p>OK, now for the somewhat more interesting &ldquo;US&rdquo; rules:</p>
1431.1Schristos
1441.1Schristos<table border="1">
1451.1Schristos<tr>
1461.1Schristos  <th colspan="6">From the Source File</th>
1471.1Schristos</tr>
1481.1Schristos<tr>
1491.1Schristos  <td colspan="6" align="center"><table><tr><td>
1501.1Schristos<pre>
1511.1Schristos#Rule NAME FROM TO   TYPE IN  ON        AT   SAVE LETTER/S
1521.1SchristosRule  US   1918 1919  -   Mar lastSun  2:00  1:00 D
1531.1SchristosRule  US   1918 1919  -   Oct lastSun  2:00  0    S
1541.1SchristosRule  US   1942 only  -   Feb 9        2:00  1:00 W # War
1551.1SchristosRule  US   1945 only  -   Aug 14      23:00u 1:00 P # Peace
1561.1SchristosRule  US   1945 only  -   Sep 30       2:00  0    S
1571.1SchristosRule  US   1967 2006  -   Oct lastSun  2:00  0    S
1581.1SchristosRule  US   1967 1973  -   Apr lastSun  2:00  1:00 D
1591.1SchristosRule  US   1974 only  -   Jan 6        2:00  1:00 D
1601.1SchristosRule  US   1975 only  -   Feb 23       2:00  1:00 D
1611.1SchristosRule  US   1976 1986  -   Apr lastSun  2:00  1:00 D
1621.1SchristosRule  US   1987 2006  -   Apr Sun&gt;=1   2:00  1:00 D
1631.1SchristosRule  US   2007 max   -   Mar Sun&gt;=8   2:00  1:00 D
1641.1SchristosRule  US   2007 max   -   Nov Sun&gt;=1   2:00  0    S
1651.1Schristos</pre>
1661.1Schristos  </td></tr></table></td>
1671.1Schristos</tr>
1681.1Schristos<tr>
1691.1Schristos  <th colspan="6">Reformatted a Bit</th>
1701.1Schristos</tr>
1711.1Schristos<tr>
1721.1Schristos  <th>From</th>
1731.1Schristos  <th>To</th>
1741.1Schristos  <th colspan="2">On</th>
1751.1Schristos  <th>At</th>
1761.1Schristos  <th>Action</th>
1771.1Schristos</tr>
1781.1Schristos<tr align="center">
1791.1Schristos  <td rowspan="2">1918</td>
1801.1Schristos  <td rowspan="2">1919</td>
1811.1Schristos  <td rowspan="2">last Sunday</td>
1821.1Schristos  <td>in March</td>
1831.1Schristos  <td rowspan="3">02:00 local</td>
1841.1Schristos  <td>go to daylight saving time</td>
1851.1Schristos</tr>
1861.1Schristos<tr align="center">
1871.1Schristos  <td>in October</td>
1881.1Schristos  <td>return to standard time</td>
1891.1Schristos</tr>
1901.1Schristos<tr align="center">
1911.1Schristos  <td colspan="2">1942 only</td>
1921.1Schristos  <td colspan="2">February 9<small><sup>th</sup></small></td>
1931.1Schristos  <td>go to &ldquo;war time&rdquo;</td>
1941.1Schristos</tr>
1951.1Schristos<tr align="center">
1961.1Schristos  <td colspan="2" rowspan="2">1945 only</td>
1971.1Schristos  <td colspan="2">August 14<small><sup>th</sup></small></td>
1981.1Schristos  <td>23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a></td>
1991.1Schristos  <td>
2001.1Schristos    rename &ldquo;war time&rdquo; to &ldquo;peace<br>time;&rdquo;
2011.1Schristos    clocks don&rsquo;t change
2021.1Schristos  </td>
2031.1Schristos</tr>
2041.1Schristos<tr align="center">
2051.1Schristos  <td colspan="2">September 30<small><sup>th</sup></small></td>
2061.1Schristos  <td rowspan="9">02:00 local</td>
2071.1Schristos  <td rowspan="2">return to standard time</td>
2081.1Schristos</tr>
2091.1Schristos<tr align="center">
2101.1Schristos  <td rowspan="2">1967</td>
2111.1Schristos  <td>2006</td>
2121.1Schristos  <td rowspan="2">last Sunday</td>
2131.1Schristos  <td>in October</td>
2141.1Schristos</tr>
2151.1Schristos<tr align="center">
2161.1Schristos  <td>1973</td>
2171.1Schristos  <td>in April</td>
2181.1Schristos  <td rowspan="6">go to daylight saving time</td>
2191.1Schristos</tr>
2201.1Schristos<tr align="center">
2211.1Schristos  <td colspan="2">1974 only</td>
2221.1Schristos  <td colspan="2">January 6<small><sup>th</sup></small></td>
2231.1Schristos</tr>
2241.1Schristos<tr align="center">
2251.1Schristos  <td colspan="2">1975 only</td>
2261.1Schristos  <td colspan="2">February 23<small><sup>rd</sup></small></td>
2271.1Schristos</tr>
2281.1Schristos<tr align="center">
2291.1Schristos  <td>1976</td>
2301.1Schristos  <td>1986</td>
2311.1Schristos  <td>last Sunday</td>
2321.1Schristos  <td rowspan="2">in April</td>
2331.1Schristos</tr>
2341.1Schristos<tr align="center">
2351.1Schristos  <td>1987</td>
2361.1Schristos  <td>2006</td>
2371.1Schristos  <td>first Sunday</td>
2381.1Schristos</tr>
2391.1Schristos<tr align="center">
2401.1Schristos  <td rowspan="2">2007</td>
2411.1Schristos  <td rowspan="2">present</td>
2421.1Schristos  <td colspan="2">second Sunday in March</td>
2431.1Schristos</tr>
2441.1Schristos<tr align="center">
2451.1Schristos  <td colspan="2">first Sunday in November</td>
2461.1Schristos  <td>return to standard time</td>
2471.1Schristos</tr>
2481.1Schristos</table>
2491.1Schristos
2501.1Schristos<p>There are two interesting things to note here.</p>
2511.1Schristos
2521.1Schristos<p>First, the time that something happens (in the <code>AT</code>
2531.7Schristoscolumn) is not necessarily the local (wall clock) time. The time can be
2541.1Schristossuffixed with &lsquo;s&rsquo; (for &ldquo;standard&rdquo;) to mean
2551.7Schristoslocal standard time, different from local (wall clock) time when observing
2561.7Schristosdaylight saving time; or it can be suffixed with &lsquo;g&rsquo;,
2571.1Schristos&lsquo;u&rsquo;, or &lsquo;z&rsquo;, all three of which mean the
2581.1Schristosstandard time at the
2591.2Schristos<a href="https://en.wikipedia.org/wiki/Prime_Meridian">prime meridian</a>.
2601.1Schristos&lsquo;g&rsquo; stands for &ldquo;<a
2611.1Schristoshref="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">GMT</a>&rdquo;;
2621.1Schristos&lsquo;u&rsquo; stands for &ldquo;<a
2631.1Schristoshref="https://en.wikipedia.org/wiki/Universal_Time">UT</a>&rdquo; or &ldquo;<a
2641.1Schristoshref="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>&rdquo;
2651.1Schristos(whichever was official at the time); &lsquo;z&rsquo; stands for the
2661.1Schristos<a href="https://en.wikipedia.org/wiki/Nautical_time">nautical time zone</a>
2671.1SchristosZ (a.k.a. &ldquo;Zulu&rdquo; which, in turn, stands for &lsquo;Z&rsquo;).
2681.7SchristosThe time can also be suffixed with &lsquo;w&rsquo; meaning local (wall
2691.7Schristosclock) time; but it usually isn&rsquo;t because that&rsquo;s the
2701.1Schristosdefault.</p>
2711.1Schristos
2721.1Schristos<p>Second, the day in the <code>ON</code> column, in addition to
2731.1Schristos&ldquo;<code>lastSun</code>&rdquo; or a particular day of the month,
2741.1Schristoscan have the form, &ldquo;<code>Sun&gt;=</code><i>x</i>&rdquo; or
2751.1Schristos&ldquo;<code>Sun&lt;=</code><i>x</i>,&rdquo; where <i>x</i> is a day
2761.1Schristosof the month. For example, &ldquo;<code>Sun&gt;=8</code>&rdquo; means
2771.1Schristos&ldquo;the first Sunday on or after the eighth of the month,&rdquo; in
2781.1Schristosother words, the second Sunday of the month. Furthermore, although
2791.1Schristosthere are no examples above, the weekday needn&rsquo;t be
2801.1Schristos&ldquo;<code>Sun</code>&rdquo; in either form, but can be the usual
2811.1Schristosthree-character English abbreviation for any day of the week.</p>
2821.1Schristos
2831.1Schristos<p>And the US rules give us more examples of a couple of things
2841.1Schristosalready mentioned:</p>
2851.1Schristos
2861.1Schristos<ul>
2871.1Schristos<li>The rules for changing to and from daylight saving time are
2881.1Schristosactually <i>different sets</i> of rules; and the two sets can change
2891.1Schristosindependently. Consider, for example, that the rule for the return to
2901.1Schristosstandard time stayed the same from 1967 to 2006; but the rule for the
2911.1Schristostransition to daylight saving time changed several times in the same
2921.1Schristosperiod.  There can also be periods, 1946 to 1966 for example, when no
2931.1Schristosrule from this group is in effect, and so either no transition
2941.1Schristoshappened in those years, or some other rule is in effect (perhaps a
2951.1Schristosstate or other more local rule).</li>
2961.1Schristos
2971.1Schristos<li>The <code>SAVE</code> and <code>LETTER</code> columns
2981.1Schristoscontain <i>steady state</i>, not transitions. Consider, for example,
2991.1Schristosthe transition from &ldquo;war time&rdquo; to &ldquo;peace time&rdquo;
3001.1Schristosthat happened on August 14, 1945. The &ldquo;1:00&rdquo; in
3011.1Schristosthe <code>SAVE</code> column is <i>not</i> an instruction to advance
3021.1Schristosthe clock an hour. It means that clocks should <i>be</i> one hour
3031.1Schristosahead of standard time, which they already are because of the previous
3041.1Schristosrule, so there should be no change.</li>
3051.1Schristos
3061.1Schristos</ul>
3071.1Schristos
3081.1Schristos<p>OK, now let&rsquo;s look at a Zone record:</p>
3091.1Schristos
3101.1Schristos<table border="1">
3111.1Schristos<tr>
3121.1Schristos  <th colspan="5">From the Source File</th>
3131.1Schristos</tr>
3141.1Schristos<tr>
3151.1Schristos  <td colspan="6" align="center"><table><tr><td>
3161.1Schristos<pre>
3171.7Schristos#Zone       NAME      STDOFF   RULES FORMAT [UNTIL]
3181.1SchristosZone  America/Chicago -5:50:36 -       LMT  1883 Nov 18 12:09:24
3191.1Schristos                      -6:00    US      C%sT 1920
3201.1Schristos                      -6:00    Chicago C%sT 1936 Mar  1  2:00
3211.1Schristos                      -5:00    -       EST  1936 Nov 15  2:00
3221.1Schristos                      -6:00    Chicago C%sT 1942
3231.1Schristos                      -6:00    US      C%sT 1946
3241.1Schristos                      -6:00    Chicago C%sT 1967
3251.1Schristos                      -6:00    US      C%sT
3261.1Schristos</pre>
3271.1Schristos  </td></tr></table></td>
3281.1Schristos</tr>
3291.1Schristos<tr>
3301.1Schristos  <th colspan="5">Columns Renamed</th>
3311.1Schristos</tr>
3321.1Schristos<tr>
3331.1Schristos  <th rowspan="2">Standard Offset<br>
3341.1Schristos    from <a href="https://en.wikipedia.org/wiki/Prime_Meridian">Prime
3351.1Schristos    Meridian</a></th>
3361.1Schristos  <th rowspan="2">Daylight<br>Saving Time</th>
3371.1Schristos  <th rowspan="2">Abbreviation(s)</th>
3381.1Schristos  <th colspan="2">Ending at Local Time</th>
3391.1Schristos</tr>
3401.1Schristos<tr>
3411.1Schristos  <th>Date</th>
3421.1Schristos  <th>Time</th>
3431.1Schristos</tr>
3441.1Schristos<tr align="center">
3451.1Schristos  <td>&minus;5:50:36</td>
3461.1Schristos  <td>not observed</td>
3471.1Schristos  <td>LMT</td>
3481.1Schristos  <td>1883-11-18</td>
3491.1Schristos  <td>12:09:24</td>
3501.1Schristos</tr>
3511.1Schristos<tr align="center">
3521.1Schristos  <td rowspan="2">&minus;6:00:00</td>
3531.1Schristos  <td>US rules</td>
3541.1Schristos  <td rowspan="2">CST or CDT</td>
3551.1Schristos  <td>1920-01-01</td>
3561.1Schristos  <td>00:00:00</td>
3571.1Schristos</tr>
3581.1Schristos<tr align="center">
3591.1Schristos  <td>Chicago rules</td>
3601.1Schristos  <td>1936-03-01</td>
3611.1Schristos  <td rowspan="2">02:00:00</td>
3621.1Schristos</tr>
3631.1Schristos<tr align="center">
3641.1Schristos  <td>&minus;5:00:00</td>
3651.1Schristos  <td>not observed</td>
3661.1Schristos  <td>EST</td>
3671.1Schristos  <td>1936-11-15</td>
3681.1Schristos</tr>
3691.1Schristos<tr align="center">
3701.1Schristos  <td rowspan="4">&minus;6:00:00</td>
3711.1Schristos  <td>Chicago rules</td>
3721.1Schristos  <td>CST or CDT</td>
3731.1Schristos  <td>1942-01-01</td>
3741.1Schristos  <td rowspan="3">00:00:00</td>
3751.1Schristos</tr>
3761.1Schristos<tr align="center">
3771.1Schristos  <td>US rules</td>
3781.1Schristos  <td>CST, CWT or CPT</td>
3791.1Schristos  <td>1946-01-01</td>
3801.1Schristos</tr>
3811.1Schristos<tr align="center">
3821.1Schristos  <td>Chicago rules</td>
3831.1Schristos  <td rowspan="2">CST or CDT</td>
3841.1Schristos  <td>1967-01-01</td>
3851.1Schristos</tr>
3861.1Schristos<tr align="center">
3871.1Schristos  <td>US rules</td>
3881.1Schristos  <td colspan="2">&mdash;</td>
3891.1Schristos</tr>
3901.1Schristos</table>
3911.1Schristos
3921.1Schristos<p>There are a couple of interesting differences between Zones and Rules.</p>
3931.1Schristos
3941.1Schristos<p>First, and somewhat trivially, whereas Rules are considered to
3951.1Schristoscontain one or more records, a Zone is considered to be a single
3961.1Schristosrecord with zero or more <i>continuation lines</i>. Thus, the keyword,
3971.1Schristos&ldquo;<code>Zone</code>,&rdquo; and the zone name are not
3981.1Schristosrepeated. The last line is the one without anything in
3991.1Schristosthe <code>[UNTIL]</code> column.</p>
4001.1Schristos
4011.1Schristos<p>Second, and more fundamentally, each line of a Zone represents a
4021.1Schristossteady state, not a transition between states. The state exists from
4031.1Schristosthe date and time in the previous line&rsquo;s <code>[UNTIL]</code>
4041.1Schristoscolumn up to the date and time in the current
4051.1Schristosline&rsquo;s <code>[UNTIL]</code> column. In other words, the date and
4061.1Schristostime in the <code>[UNTIL]</code> column is the instant that separates
4071.1Schristosthis state from the next. Where that would be ambiguous because
4081.1Schristoswe&rsquo;re setting our clocks back, the <code>[UNTIL]</code> column
4091.1Schristosspecifies the first occurrence of the instant. The state specified by
4101.1Schristosthe last line, the one without anything in the <code>[UNTIL]</code>
4111.1Schristoscolumn, continues to the present.</p>
4121.1Schristos
4131.1Schristos<p>The first line typically specifies the mean solar time observed
4141.1Schristosbefore the introduction of standard time. Since there&rsquo;s no line before
4151.1Schristosthat, it has no beginning. <code>8-) </code> For some places near the <a
4161.1Schristoshref="https://en.wikipedia.org/wiki/International_Date_Line">International
4171.1SchristosDate Line</a>, the first <i>two</i> lines will show solar times
4181.1Schristosdiffering by 24 hours; this corresponds to a movement of the Date
4191.1SchristosLine.  For example:</p>
4201.1Schristos
4211.1Schristos<pre>
4221.7Schristos#Zone NAME          STDOFF   RULES FORMAT [UNTIL]
4231.1SchristosZone America/Juneau 15:02:19 -     LMT    1867 Oct 18
4241.1Schristos                    -8:57:41 -     LMT    ...
4251.1Schristos</pre>
4261.1Schristos
4271.1Schristos<p>When Alaska was purchased from Russia in 1867, the Date Line moved
4281.1Schristosfrom the Alaska/Canada border to the Bering Strait; and the time in
4291.1SchristosAlaska was then 24 hours earlier than it had
4301.1Schristosbeen. <code>&lt;aside&gt;</code>(6 October in the Julian calendar,
4311.1Schristoswhich Russia was still using then for religious reasons, was followed
4321.1Schristosby <i>a second instance of the same day with a different name</i>, 18
4331.1SchristosOctober in the Gregorian calendar. Isn&rsquo;t civil time
4341.1Schristoswonderful? <code>8-)</code>)<code>&lt;/aside&gt;</code></p>
4351.1Schristos
4361.1Schristos<p>The abbreviation, &ldquo;LMT&rdquo; stands for &ldquo;local mean
4371.1Schristostime&rdquo;, which is an invention of
4381.1Schristosthe <a href="https://en.wikipedia.org/wiki/Tz_database">tz
4391.1Schristosdatabase</a> and was probably never actually used during the
4401.1Schristosperiod. Furthermore, the value is almost certainly wrong except in the
4411.1Schristosarchetypal place after which the zone is named. (The tz database
4421.1Schristosusually doesn&rsquo;t provide a separate Zone record for places where
4431.1Schristosnothing significant happened after 1970.)</p>
4441.1Schristos
4451.1Schristos<p>The <code>RULES</code> column tells us whether daylight saving time is being observed:
4461.1Schristos<ul>
4471.1Schristos<li>A hyphen, a kind of null value, means that we have not set our
4481.1Schristosclocks ahead of standard time.</li>
4491.1Schristos
4501.1Schristos<li>An amount of time (usually but not necessarily &ldquo;1:00&rdquo;
4511.1Schristosmeaning one hour) means that we have set our clocks ahead by that
4521.1Schristosamount.</li>
4531.1Schristos
4541.1Schristos<li>Some alphabetic string means that we <i>might have</i> set our
4551.1Schristosclocks ahead; and we need to check the rule the name of which is the
4561.1Schristosgiven alphabetic string.</li>
4571.1Schristos</ul>
4581.1Schristos
4591.1Schristos<p>An example of a specific amount of time is:</p>
4601.1Schristos<pre>
4611.7Schristos#Zone NAME            STDOFF RULES FORMAT [UNTIL]
4621.6SchristosZone Pacific/Honolulu ...                 1933 Apr 30  2:00
4631.6Schristos                      -10:30 1:00  HDT    1933 May 21 12:00
4641.1Schristos                      ...
4651.1Schristos</pre>
4661.1Schristos
4671.1Schristos<p>Hawaii tried daylight saving time for three weeks in 1933 and
4681.1Schristosdecided they didn&rsquo;t like it. <code>8-) </code>Note that
4691.7Schristosthe <code>STDOFF</code> column always contains the standard time
4701.7Schristosoffset, so the local (wall clock) time during this period was GMT &minus;
4711.1Schristos10:30 + 1:00 = GMT &minus; 9:30.</p>
4721.1Schristos
4731.1Schristos<p>The <code>FORMAT</code> column specifies the usual abbreviation of
4741.1Schristosthe time zone name. It can have one of three forms:</p>
4751.1Schristos<ul>
4761.1Schristos
4771.1Schristos<li>a string of three or more characters that are either ASCII alphanumerics,
4781.1Schristos&ldquo;<code>+</code>&rdquo;, or &ldquo;<code>-</code>&rdquo;,
4791.1Schristosin which case that&rsquo;s the abbreviation</li>
4801.1Schristos
4811.1Schristos<li>a pair of strings separated by a slash
4821.1Schristos(&lsquo;<code>/</code>&rsquo;), in which case the first string is the
4831.1Schristosabbreviation for the standard time name and the second string is the
4841.1Schristosabbreviation for the daylight saving time name</li>
4851.1Schristos
4861.1Schristos<li>a string containing &ldquo;<code>%s</code>,&rdquo; in which case
4871.1Schristosthe &ldquo;<code>%s</code>&rdquo; will be replaced by the text in the
4881.1Schristosappropriate Rule&rsquo;s <code>LETTER</code> column</li>
4891.1Schristos</ul>
4901.1Schristos
4911.1Schristos<p>The last two make sense only if there&rsquo;s a named rule in effect.</p>
4921.1Schristos
4931.1Schristos<p>An example of a slash is:</p>
4941.1Schristos<pre>
4951.7Schristos#Zone NAME          STDOFF RULES FORMAT  [UNTIL]
4961.1SchristosZone  Europe/London ...                  1996
4971.1Schristos                    0:00   EU    GMT/BST
4981.1Schristos</pre>
4991.1Schristos
5001.1Schristos<p>The current time in the UK is called either Greenwich mean time or
5011.1SchristosBritish summer time.</p>
5021.1Schristos
5031.1Schristos<p>One wrinkle, not fully explained in <code>zic.8.txt</code>, is what
5041.1Schristoshappens when switching to a named rule. To what values should
5051.1Schristosthe <code>SAVE</code> and <code>LETTER</code> data be initialized?</p>
5061.1Schristos
5071.1Schristos<ul>
5081.1Schristos<li>If at least one transition has happened, use
5091.1Schristosthe <code>SAVE</code> and <code>LETTER</code> data from the most
5101.1Schristosrecent.</li>
5111.1Schristos
5121.1Schristos<li>If switching to a named rule before any transition has happened,
5131.1Schristosassume standard time (<code>SAVE</code> zero), and use
5141.1Schristosthe <code>LETTER</code> data from the earliest transition with
5151.1Schristosa <code>SAVE</code> of zero.
5161.1Schristos
5171.1Schristos</ul>
5181.1Schristos
5191.1Schristos<p>And three last things about the <code>FORMAT</code> column:</p>
5201.1Schristos<ul>
5211.1Schristos
5221.1Schristos<li>The <a href="https://en.wikipedia.org/wiki/Tz_database">tz
5231.5Schristosdatabase</a> gives abbreviations for time zones in <i>popular
5241.1Schristosusage</i>, which is not necessarily &ldquo;correct&rdquo; by law. For
5251.1Schristosexample, the last line in
5261.1Schristos<code>Zone</code> <code>Pacific/Honolulu</code> (shown below) gives
5271.1Schristos&ldquo;HST&rdquo; for &ldquo;Hawaii standard time&rdquo; even though the
5281.3Schristos<a href="https://www.law.cornell.edu/uscode/text/15/263">legal</a>
5291.1Schristosname for that time zone is &ldquo;Hawaii-Aleutian standard time.&rdquo;
5301.1SchristosThis author has read that there are also some places in Australia where
5311.1Schristospopular time zone names differ from the legal ones.
5321.1Schristos
5331.1Schristos<li>No attempt is made to <a
5341.1Schristoshref="https://en.wikipedia.org/wiki/Internationalization_and_localization">localize</a>
5351.1Schristosthe abbreviations. They are intended to be the values returned through the
5361.1Schristos<code>"%Z"</code> format specifier to
5371.1Schristos<a href="https://en.wikipedia.org/wiki/C_(programming_language)">C</a>&rsquo;s
5381.7Schristos<a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html"><code>strftime</code></a>
5391.1Schristosfunction in the
5401.7Schristos<a href="https://kirste.userpage.fu-berlin.de/chemnet/use/info/libc/libc_19.html#SEC324">&ldquo;C&rdquo; locale</a>.
5411.1Schristos
5421.1Schristos<li>If there is no generally-accepted abbreviation for a time zone,
5431.1Schristosa numeric offset is used instead, e.g., <code>+07</code> for 7 hours
5441.1Schristosahead of Greenwich. By convention, <code>-00</code> is used in a
5451.1Schristoszone while uninhabited, where the offset is zero but in some sense
5461.1Schristosthe true offset is undefined.
5471.1Schristos</ul>
5481.1Schristos
5491.1Schristos<p>As a final example, here&rsquo;s the complete history for Hawaii:</p>
5501.1Schristos
5511.1Schristos<table border="1">
5521.1Schristos<tr>
5531.1Schristos  <th colspan="6">Relevant Excerpts from the US Rules</th>
5541.1Schristos</tr>
5551.1Schristos<tr>
5561.1Schristos  <td colspan="6" align="center"><table><tr><td>
5571.1Schristos<pre>
5581.1Schristos#Rule NAME FROM TO   TYPE IN  ON      AT     SAVE LETTER/S
5591.1SchristosRule  US   1918 1919 -    Oct lastSun  2:00  0    S
5601.1SchristosRule  US   1942 only -    Feb  9       2:00  1:00 W # War
5611.1SchristosRule  US   1945 only -    Aug 14      23:00u 1:00 P # Peace
5621.6SchristosRule  US   1945 only -    Sep lastSun  2:00  0    S
5631.1Schristos</pre>
5641.1Schristos  </td></tr></table></td>
5651.1Schristos</tr>
5661.1Schristos<tr>
5671.1Schristos  <th colspan="6">The Zone Record</th>
5681.1Schristos</tr>
5691.1Schristos<tr>
5701.1Schristos  <td colspan="6" align="center"><table><tr><td>
5711.1Schristos<pre>
5721.7Schristos#Zone NAME            STDOFF    RULES FORMAT [UNTIL]
5731.6SchristosZone Pacific/Honolulu -10:31:26 -     LMT    1896 Jan 13 12:00
5741.1Schristos                      -10:30    -     HST    1933 Apr 30  2:00
5751.1Schristos                      -10:30    1:00  HDT    1933 May 21  2:00
5761.1Schristos                      -10:30    US    H%sT   1947 Jun  8  2:00
5771.1Schristos                      -10:00    -     HST
5781.1Schristos</pre>
5791.1Schristos  </td></tr></table></td>
5801.1Schristos</tr>
5811.1Schristos<tr>
5821.1Schristos  <th colspan="6">What We Infer</th>
5831.1Schristos</tr>
5841.1Schristos<tr>
5851.1Schristos  <th rowspan="2">Wall-Clock<br>Offset from<br>Prime Meridian</th>
5861.1Schristos  <th rowspan="2">Adjust<br>Clocks</th>
5871.1Schristos  <th colspan="2">Time Zone</th>
5881.1Schristos  <th colspan="2">Ending at Local Time</th>
5891.1Schristos</tr>
5901.1Schristos<tr>
5911.1Schristos  <th>Abbrv.</th>
5921.1Schristos  <th>Name</th>
5931.1Schristos  <th>Date</th>
5941.1Schristos  <th>Time</th>
5951.1Schristos</tr>
5961.1Schristos<tr align="center">
5971.1Schristos  <td>&minus;10:31:26</td>
5981.1Schristos  <td>&mdash;</td>
5991.1Schristos  <td>LMT</td>
6001.1Schristos  <td>local mean time</td>
6011.6Schristos  <td>1896-01-13</td>
6021.1Schristos  <td>12:00</td>
6031.1Schristos</tr>
6041.1Schristos<tr align="center">
6051.1Schristos  <td>&minus;10:30</td>
6061.1Schristos  <td>+0:01:26</td>
6071.1Schristos  <td>HST</td>
6081.1Schristos  <td>Hawaii standard time</td>
6091.1Schristos  <td>1933-04-30</td>
6101.6Schristos  <td>02:00</td>
6111.1Schristos</tr>
6121.1Schristos<tr align="center">
6131.1Schristos  <td>&minus;9:30</td>
6141.1Schristos  <td>+1:00</td>
6151.1Schristos  <td>HDT</td>
6161.1Schristos  <td>Hawaii daylight time</td>
6171.1Schristos  <td>1933-05-21</td>
6181.6Schristos  <td>12:00</td>
6191.1Schristos</tr>
6201.1Schristos<tr align="center">
6211.1Schristos  <td>&minus;10:30&sup1;</td>
6221.1Schristos  <td>&minus;1:00&sup1;</td>
6231.1Schristos  <td>HST&sup1;</td>
6241.1Schristos  <td>Hawaii standard time</td>
6251.1Schristos  <td>1942-02-09</td>
6261.6Schristos  <td>02:00</td>
6271.1Schristos</tr>
6281.1Schristos<tr align="center">
6291.1Schristos  <td rowspan="2">&minus;9:30</td>
6301.1Schristos  <td>+1:00</td>
6311.1Schristos  <td>HWT</td>
6321.1Schristos  <td>Hawaii war time</td>
6331.1Schristos  <td>1945-08-14</td>
6341.1Schristos  <td>13:30&sup2;</td>
6351.1Schristos</tr>
6361.1Schristos<tr align="center">
6371.1Schristos  <td>0</td>
6381.1Schristos  <td>HPT</td>
6391.1Schristos  <td>Hawaii peace time</td>
6401.1Schristos  <td>1945-09-30</td>
6411.1Schristos  <td rowspan="2">02:00</td>
6421.1Schristos</tr>
6431.1Schristos<tr align="center">
6441.1Schristos  <td>&minus;10:30</td>
6451.1Schristos  <td>&minus;1:00</td>
6461.1Schristos  <td rowspan="2">HST</td>
6471.1Schristos  <td rowspan="2">Hawaii standard time</td>
6481.1Schristos  <td>1947-06-08</td>
6491.1Schristos</tr>
6501.1Schristos<tr align="center">
6511.1Schristos  <td>&minus;10:00&sup3;</td>
6521.1Schristos  <td>+0:30&sup3;</td>
6531.1Schristos  <td colspan="2">&mdash;</td>
6541.1Schristos</tr>
6551.1Schristos<tr>
6561.1Schristos  <td colspan="6">
6571.1Schristos    &sup1;Switching to US rules&hellip;most recent transition (in 1919) was to standard time
6581.1Schristos  </td>
6591.1Schristos</tr>
6601.1Schristos<tr>
6611.1Schristos  <td colspan="6">
6621.1Schristos    &sup2;23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>
6631.1Schristos    + (&minus;9:30) = 13:30 local
6641.1Schristos  </td>
6651.1Schristos</tr>
6661.1Schristos<tr>
6671.1Schristos  <td colspan="6">
6681.1Schristos    &sup3;Since <a href="https://en.wikipedia.org/wiki/ISO_8601">1947&ndash;06&ndash;08T12:30Z</a>,
6691.1Schristos    the civil time in Hawaii has been
6701.1Schristos    <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>/<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>
6711.1Schristos    &minus; 10:00 year-round.
6721.1Schristos  </td>
6731.1Schristos</tr>
6741.1Schristos</table>
6751.1Schristos
6761.1Schristos<p>There will be a short quiz later. <code>8-)</code></p>
6771.1Schristos
6781.1Schristos<hr>
6791.1Schristos<address>
6801.1SchristosThis web page is in the public domain, so clarified as of
6811.1Schristos2015-10-20 by Bill Seymour.
6821.1Schristos<br>
6831.1SchristosAll suggestions and corrections will be welcome; all flames will be amusing.
6841.1SchristosMail to was at pobox dot com.
6851.1Schristos</address>
6861.1Schristos</body>
6871.1Schristos</html>
688