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