Home | History | Annotate | Line # | Download | only in time
tz-how-to.html revision 1.3
      1 <!DOCTYPE html
      2 	PUBLIC "-//W3C//DTD HTML 4.01//EN"
      3 	"http://www.w3.org/TR/html4/strict.dtd">
      4 <html>
      5 <head>
      6 <title>How to Read the tz Database</title>
      7 <meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
      8 </head>
      9 <body>
     10 <h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
     11 Database</a> Source Files</h2>
     12 <h3>by Bill Seymour</h3>
     13 <p>This page uses the <code>America/Chicago</code> and
     14 <code>Pacific/Honolulu</code> zones as examples of how to infer
     15 times of day from the <a href="tz-link.htm">tz database</a>
     16 source files. It might be helpful, but not absolutely necessary,
     17 for the reader to have already downloaded the
     18 latest release of the database and become familiar with the basic layout
     19 of the data files. The format is explained in the &ldquo;man
     20 page&rdquo; for the zic compiler, <code>zic.8.txt</code>, in
     21 the <code>code</code> subdirectory.</p>
     22 
     23 <p>We&rsquo;ll begin by talking about the rules for changing between standard
     24 and daylight saving time since we&rsquo;ll need that information when we talk
     25 about the zones.</p>
     26 
     27 <p>First, let&rsquo;s consider the special daylight saving time rules
     28 for Chicago (from the <code>northamerica</code> file in
     29 the <code>data</code> subdirectory):</p>
     30 
     31 <table border="1">
     32 <tr>
     33   <th colspan="6">From the Source File</th>
     34 </tr>
     35 <tr>
     36   <td colspan="6" align="center"><table><tr><td>
     37 <pre>
     38 #Rule NAME    FROM TO   TYPE IN  ON      AT   SAVE LETTER
     39 Rule  Chicago 1920 only  -   Jun 13      2:00 1:00 D
     40 Rule  Chicago 1920 1921  -   Oct lastSun 2:00 0    S
     41 Rule  Chicago 1921 only  -   Mar lastSun 2:00 1:00 D
     42 Rule  Chicago 1922 1966  -   Apr lastSun 2:00 1:00 D
     43 Rule  Chicago 1922 1954  -   Sep lastSun 2:00 0    S
     44 Rule  Chicago 1955 1966  -   Oct lastSun 2:00 0    S
     45 </pre>
     46   </td></tr></table></td>
     47 </tr>
     48 <tr>
     49   <th colspan="6">Reformatted a Bit</th>
     50 </tr>
     51 <tr>
     52   <th>From</th>
     53   <th>To</th>
     54   <th colspan="2">On</th>
     55   <th>At</th>
     56   <th>Action</th>
     57 </tr>
     58 <tr align="center">
     59   <td colspan="2">1920 only</td>
     60   <td colspan="2">June 13<small><sup>th</sup></small></td>
     61   <td rowspan="6">02:00 local</td>
     62   <td>go to daylight saving time</td>
     63 </tr>
     64 <tr align="center">
     65   <td>1920</td>
     66   <td>1921</td>
     67   <td rowspan="5">last Sunday</td>
     68   <td>in October</td>
     69   <td>return to standard time</td>
     70 </tr>
     71 <tr align="center">
     72   <td colspan="2">1921 only</td>
     73   <td>in March</td>
     74   <td rowspan="2">go to daylight saving time</td>
     75 </tr>
     76 <tr align="center">
     77   <td rowspan="2">1922</td>
     78   <td>1966</td>
     79   <td>in April</td>
     80 </tr>
     81 <tr align="center">
     82   <td>1954</td>
     83   <td>in September</td>
     84   <td rowspan="2">return to standard time</td>
     85 </tr>
     86 <tr align="center">
     87   <td>1955</td>
     88   <td>1966</td>
     89   <td>in October</td>
     90 </tr>
     91 </table>
     92 
     93 <p>We&rsquo;ll basically just ignore the <code>TYPE</code> column.
     94 In the 2007j release, the most recent as of this writing, the
     95 <code>TYPE</code> column never contains anything but a hyphen,
     96 a kind of null value. (From the description in <code>zic.8.txt</code>,
     97 this appears to be a mechanism for removing years from a set
     98 in some localizable way. It&rsquo;s used in the file, <code>pacificnew</code>,
     99 to determine whether a given year will have a US presidential election;
    100 but everything related to that use is commented out.)
    101 
    102 <p>The <code>SAVE</code> column contains the wall clock offset from
    103 local standard time.
    104 This is usually either zero for standard time or one hour for daylight
    105 saving time; but there&rsquo;s no reason, in principle, why it can&rsquo;t
    106 take on other values.
    107 
    108 <p>The <code>LETTER</code> (sometimes called <code>LETTER/S</code>)
    109 column can contain a variable
    110 part of the usual abbreviation of the time zone&rsquo;s name, or it can just
    111 be a hyphen if there&rsquo;s no variable part. For example, the abbreviation
    112 used in the central time zone will be either &ldquo;CST&rdquo; or
    113 &ldquo;CDT&rdquo;. The variable part is &lsquo;S&rsquo; or &lsquo;D&rsquo;;
    114 and, sure enough, that&rsquo;s just what we find in
    115 the <code>LETTER</code> column
    116 in the <code>Chicago</code> rules. More about this when we talk about
    117 &ldquo;Zone&rdquo; lines.
    118 
    119 <p>One important thing to notice is that &ldquo;Rule&rdquo; lines
    120 want at once to be both <i>transitions</i> and <i>steady states</i>:
    121 <ul>
    122 <li>On the one hand, they represent transitions between standard and
    123 daylight saving time; and any number of Rule lines can be in effect
    124 during a given period (which will always be a non-empty set of
    125 contiguous calendar years).</li>
    126 <li>On the other hand, the <code>SAVE</code> and <code>LETTER</code>
    127 columns contain state that exists between transitions. More about this
    128 when we talk about the US rules.</li>
    129 </ul>
    130 
    131 <p>In the example above, the transition to daylight saving time
    132 happened on the 13<small><sup>th</sup></small> of June in 1920, and on
    133 the last Sunday in March in 1921; but the return to standard time
    134 happened on the last Sunday in October in both of those
    135 years. Similarly, the rule for changing to daylight saving time was
    136 the same from 1922 to 1966; but the rule for returning to standard
    137 time changed in 1955. Got it?</p>
    138 
    139 <p>OK, now for the somewhat more interesting &ldquo;US&rdquo; rules:</p>
    140 
    141 <table border="1">
    142 <tr>
    143   <th colspan="6">From the Source File</th>
    144 </tr>
    145 <tr>
    146   <td colspan="6" align="center"><table><tr><td>
    147 <pre>
    148 #Rule NAME FROM TO   TYPE IN  ON        AT   SAVE LETTER/S
    149 Rule  US   1918 1919  -   Mar lastSun  2:00  1:00 D
    150 Rule  US   1918 1919  -   Oct lastSun  2:00  0    S
    151 Rule  US   1942 only  -   Feb 9        2:00  1:00 W # War
    152 Rule  US   1945 only  -   Aug 14      23:00u 1:00 P # Peace
    153 Rule  US   1945 only  -   Sep 30       2:00  0    S
    154 Rule  US   1967 2006  -   Oct lastSun  2:00  0    S
    155 Rule  US   1967 1973  -   Apr lastSun  2:00  1:00 D
    156 Rule  US   1974 only  -   Jan 6        2:00  1:00 D
    157 Rule  US   1975 only  -   Feb 23       2:00  1:00 D
    158 Rule  US   1976 1986  -   Apr lastSun  2:00  1:00 D
    159 Rule  US   1987 2006  -   Apr Sun&gt;=1   2:00  1:00 D
    160 Rule  US   2007 max   -   Mar Sun&gt;=8   2:00  1:00 D
    161 Rule  US   2007 max   -   Nov Sun&gt;=1   2:00  0    S
    162 </pre>
    163   </td></tr></table></td>
    164 </tr>
    165 <tr>
    166   <th colspan="6">Reformatted a Bit</th>
    167 </tr>
    168 <tr>
    169   <th>From</th>
    170   <th>To</th>
    171   <th colspan="2">On</th>
    172   <th>At</th>
    173   <th>Action</th>
    174 </tr>
    175 <tr align="center">
    176   <td rowspan="2">1918</td>
    177   <td rowspan="2">1919</td>
    178   <td rowspan="2">last Sunday</td>
    179   <td>in March</td>
    180   <td rowspan="3">02:00 local</td>
    181   <td>go to daylight saving time</td>
    182 </tr>
    183 <tr align="center">
    184   <td>in October</td>
    185   <td>return to standard time</td>
    186 </tr>
    187 <tr align="center">
    188   <td colspan="2">1942 only</td>
    189   <td colspan="2">February 9<small><sup>th</sup></small></td>
    190   <td>go to &ldquo;war time&rdquo;</td>
    191 </tr>
    192 <tr align="center">
    193   <td colspan="2" rowspan="2">1945 only</td>
    194   <td colspan="2">August 14<small><sup>th</sup></small></td>
    195   <td>23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a></td>
    196   <td>
    197     rename &ldquo;war time&rdquo; to &ldquo;peace<br>time;&rdquo;
    198     clocks don&rsquo;t change
    199   </td>
    200 </tr>
    201 <tr align="center">
    202   <td colspan="2">September 30<small><sup>th</sup></small></td>
    203   <td rowspan="9">02:00 local</td>
    204   <td rowspan="2">return to standard time</td>
    205 </tr>
    206 <tr align="center">
    207   <td rowspan="2">1967</td>
    208   <td>2006</td>
    209   <td rowspan="2">last Sunday</td>
    210   <td>in October</td>
    211 </tr>
    212 <tr align="center">
    213   <td>1973</td>
    214   <td>in April</td>
    215   <td rowspan="6">go to daylight saving time</td>
    216 </tr>
    217 <tr align="center">
    218   <td colspan="2">1974 only</td>
    219   <td colspan="2">January 6<small><sup>th</sup></small></td>
    220 </tr>
    221 <tr align="center">
    222   <td colspan="2">1975 only</td>
    223   <td colspan="2">February 23<small><sup>rd</sup></small></td>
    224 </tr>
    225 <tr align="center">
    226   <td>1976</td>
    227   <td>1986</td>
    228   <td>last Sunday</td>
    229   <td rowspan="2">in April</td>
    230 </tr>
    231 <tr align="center">
    232   <td>1987</td>
    233   <td>2006</td>
    234   <td>first Sunday</td>
    235 </tr>
    236 <tr align="center">
    237   <td rowspan="2">2007</td>
    238   <td rowspan="2">present</td>
    239   <td colspan="2">second Sunday in March</td>
    240 </tr>
    241 <tr align="center">
    242   <td colspan="2">first Sunday in November</td>
    243   <td>return to standard time</td>
    244 </tr>
    245 </table>
    246 
    247 <p>There are two interesting things to note here.</p>
    248 
    249 <p>First, the time that something happens (in the <code>AT</code>
    250 column) is not necessarily the local wall clock time. The time can be
    251 suffixed with &lsquo;s&rsquo; (for &ldquo;standard&rdquo;) to mean
    252 local standard time (different from wall clock time when observing
    253 daylight saving time); or it can be suffixed with &lsquo;g&rsquo;,
    254 &lsquo;u&rsquo;, or &lsquo;z&rsquo;, all three of which mean the
    255 standard time at the
    256 <a href="https://en.wikipedia.org/wiki/Prime_Meridian">prime meridian</a>.
    257 &lsquo;g&rsquo; stands for &ldquo;<a
    258 href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">GMT</a>&rdquo;;
    259 &lsquo;u&rsquo; stands for &ldquo;<a
    260 href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>&rdquo; or &ldquo;<a
    261 href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>&rdquo;
    262 (whichever was official at the time); &lsquo;z&rsquo; stands for the
    263 <a href="https://en.wikipedia.org/wiki/Nautical_time">nautical time zone</a>
    264 Z (a.k.a. &ldquo;Zulu&rdquo; which, in turn, stands for &lsquo;Z&rsquo;).
    265 The time can also be suffixed with &lsquo;w&rsquo; meaning &ldquo;wall
    266 clock time;&rdquo; but it usually isn&rsquo;t because that&rsquo;s the
    267 default.</p>
    268 
    269 <p>Second, the day in the <code>ON</code> column, in addition to
    270 &ldquo;<code>lastSun</code>&rdquo; or a particular day of the month,
    271 can have the form, &ldquo;<code>Sun&gt;=</code><i>x</i>&rdquo; or
    272 &ldquo;<code>Sun&lt;=</code><i>x</i>,&rdquo; where <i>x</i> is a day
    273 of the month. For example, &ldquo;<code>Sun&gt;=8</code>&rdquo; means
    274 &ldquo;the first Sunday on or after the eighth of the month,&rdquo; in
    275 other words, the second Sunday of the month. Furthermore, although
    276 there are no examples above, the weekday needn&rsquo;t be
    277 &ldquo;<code>Sun</code>&rdquo; in either form, but can be the usual
    278 three-character English abbreviation for any day of the week.</p>
    279 
    280 <p>And the US rules give us more examples of a couple of things
    281 already mentioned:</p>
    282 
    283 <ul>
    284 <li>The rules for changing to and from daylight saving time are
    285 actually <i>different sets</i> of rules; and the two sets can change
    286 independently. Consider, for example, that the rule for the return to
    287 standard time stayed the same from 1967 to 2006; but the rule for the
    288 transition to daylight saving time changed several times in the same
    289 period.  There can also be periods, 1946 to 1966 for example, when no
    290 rule from this group is in effect, and so either no transition
    291 happened in those years, or some other rule is in effect (perhaps a
    292 state or other more local rule).</li>
    293 
    294 <li>The <code>SAVE</code> and <code>LETTER</code> columns
    295 contain <i>steady state</i>, not transitions. Consider, for example,
    296 the transition from &ldquo;war time&rdquo; to &ldquo;peace time&rdquo;
    297 that happened on August 14, 1945. The &ldquo;1:00&rdquo; in
    298 the <code>SAVE</code> column is <i>not</i> an instruction to advance
    299 the clock an hour. It means that clocks should <i>be</i> one hour
    300 ahead of standard time, which they already are because of the previous
    301 rule, so there should be no change.</li>
    302 
    303 </ul>
    304 
    305 <p>OK, now let&rsquo;s look at a Zone record:</p>
    306 
    307 <table border="1">
    308 <tr>
    309   <th colspan="5">From the Source File</th>
    310 </tr>
    311 <tr>
    312   <td colspan="6" align="center"><table><tr><td>
    313 <pre>
    314 #Zone       NAME      GMTOFF   RULES FORMAT [UNTIL]
    315 Zone  America/Chicago -5:50:36 -       LMT  1883 Nov 18 12:09:24
    316                       -6:00    US      C%sT 1920
    317                       -6:00    Chicago C%sT 1936 Mar  1  2:00
    318                       -5:00    -       EST  1936 Nov 15  2:00
    319                       -6:00    Chicago C%sT 1942
    320                       -6:00    US      C%sT 1946
    321                       -6:00    Chicago C%sT 1967
    322                       -6:00    US      C%sT
    323 </pre>
    324   </td></tr></table></td>
    325 </tr>
    326 <tr>
    327   <th colspan="5">Columns Renamed</th>
    328 </tr>
    329 <tr>
    330   <th rowspan="2">Standard Offset<br>
    331     from <a href="https://en.wikipedia.org/wiki/Prime_Meridian">Prime
    332     Meridian</a></th>
    333   <th rowspan="2">Daylight<br>Saving Time</th>
    334   <th rowspan="2">Abbreviation(s)</th>
    335   <th colspan="2">Ending at Local Time</th>
    336 </tr>
    337 <tr>
    338   <th>Date</th>
    339   <th>Time</th>
    340 </tr>
    341 <tr align="center">
    342   <td>&minus;5:50:36</td>
    343   <td>not observed</td>
    344   <td>LMT</td>
    345   <td>1883-11-18</td>
    346   <td>12:09:24</td>
    347 </tr>
    348 <tr align="center">
    349   <td rowspan="2">&minus;6:00:00</td>
    350   <td>US rules</td>
    351   <td rowspan="2">CST or CDT</td>
    352   <td>1920-01-01</td>
    353   <td>00:00:00</td>
    354 </tr>
    355 <tr align="center">
    356   <td>Chicago rules</td>
    357   <td>1936-03-01</td>
    358   <td rowspan="2">02:00:00</td>
    359 </tr>
    360 <tr align="center">
    361   <td>&minus;5:00:00</td>
    362   <td>not observed</td>
    363   <td>EST</td>
    364   <td>1936-11-15</td>
    365 </tr>
    366 <tr align="center">
    367   <td rowspan="4">&minus;6:00:00</td>
    368   <td>Chicago rules</td>
    369   <td>CST or CDT</td>
    370   <td>1942-01-01</td>
    371   <td rowspan="3">00:00:00</td>
    372 </tr>
    373 <tr align="center">
    374   <td>US rules</td>
    375   <td>CST, CWT or CPT</td>
    376   <td>1946-01-01</td>
    377 </tr>
    378 <tr align="center">
    379   <td>Chicago rules</td>
    380   <td rowspan="2">CST or CDT</td>
    381   <td>1967-01-01</td>
    382 </tr>
    383 <tr align="center">
    384   <td>US rules</td>
    385   <td colspan="2">&mdash;</td>
    386 </tr>
    387 </table>
    388 
    389 <p>There are a couple of interesting differences between Zones and Rules.</p>
    390 
    391 <p>First, and somewhat trivially, whereas Rules are considered to
    392 contain one or more records, a Zone is considered to be a single
    393 record with zero or more <i>continuation lines</i>. Thus, the keyword,
    394 &ldquo;<code>Zone</code>,&rdquo; and the zone name are not
    395 repeated. The last line is the one without anything in
    396 the <code>[UNTIL]</code> column.</p>
    397 
    398 <p>Second, and more fundamentally, each line of a Zone represents a
    399 steady state, not a transition between states. The state exists from
    400 the date and time in the previous line&rsquo;s <code>[UNTIL]</code>
    401 column up to the date and time in the current
    402 line&rsquo;s <code>[UNTIL]</code> column. In other words, the date and
    403 time in the <code>[UNTIL]</code> column is the instant that separates
    404 this state from the next. Where that would be ambiguous because
    405 we&rsquo;re setting our clocks back, the <code>[UNTIL]</code> column
    406 specifies the first occurrence of the instant. The state specified by
    407 the last line, the one without anything in the <code>[UNTIL]</code>
    408 column, continues to the present.</p>
    409 
    410 <p>The first line typically specifies the mean solar time observed
    411 before the introduction of standard time. Since there&rsquo;s no line before
    412 that, it has no beginning. <code>8-) </code> For some places near the <a
    413 href="https://en.wikipedia.org/wiki/International_Date_Line">International
    414 Date Line</a>, the first <i>two</i> lines will show solar times
    415 differing by 24 hours; this corresponds to a movement of the Date
    416 Line.  For example:</p>
    417 
    418 <pre>
    419 #Zone NAME          GMTOFF   RULES FORMAT [UNTIL]
    420 Zone America/Juneau 15:02:19 -     LMT    1867 Oct 18
    421                     -8:57:41 -     LMT    ...
    422 </pre>
    423 
    424 <p>When Alaska was purchased from Russia in 1867, the Date Line moved
    425 from the Alaska/Canada border to the Bering Strait; and the time in
    426 Alaska was then 24 hours earlier than it had
    427 been. <code>&lt;aside&gt;</code>(6 October in the Julian calendar,
    428 which Russia was still using then for religious reasons, was followed
    429 by <i>a second instance of the same day with a different name</i>, 18
    430 October in the Gregorian calendar. Isn&rsquo;t civil time
    431 wonderful? <code>8-)</code>)<code>&lt;/aside&gt;</code></p>
    432 
    433 <p>The abbreviation, &ldquo;LMT&rdquo; stands for &ldquo;local mean
    434 time&rdquo;, which is an invention of
    435 the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
    436 database</a> and was probably never actually used during the
    437 period. Furthermore, the value is almost certainly wrong except in the
    438 archetypal place after which the zone is named. (The tz database
    439 usually doesn&rsquo;t provide a separate Zone record for places where
    440 nothing significant happened after 1970.)</p>
    441 
    442 <p>The <code>RULES</code> column tells us whether daylight saving time is being observed:
    443 <ul>
    444 <li>A hyphen, a kind of null value, means that we have not set our
    445 clocks ahead of standard time.</li>
    446 
    447 <li>An amount of time (usually but not necessarily &ldquo;1:00&rdquo;
    448 meaning one hour) means that we have set our clocks ahead by that
    449 amount.</li>
    450 
    451 <li>Some alphabetic string means that we <i>might have</i> set our
    452 clocks ahead; and we need to check the rule the name of which is the
    453 given alphabetic string.</li>
    454 </ul>
    455 
    456 <p>An example of a specific amount of time is:</p>
    457 <pre>
    458 #Zone NAME            GMTOFF RULES FORMAT [UNTIL]
    459 Zone Pacific/Honolulu ...                 1933 Apr 30 2:00
    460                       -10:30 1:00  HDT    1933 May 21 2:00
    461                       ...
    462 </pre>
    463 
    464 <p>Hawaii tried daylight saving time for three weeks in 1933 and
    465 decided they didn&rsquo;t like it. <code>8-) </code>Note that
    466 the <code>GMTOFF</code> column always contains the standard time
    467 offset, so the wall clock time during this period was GMT &minus;
    468 10:30 + 1:00 = GMT &minus; 9:30.</p>
    469 
    470 <p>The <code>FORMAT</code> column specifies the usual abbreviation of
    471 the time zone name. It can have one of three forms:</p>
    472 <ul>
    473 
    474 <li>a string of three or more characters that are either ASCII alphanumerics,
    475 &ldquo;<code>+</code>&rdquo;, or &ldquo;<code>-</code>&rdquo;,
    476 in which case that&rsquo;s the abbreviation</li>
    477 
    478 <li>a pair of strings separated by a slash
    479 (&lsquo;<code>/</code>&rsquo;), in which case the first string is the
    480 abbreviation for the standard time name and the second string is the
    481 abbreviation for the daylight saving time name</li>
    482 
    483 <li>a string containing &ldquo;<code>%s</code>,&rdquo; in which case
    484 the &ldquo;<code>%s</code>&rdquo; will be replaced by the text in the
    485 appropriate Rule&rsquo;s <code>LETTER</code> column</li>
    486 </ul>
    487 
    488 <p>The last two make sense only if there&rsquo;s a named rule in effect.</p>
    489 
    490 <p>An example of a slash is:</p>
    491 <pre>
    492 #Zone NAME          GMTOFF RULES FORMAT  [UNTIL]
    493 Zone  Europe/London ...                  1996
    494                     0:00   EU    GMT/BST
    495 </pre>
    496 
    497 <p>The current time in the UK is called either Greenwich mean time or
    498 British summer time.</p>
    499 
    500 <p>One wrinkle, not fully explained in <code>zic.8.txt</code>, is what
    501 happens when switching to a named rule. To what values should
    502 the <code>SAVE</code> and <code>LETTER</code> data be initialized?</p>
    503 
    504 <ul>
    505 <li>If at least one transition has happened, use
    506 the <code>SAVE</code> and <code>LETTER</code> data from the most
    507 recent.</li>
    508 
    509 <li>If switching to a named rule before any transition has happened,
    510 assume standard time (<code>SAVE</code> zero), and use
    511 the <code>LETTER</code> data from the earliest transition with
    512 a <code>SAVE</code> of zero.
    513 
    514 </ul>
    515 
    516 <p>And three last things about the <code>FORMAT</code> column:</p>
    517 <ul>
    518 
    519 <li>The <a href="https://en.wikipedia.org/wiki/Tz_database">tz
    520 database</a> gives abbreviations for time zone names in <i>popular
    521 usage</i>, which is not necessarily &ldquo;correct&rdquo; by law. For
    522 example, the last line in
    523 <code>Zone</code> <code>Pacific/Honolulu</code> (shown below) gives
    524 &ldquo;HST&rdquo; for &ldquo;Hawaii standard time&rdquo; even though the
    525 <a href="https://www.law.cornell.edu/uscode/text/15/263">legal</a>
    526 name for that time zone is &ldquo;Hawaii-Aleutian standard time.&rdquo;
    527 This author has read that there are also some places in Australia where
    528 popular time zone names differ from the legal ones.
    529 
    530 <li>No attempt is made to <a
    531 href="https://en.wikipedia.org/wiki/Internationalization_and_localization">localize</a>
    532 the abbreviations. They are intended to be the values returned through the
    533 <code>"%Z"</code> format specifier to
    534 <a href="https://en.wikipedia.org/wiki/C_(programming_language)">C</a>&rsquo;s
    535 <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html"><code>strftime</code></a>
    536 function in the
    537 <a href="http://kirste.userpage.fu-berlin.de/chemnet/use/info/libc/libc_19.html#SEC324">&ldquo;C&rdquo; locale</a>.
    538 
    539 <li>If there is no generally-accepted abbreviation for a time zone,
    540 a numeric offset is used instead, e.g., <code>+07</code> for 7 hours
    541 ahead of Greenwich. By convention, <code>-00</code> is used in a
    542 zone while uninhabited, where the offset is zero but in some sense
    543 the true offset is undefined.
    544 </ul>
    545 
    546 <p>As a final example, here&rsquo;s the complete history for Hawaii:</p>
    547 
    548 <table border="1">
    549 <tr>
    550   <th colspan="6">Relevant Excerpts from the US Rules</th>
    551 </tr>
    552 <tr>
    553   <td colspan="6" align="center"><table><tr><td>
    554 <pre>
    555 #Rule NAME FROM TO   TYPE IN  ON      AT     SAVE LETTER/S
    556 Rule  US   1918 1919 -    Oct lastSun  2:00  0    S
    557 Rule  US   1942 only -    Feb  9       2:00  1:00 W # War
    558 Rule  US   1945 only -    Aug 14      23:00u 1:00 P # Peace
    559 Rule  US   1945 only -    Sep 30       2:00  0    S
    560 </pre>
    561   </td></tr></table></td>
    562 </tr>
    563 <tr>
    564   <th colspan="6">The Zone Record</th>
    565 </tr>
    566 <tr>
    567   <td colspan="6" align="center"><table><tr><td>
    568 <pre>
    569 #Zone NAME            GMTOFF    RULES FORMAT [UNTIL]
    570 Zone Pacific/Honolulu -10:31:26 -     LMT    1900 Jan  1 12:00
    571                       -10:30    -     HST    1933 Apr 30  2:00
    572                       -10:30    1:00  HDT    1933 May 21  2:00
    573                       -10:30    US    H%sT   1947 Jun  8  2:00
    574                       -10:00    -     HST
    575 </pre>
    576   </td></tr></table></td>
    577 </tr>
    578 <tr>
    579   <th colspan="6">What We Infer</th>
    580 </tr>
    581 <tr>
    582   <th rowspan="2">Wall-Clock<br>Offset from<br>Prime Meridian</th>
    583   <th rowspan="2">Adjust<br>Clocks</th>
    584   <th colspan="2">Time Zone</th>
    585   <th colspan="2">Ending at Local Time</th>
    586 </tr>
    587 <tr>
    588   <th>Abbrv.</th>
    589   <th>Name</th>
    590   <th>Date</th>
    591   <th>Time</th>
    592 </tr>
    593 <tr align="center">
    594   <td>&minus;10:31:26</td>
    595   <td>&mdash;</td>
    596   <td>LMT</td>
    597   <td>local mean time</td>
    598   <td>1900-01-01</td>
    599   <td>12:00</td>
    600 </tr>
    601 <tr align="center">
    602   <td>&minus;10:30</td>
    603   <td>+0:01:26</td>
    604   <td>HST</td>
    605   <td>Hawaii standard time</td>
    606   <td>1933-04-30</td>
    607   <td rowspan="3">02:00</td>
    608 </tr>
    609 <tr align="center">
    610   <td>&minus;9:30</td>
    611   <td>+1:00</td>
    612   <td>HDT</td>
    613   <td>Hawaii daylight time</td>
    614   <td>1933-05-21</td>
    615 </tr>
    616 <tr align="center">
    617   <td>&minus;10:30&sup1;</td>
    618   <td>&minus;1:00&sup1;</td>
    619   <td>HST&sup1;</td>
    620   <td>Hawaii standard time</td>
    621   <td>1942-02-09</td>
    622 </tr>
    623 <tr align="center">
    624   <td rowspan="2">&minus;9:30</td>
    625   <td>+1:00</td>
    626   <td>HWT</td>
    627   <td>Hawaii war time</td>
    628   <td>1945-08-14</td>
    629   <td>13:30&sup2;</td>
    630 </tr>
    631 <tr align="center">
    632   <td>0</td>
    633   <td>HPT</td>
    634   <td>Hawaii peace time</td>
    635   <td>1945-09-30</td>
    636   <td rowspan="2">02:00</td>
    637 </tr>
    638 <tr align="center">
    639   <td>&minus;10:30</td>
    640   <td>&minus;1:00</td>
    641   <td rowspan="2">HST</td>
    642   <td rowspan="2">Hawaii standard time</td>
    643   <td>1947-06-08</td>
    644 </tr>
    645 <tr align="center">
    646   <td>&minus;10:00&sup3;</td>
    647   <td>+0:30&sup3;</td>
    648   <td colspan="2">&mdash;</td>
    649 </tr>
    650 <tr>
    651   <td colspan="6">
    652     &sup1;Switching to US rules&hellip;most recent transition (in 1919) was to standard time
    653   </td>
    654 </tr>
    655 <tr>
    656   <td colspan="6">
    657     &sup2;23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>
    658     + (&minus;9:30) = 13:30 local
    659   </td>
    660 </tr>
    661 <tr>
    662   <td colspan="6">
    663     &sup3;Since <a href="https://en.wikipedia.org/wiki/ISO_8601">1947&ndash;06&ndash;08T12:30Z</a>,
    664     the civil time in Hawaii has been
    665     <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>/<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>
    666     &minus; 10:00 year-round.
    667   </td>
    668 </tr>
    669 </table>
    670 
    671 <p>There will be a short quiz later. <code>8-)</code></p>
    672 
    673 <hr>
    674 <address>
    675 This web page is in the public domain, so clarified as of
    676 2015-10-20 by Bill Seymour.
    677 <br>
    678 All suggestions and corrections will be welcome; all flames will be amusing.
    679 Mail to was at pobox dot com.
    680 </address>
    681 </body>
    682 </html>
    683