xref: /freebsd/contrib/tzcode/tz-link.html (revision 2a58b312b62f908ec92311d1bd8536dbaeb8e55b)
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<title>Time zone and daylight saving time data</title>
5<meta charset="UTF-8">
6<style>
7pre {margin-left: 2em; white-space: pre-wrap;}
8</style>
9</head>
10<body>
11<h1>Time zone and daylight saving time data</h1>
12<p>
13<a href="https://en.wikipedia.org/wiki/Time_zone">Time zone</a> and
14<a href="https://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a>
15rules are controlled by individual
16governments. They are sometimes changed with little notice, and their
17histories and planned futures are often recorded only fitfully. Here
18is a summary of attempts to organize and record relevant data in this
19area.
20</p>
21  <h3>Outline</h3>
22  <nav>
23    <ul>
24      <li>The <code><abbr>tz</abbr></code> database product and process
25	<ul>
26	  <li><a href="#tzdb">The <code><abbr>tz</abbr></code> database</a></li>
27	  <li><a href="#download">Downloading the <code><abbr>tz</abbr></code> database</a></li>
28	  <li><a href="#changes">Changes to the <code><abbr>tz</abbr></code> database</a></li>
29	  <li><a href="#commentary">Commentary on the <code><abbr>tz</abbr></code> database</a></li>
30	</ul>
31      </li>
32      <li>Uses of the <code><abbr>tz</abbr></code> database
33	<ul>
34	  <li><a href="#web">Web sites using recent versions of the <code><abbr>tz</abbr></code> database</a></li>
35	  <li><a href="#protocols">Network protocols for <code><abbr>tz</abbr></code> data</a></li>
36	  <li><a href="#compilers">Other <code><abbr>tz</abbr></code> compilers</a></li>
37	  <li><a href="#TZif">Other <abbr>TZif</abbr> readers</a></li>
38	  <li><a href="#software">Other <code><abbr>tz</abbr></code>-based time zone software</a></li>
39	</ul>
40      </li>
41      <li>Related data
42	<ul>
43	  <li><a href="#other-dbs">Other time zone databases</a></li>
44	  <li><a href="#maps">Maps</a></li>
45	  <li><a href="#boundaries">Time zone boundaries</a></li>
46	</ul>
47      </li>
48      <li>Timekeeping concepts
49	<ul>
50	  <li><a href="#civil">Civil time concepts and history</a></li>
51	  <li><a href="#national">National histories of legal time</a></li>
52	  <li><a href="#costs">Costs and benefits of time shifts</a></li>
53	  <li><a href="#precision">Precision timekeeping</a></li>
54	  <li><a href="#notation">Time notation</a></li>
55	</ul>
56      </li>
57      <li><a href="#see-also">See also</a></li>
58    </ul>
59  </nav>
60
61<section>
62<h2 id="tzdb">The <code><abbr title="time zone">tz</abbr></code> database</h2>
63<p>
64The <a href="https://en.wikipedia.org/wiki/Public_domain">public-domain</a>
65time zone database contains code and data
66that represent the history of local time
67for many representative locations around the globe.
68It is updated periodically to reflect changes made by political bodies
69to time zone boundaries and daylight saving rules.
70This database (known as <code><abbr>tz</abbr></code>,
71<code><abbr>tzdb</abbr></code>, or <code>zoneinfo</code>)
72is used by several implementations,
73including
74<a href="https://www.gnu.org/software/libc/">the
75<abbr title="GNU's Not Unix">GNU</abbr>
76C Library</a> (used in
77<a href="https://en.wikipedia.org/wiki/Linux"><abbr>GNU</abbr>/Linux</a>),
78<a href="https://www.android.com">Android</a>,
79<a href="https://www.freebsd.org">Free<abbr
80title="Berkeley Software Distribution">BSD</abbr></a>,
81<a href="https://netbsd.org">Net<abbr>BSD</abbr></a>,
82<a href="https://www.openbsd.org">Open<abbr>BSD</abbr></a>,
83<a href="https://www.chromium.org/chromium-os/">Chromium OS</a>,
84<a href="https://cygwin.com">Cygwin</a>,
85<a href="https://mariadb.org">MariaDB</a>,
86<a href="https://en.wikipedia.org/wiki/MINIX">MINIX</a>,
87<a href="https://www.mysql.com">MySQL</a>,
88<a href="https://en.wikipedia.org/wiki/WebOS"><abbr
89title="Web Operating System">webOS</abbr></a>,
90<a href="https://en.wikipedia.org/wiki/IBM_AIX"><abbr
91title="Advanced Interactive eXecutive">AIX</abbr></a>,
92<a href="https://www.apple.com/ios"><abbr
93title="iPhone OS">iOS</abbr></a>,
94<a href="https://www.apple.com/macos">macOS</a>,
95<a href="https://www.microsoft.com/en-us/windows">Microsoft Windows</a>,
96<a href="https://www.vmssoftware.com">Open<abbr
97title="Virtual Memory System">VMS</abbr></a>,
98<a href="https://www.oracle.com/database/">Oracle Database</a>, and
99<a href="https://www.oracle.com/solaris">Oracle Solaris</a>.</p>
100<p>
101Each main entry in the database represents a <dfn>timezone</dfn>
102for a set of civil-time clocks that have all agreed since 1970.
103Timezones are typically identified by continent or ocean and then by the
104name of the largest city within the region containing the clocks.
105For example, <code>America/New_York</code>
106represents most of the <abbr title="United States">US</abbr> eastern time zone;
107<code>America/Phoenix</code> represents most of Arizona, which
108uses mountain time without daylight saving time (<abbr>DST</abbr>);
109<code>America/Detroit</code> represents most of Michigan, which uses
110eastern time but with different <abbr>DST</abbr> rules in 1975;
111and other entries represent smaller regions like Starke County,
112Indiana, which switched from central to eastern time in 1991
113and switched back in 2006.
114To use the database on an extended <a
115href="https://en.wikipedia.org/wiki/POSIX"><abbr
116title="Portable Operating System Interface">POSIX</abbr></a>
117implementation set the <code><abbr>TZ</abbr></code>
118environment variable to the location's full name,
119e.g., <code><abbr>TZ</abbr>="America/New_York"</code>.</p>
120<p>
121Associated with each timezone is a history of offsets from
122<a href="https://en.wikipedia.org/wiki/Universal_Time">Universal
123Time</a> (<abbr>UT</abbr>), which is <a
124href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean
125Time</a> (<abbr>GMT</abbr>) with days beginning at midnight;
126for timestamps after 1960 this is more precisely <a
127href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated
128Universal Time</a> (<abbr>UTC</abbr>).
129The database also records when daylight saving time was in use,
130along with some time zone abbreviations such as <abbr>EST</abbr>
131for Eastern Standard Time in the <abbr>US</abbr>.</p>
132</section>
133
134<section>
135<h2 id="download">Downloading the <code><abbr>tz</abbr></code> database</h2>
136<p>
137The following <a
138href="https://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
139the latest release's two
140<a href="https://en.wikipedia.org/wiki/Tar_(computing)">tarballs</a>
141to a <abbr>GNU</abbr>/Linux or similar host.</p>
142<pre><code>mkdir tzdb
143cd tzdb
144<a href="https://www.gnu.org/software/wget/">wget</a> https://www.iana.org/time-zones/repository/tzcode-latest.tar.gz
145wget https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
146<a href="https://www.gnu.org/software/gzip/">gzip</a> -dc tzcode-latest.tar.gz | <a href="https://www.gnu.org/software/tar/">tar</a> -xf -
147gzip -dc tzdata-latest.tar.gz | tar -xf -
148</code></pre>
149<p>Alternatively, the following shell commands download the same
150release in a single-tarball format containing extra data
151useful for regression testing:</p>
152<pre><code>wget <a href="https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz">https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz</a>
153<a href="https://www.nongnu.org/lzip/">lzip</a> -dc tzdb-latest.tar.lz | tar -xf -
154</code></pre>
155<p>These commands use convenience links to the latest release
156of the <code><abbr>tz</abbr></code> database hosted by the
157<a href="https://www.iana.org/time-zones">Time Zone Database website</a>
158of the <a href="https://www.iana.org">Internet Assigned Numbers
159Authority (IANA)</a>.
160Older releases are in files named
161<code>tzcode<var>V</var>.tar.gz</code>,
162<code>tzdata<var>V</var>.tar.gz</code>, and
163<code>tzdb-<var>V</var>.tar.lz</code>,
164where <code><var>V</var></code> is the version.
165Since 1996, each version has been a four-digit year followed by
166lower-case letter (<samp>a</samp> through <samp>z</samp>,
167then <samp>za</samp> through <samp>zz</samp>, then <samp>zza</samp>
168through <samp>zzz</samp>, and so on).
169Since version 2022a, each release has been distributed in
170<a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06">POSIX
171ustar interchange format</a>, compressed as described above;
172older releases use a nearly-compatible format.
173Since version 2016h, each release has contained a text file named
174"<samp>version</samp>" whose first (and currently only) line is the version.
175Older releases are <a href="https://ftp.iana.org/tz/releases/">archived</a>,
176and are also available in an
177<a href="ftp://ftp.iana.org/tz/releases/"><abbr
178title="File Transfer Protocol">FTP</abbr> directory</a> via a
179less-secure protocol.</p>
180<p>Alternatively, a development repository of code and data can be
181retrieved from <a href="https://github.com">GitHub</a> via the shell
182command:</p>
183<pre><code><a href="https://git-scm.com">git</a> clone <a href="https://github.com/eggert/tz">https://github.com/eggert/tz</a>
184</code></pre>
185<p>
186Since version 2012e, each release has been tagged in development repositories.
187Untagged commits are less well tested and probably contain
188more errors.</p>
189<p>
190After obtaining the code and data files, see the
191<code>README</code> file for what to do next.
192The code lets you compile the <code><abbr>tz</abbr></code> source files into
193machine-readable binary files, one for each location. The binary files
194are in a special timezone information format (<dfn><abbr>TZif</abbr></dfn>)
195specified by <a href="https://datatracker.ietf.org/doc/html/8536">Internet
196<abbr>RFC</abbr> 8536</a>.
197The code also lets
198you read a <abbr>TZif</abbr> file and interpret timestamps for that
199location.</p>
200</section>
201
202<section>
203<h2 id="changes">Changes to the <code><abbr>tz</abbr></code> database</h2>
204<p>
205The <code><abbr>tz</abbr></code> code and data
206are by no means authoritative. If you find errors, please
207send changes to <a href="mailto:tz@iana.org"><code>tz@iana.org</code></a>,
208the time zone mailing list. You can also <a
209href="https://mm.icann.org/mailman/listinfo/tz">subscribe</a> to it
210and browse the <a
211href="https://mm.icann.org/pipermail/tz/">archive of old
212messages</a>.
213<a href="https://tzdata-meta.timtimeonline.com/">Metadata for mailing list
214discussions</a> and corresponding data changes can be
215generated <a href="https://github.com/timparenti/tzdata-meta">automatically</a>.
216</p>
217<p>
218If your government plans to change its time zone boundaries or
219daylight saving rules, inform <code>tz@iana.org</code> well in
220advance, as this will coordinate updates to many cell phones,
221computers, and other devices around the world.
222The change should be officially announced at least a year before it affects
223how clocks operate; otherwise, there is a good chance that some
224clocks will operate incorrectly after the change, due
225to delays in propagating updates to software and data. The shorter
226the notice, the more likely clock problems will arise; see "<a
227href="https://codeofmatt.com/2016/04/23/on-the-timing-of-time-zone-changes/">On
228the Timing of Time Zone Changes</a>" for examples.
229The <code><abbr>tz</abbr></code> data can represent planned changes
230far into the future, and a long-planned change can easily be reverted
231or otherwise altered with a year's notice before the change would have
232affected clocks.
233</p>
234<p>
235Changes to the <code><abbr>tz</abbr></code> code and data are often
236propagated to clients via operating system updates, so
237client <code><abbr>tz</abbr></code> data can often be corrected by
238applying these updates. With GNU/Linux and similar systems, if your
239maintenance provider has not yet adopted the
240latest <code><abbr>tz</abbr></code> data, you can often short-circuit
241the process by tailoring the generic instructions in
242the <code><abbr>tz</abbr> README</code> file and installing the latest
243data yourself. System-specific instructions for installing the
244latest <code><abbr>tz</abbr></code> data have also been published
245for <a href="https://developer.ibm.com/articles/au-aix-olson-time-zone/"><abbr>AIX</abbr></a>,
246<a
247href="https://source.android.com/devices/tech/config/timezone-rules">Android</a>,
248<a
249href="https://unicode-org.github.io/icu/userguide/datetime/timezone/"><abbr
250title="International Components for Unicode">ICU</abbr></a>,
251<a href="https://www.ibm.com/support/pages/java-sdk-time-zone-update-utility"><abbr>IBM</abbr>
252JDK</a>,
253<a href="https://www.joda.org/joda-time/tz_update.html">Joda-Time</a>, <a
254href="https://dev.mysql.com/doc/refman/en/time-zone-support.html">MySQL</a>,
255<a href="https://nodatime.org/userguide/tzdb">Noda Time</a>, and <a
256href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html">OpenJDK/Oracle JDK</a>.
257</p>
258<p>Since version 2013a,
259sources for the <code><abbr>tz</abbr></code> database have been
260<a href="https://en.wikipedia.org/wiki/UTF-8"><abbr
261title="Unicode Transformation Format 8-bit">UTF-8</abbr></a>
262<a href="https://en.wikipedia.org/wiki/Text_file">text files</a>
263with lines terminated by <a href="https://en.wikipedia.org/wiki/Newline"><abbr
264title="linefeed">LF</abbr></a>,
265which can be modified by common text editors such
266as <a href="https://www.gnu.org/software/emacs/">GNU Emacs</a>,
267<a href="https://wiki.gnome.org/Apps/Gedit">gedit</a>, and
268<a href="https://www.vim.org">vim</a>.
269Specialized source-file editing can be done via the
270<a href="https://packagecontrol.io/packages/zoneinfo">Sublime
271zoneinfo</a> package for <a
272href="https://www.sublimetext.com">Sublime Text</a> and the <a
273href="https://marketplace.visualstudio.com/items?itemName=gilmoreorless.vscode-zoneinfo">VSCode
274zoneinfo</a> extension for <a href="https://code.visualstudio.com">Visual
275Studio Code</a>.
276</p>
277<p>
278For further information about updates, please see
279<a href="https://datatracker.ietf.org/doc/html/rfc6557">Procedures for
280Maintaining the Time Zone Database</a> (Internet <abbr
281title="Request For Comments">RFC</abbr> 6557). More detail can be
282found in <a href="theory.html">Theory and pragmatics of the
283<code><abbr>tz</abbr></code> code and data</a>.
284<a href="https://a0.github.io/a0-tzmigration/">A0 TimeZone Migration</a>
285displays changes between recent <code><abbr>tzdb</abbr></code> versions.
286</p>
287</section>
288
289<section>
290<h2 id="commentary">Commentary on the <code><abbr>tz</abbr></code> database</h2>
291<ul>
292<li>The article
293<a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a> is
294an encyclopedic summary.</li>
295<li><a href="tz-how-to.html">How to Read the
296tz Database Source Files</a> explains the <code><abbr>tz</abbr></code>
297database format.</li>
298<li><a
299href="https://blog.jonudell.net/2009/10/23/a-literary-appreciation-of-the-olsonzoneinfotz-database/">A
300literary appreciation of the Olson/Zoneinfo/tz database</a> comments on the
301database's style.</li>
302<li><a href="https://doi.org/10.1145/3340301.3341125">What time is it:
303managing time in the internet</a> analyzes the database longitudinally.</li>
304</ul>
305</section>
306
307<section>
308<h2 id="web">Web sites using recent versions of the
309<code><abbr>tz</abbr></code> database</h2>
310<p>
311These are listed roughly in ascending order of complexity and fanciness.
312</p>
313<ul>
314<li><a href="https://time.is">Time.is</a> shows locations'
315time and zones.</li>
316<li><a href="https://www.timejones.com">TimeJones.com</a>,
317<a href="https://timezoneconverterapp.com">Time Zone Converter</a> and
318<a href="https://www.worldclock.com">The World Clock</a>
319are time zone converters.</li>
320<li><a href="https://timezonedb.com/download">TimeZoneDB Database</a>
321publishes <code><abbr>tzdb</abbr></code>-derived data in
322<a href="https://en.wikipedia.org/wiki/Comma-separated_values"><abbr
323title="comma-separated values">CSV</abbr></a> and
324in <a href="https://en.wikipedia.org/wiki/SQL"><abbr
325title="Structured Query Language">SQL</abbr></a> form.</li>
326<li><a
327href="https://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a>
328lets you see the <code><abbr>TZ</abbr></code> values directly.</li>
329<li><a
330href="https://www.convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current
331Time in 1000 Places</a> uses descriptions of the values.</li>
332<li><a href="https://home.kpn.nl/vanadovv/time/TZworld.html">Complete
333timezone information for all countries</a>
334displays tables of <abbr>DST</abbr> rules.
335<li><a href="https://www.timeanddate.com/worldclock/">The World Clock &ndash;
336Worldwide</a> lets you sort zone names and convert times.</li>
337<li><a href="https://24timezones.com">24TimeZones</a> has a world
338time map and a time converter.</li>
339<li><a href="https://www.zeitverschiebung.net/en/">Time Difference</a>
340calculates the current time difference between locations.</li>
341<li><a href="https://www.wx-now.com">Weather Now</a> and
342<a href="https://www.thetimenow.com">The Time Now</a> list the weather too.</li>
343</ul>
344</section>
345
346<section>
347<h2 id="protocols">Network protocols for <code><abbr>tz</abbr></code> data</h2>
348<ul>
349<li>The <a href="https://www.ietf.org">Internet Engineering Task Force</a>'s
350<a href="https://datatracker.ietf.org/wg/tzdist/charter/">Time Zone Data
351Distribution Service (tzdist) working group</a> defined <a
352href="https://datatracker.ietf.org/doc/html/rfc7808">TZDIST</a>
353(Internet <abbr>RFC</abbr> 7808), a time zone data distribution service,
354along with <a href="https://datatracker.ietf.org/doc/html/rfc7809">CalDAV</a>
355(Internet <abbr>RFC</abbr> 7809), a calendar access protocol for
356transferring time zone data by reference.
357<a href="https://devguide.calconnect.org/Time-Zones/TZDS/">TZDIST
358implementations</a> are available.
359The <a href="https://www.ietf.org/mailman/listinfo/tzdist-bis">tzdist-bis
360mailing list</a> discusses possible extensions.</li>
361<li>The <a href="https://datatracker.ietf.org/doc/html/rfc5545">
362Internet Calendaring and Scheduling Core Object Specification
363(iCalendar)</a> (Internet <abbr>RFC</abbr> 5445)
364covers time zone
365data; see its VTIMEZONE calendar component.
366The iCalendar format requires specialized parsers and generators; a
367variant <a href="https://datatracker.ietf.org/doc/html/rfc6321">xCal</a>
368(Internet <abbr>RFC</abbr> 6321) uses
369<a href="https://www.w3.org/XML/"><abbr
370title="Extensible Markup Language">XML</abbr></a> format, and a variant
371<a href="https://datatracker.ietf.org/doc/html/rfc7265">jCal</a>
372(Internet <abbr>RFC</abbr> 7265)
373uses <a href="https://www.json.org"><abbr
374title="JavaScript Object Notation">JSON</abbr></a> format.</li>
375</ul>
376</section>
377
378<section>
379<h2 id="compilers">Other <code><abbr>tz</abbr></code> compilers</h2>
380<p>Although some of these do not fully support
381<code><abbr>tz</abbr></code> data, in recent <code><abbr>tzdb</abbr></code>
382distributions you can generally work around compatibility problems by
383running the command <code>make rearguard_tarballs</code> and compiling
384from the resulting tarballs instead.</p>
385<ul>
386<li><a href="https://sourceforge.net/projects/vzic/">Vzic</a> is a <a
387href="https://en.wikipedia.org/wiki/C_%28programming_language%29">C</a>
388program that compiles
389<code><abbr>tz</abbr></code> source into iCalendar-compatible VTIMEZONE files.
390Vzic is freely
391available under the <a
392href="https://www.gnu.org/copyleft/gpl.html"><abbr>GNU</abbr>
393General Public License (<abbr
394title="General Public License">GPL</abbr>)</a>.</li>
395<li><a href="https://sourceforge.net/projects/tzical/">tziCal &ndash; tz
396database conversion utility</a> is like Vzic, except for the <a
397href="https://dotnet.microsoft.com">.NET framework</a>
398and with a <abbr>BSD</abbr>-style license.</li>
399<li><a
400href="https://metacpan.org/release/DateTime-TimeZone">DateTime::TimeZone</a>
401contains a script <code>parse_olson</code> that compiles
402<code><abbr>tz</abbr></code> source into <a href="https://www.perl.org">Perl</a>
403modules. It is part of the Perl <a
404href="https://github.com/houseabsolute/DateTime.pm/wiki">DateTime Project</a>,
405which is freely
406available under both the <abbr>GPL</abbr> and the Perl Artistic
407License. DateTime::TimeZone also contains a script
408<code>tests_from_zdump</code> that generates test cases for each clock
409transition in the <code><abbr>tz</abbr></code> database.</li>
410<li>The <a href="https://howardhinnant.github.io/date/tz.html">Time Zone
411Database Parser</a> is a
412<a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a> parser and
413runtime library with <a
414href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html">API</a>
415adopted by
416<a href="https://en.wikipedia.org/wiki/C++20">C++20</a>,
417the current iteration of the C++ standard.
418It is freely available under the
419<abbr title="Massachusetts Institute of Technology">MIT</abbr> license.</li>
420<li><a id="ICU" href="https://icu.unicode.org">International Components for
421Unicode (<abbr>ICU</abbr>)</a> contains C/C++ and <a
422href="https://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>
423libraries for internationalization that
424has a compiler from <code><abbr>tz</abbr></code> source
425and from <abbr title="Common Locale Data Repository">CLDR</abbr> data
426(mentioned <a href="#CLDR">below</a>)
427into an <abbr>ICU</abbr>-specific format.
428<abbr>ICU</abbr> is freely available under a
429<abbr>BSD</abbr>-style license.</li>
430<li>The <a href="https://github.com/lau/tzdata">Tzdata</a> package for
431the <a href="https://elixir-lang.org">Elixir</a> language downloads
432and compiles <code><abbr>tz</abbr></code> source and exposes <abbr
433title="Application Program Interface">API</abbr>s for use. It is
434freely available under the <abbr>MIT</abbr> license.</li>
435<li>Java-based compilers and libraries include:
436<ul>
437<li>The <a
438href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html">TZUpdater
439tool</a> compiles <code><abbr>tz</abbr></code> source into the format used by
440<a href="https://openjdk.java.net/">OpenJDK</a> and
441<a href="https://jdk.java.net/">Oracle JDK</a>.
442Although its source code is proprietary, its executable is available under the
443<a href="https://www.oracle.com/a/tech/docs/tzupdater-lic.html">Java SE
444Timezone Updater License Agreement</a>.</li>
445<li>The <a
446href="https://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html">Java
447SE 8 Date and Time</a> <abbr>API</abbr> can be supplemented by <a
448href="https://www.threeten.org/threeten-extra/">ThreeTen-Extra</a>,
449which is freely available under a <abbr>BSD</abbr>-style license.</li>
450<li><a href="https://www.joda.org/joda-time/">Joda-Time &ndash; Java date
451and time <abbr>API</abbr></a> contains a class
452<code>org.joda.time.tz.ZoneInfoCompiler</code> that compiles
453<code><abbr>tz</abbr></code> source into a binary format. It inspired
454Java 8 <code>java.time</code>, which its users should migrate to once
455they can assume Java 8 or later. It is available under the <a
456href="https://www.apache.org/licenses/LICENSE-2.0">Apache License</a>.</li>
457<li><a href="https://bell-sw.com/pages/iana-updater/">IANA Updater</a> and <a
458href="https://www.azul.com/products/open-source-tools/ziupdater-time-zone-tool/">ZIUpdater</a>
459are alternatives to TZUpdater. IANA Updater's license is unclear;
460ZIUpdater is licensed under the <abbr>GPL</abbr>.</li>
461<li><a href="https://github.com/MenoData/Time4A">Time4A: Advanced date and
462time library for Android</a> and
463<a href="https://github.com/MenoData/Time4J/">Time4J: Advanced date,
464time and interval library for Java</a> compile
465<code><abbr>tz</abbr></code> source into a binary format.
466Time4A is available under the Apache License and Time4J is
467available under the <a
468href="https://www.gnu.org/copyleft/lesser.html"><abbr>GNU</abbr> Lesser
469General Public License (<abbr title="Lesser General Public
470License">LGPL</abbr>)</a>.</li>
471<li><abbr>ICU</abbr> (mentioned <a href="#ICU">above</a>) contains compilers and
472Java-based libraries.</li>
473</ul>
474<li><a href="https://nodatime.org">Noda Time &ndash; Date and
475time <abbr>API</abbr> for .NET</a>
476is like Joda-Time and Time4J, but for the .NET framework instead of Java.
477It is freely available under the Apache License.</li>
478<li>Many modern
479<a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>
480runtimes support <code><abbr>tz</abbr></code> natively via the
481<samp>timeZone</samp> option of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat"><samp>Intl.DateTimeFormat</samp></a>.
482This can be used as-is or with most of the following libraries,
483many of which also support runtimes lacking the <samp>timeZone</samp> option.
484<ul>
485<li>The <a
486href="https://github.com/formatjs/date-time-format-timezone"><samp>Intl.DateTimeFormat</samp>
487timezone polyfill</a>
488is freely available under a <abbr>BSD</abbr>-style license.</li>
489<li>The <a href="https://date-fns.org/">date-fns</a>
490library manipulates timezone-aware timestamps in browsers and
491in <a href="https://nodejs.org/en/">Node.js</a>.
492It is freely available under the <abbr>MIT</abbr> license.</li>
493<li><a href="https://github.com/iamkun/dayjs">Day.js</a> is a
494minimalist replacement for the date and time API of
495the <a href="https://momentjs.com/docs/">now-legacy Moment.js</a> date
496manipulation library.
497It is freely available under the <abbr>MIT</abbr> license.</li>
498<li><a href="https://moment.github.io/luxon/">Luxon</a> improves
499timezone support for the <samp>Intl</samp> API.
500It is freely available under the <abbr>MIT</abbr> license.</li>
501<li><a href="https://momentjs.com/timezone/">Moment Timezone</a> is a
502Moment.js plugin.
503It is freely available under the <abbr>MIT</abbr> license.</li>
504<li><a href="https://github.com/bigeasy/timezone">Timezone</a> is a
505JavaScript library that supports date arithmetic that is time zone
506aware. It is freely available under the <abbr>MIT</abbr> license.</li>
507<li><a href="https://www.npmjs.com/package/@tubular/time">@tubular/time</a>
508supports live <code><abbr>tzdb</abbr></code> updates,
509astronomical and atomic time, a command-line interface,
510and full <a
511href="https://en.wikipedia.org/wiki/TypeScript">TypeScript</a>.
512Its companion <a
513href="https://www.npmjs.com/package/@tubular/time-tzdb">@tubular/time-tzdb</a>
514can generate <abbr>TZif</abbr> and other files, and a companion website
515<a href="https://tzexplorer.org">Timezone Database Explorer</a> lets you
516convert timestamps, view transition histories, and download code and data.
517It is freely available under the <abbr>MIT</abbr> license.</li>
518</ul>
519The proposed <a
520href="https://github.com/tc39/proposal-temporal"><samp>Temporal</samp>
521objects</a> let programs access an abstract view of
522<code><abbr>tzdb</abbr></code> data, and are designed to replace <a
523href="https://codeofmatt.com/javascript-date-type-is-horribly-broken/">JavaScript's
524problematic <samp>Date</samp> objects</a> when working with dates and times.
525<li><a href="https://github.com/JuliaTime/">JuliaTime</a> contains a
526compiler from <code><abbr>tz</abbr></code> source into
527<a href="https://julialang.org/">Julia</a>. It is freely available
528under the <abbr>MIT</abbr> license.</li>
529<li><a href="https://github.com/pavkam/tzdb"><abbr>TZDB</abbr> &ndash;
530<abbr>IANA</abbr> Time Zone Database for Delphi/<abbr
531title="Free Pascal Compiler">FPC</abbr></a>
532compiles from <code><abbr>tz</abbr></code> source into
533<a href="https://en.wikipedia.org/wiki/Object_Pascal">Object Pascal</a>
534as compiled by <a href="https://en.wikipedia.org/wiki/Delphi_(IDE)">Delphi</a>
535and <a
536href="https://en.wikipedia.org/wiki/Free_Pascal"><abbr>FPC</abbr></a>.
537It is freely available under a <abbr>BSD</abbr>-style license.</li>
538<li><a href="http://pytz.sourceforge.net">pytz &ndash; World Timezone
539Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
540<a href="https://www.python.org">Python</a>.
541It is freely available under a <abbr>BSD</abbr>-style license.
542In code that can assume Python 3.6 or later it is largely superseded; see <a
543href="https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html">pytz:
544The Fastest Footgun in the West</a>.</li>
545<li><a href="https://tzinfo.github.io">TZInfo &ndash;
546Ruby Timezone Library</a>
547compiles <code><abbr>tz</abbr></code> source into
548<a href="https://www.ruby-lang.org/en/">Ruby</a>.
549It is freely available under the <abbr>MIT</abbr> license.</li>
550<li>The <a href="https://www.squeaksource.com/Chronos/">Chronos Date/Time
551Library</a> is
552a <a href="https://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> class
553library that compiles <code><abbr>tz</abbr></code> source into a time
554zone repository whose format
555is either proprietary or an <abbr>XML</abbr>-encoded
556representation.</li>
557<li><a id="Tcl" href="https://tcl.tk">Tcl</a>
558contains a developer-oriented parser that compiles <code><abbr>tz</abbr></code>
559source into text files, along with a runtime that can read those
560files. Tcl is freely available under a <abbr>BSD</abbr>-style
561license.</li>
562</ul>
563</section>
564
565<section>
566<h2 id="TZif">Other <abbr>TZif</abbr> readers</h2>
567<ul>
568<li>The <a
569href="https://www.gnu.org/software/libc/"><abbr>GNU</abbr> C
570Library</a>
571has an independent, thread-safe implementation of
572a <abbr>TZif</abbr> file reader.
573This library is freely available under the LGPL
574and is widely used in <abbr>GNU</abbr>/Linux systems.</li>
575<li><a href="https://www.gnome.org">GNOME</a>'s
576<a href="https://developer.gnome.org/glib/">GLib</a> has
577a <abbr>TZif</abbr> file reader written in C that
578creates a <code>GTimeZone</code> object representing sets
579of <abbr>UT</abbr> offsets.
580It is freely available under the <abbr>LGPL</abbr>.</li>
581<li>The
582<a href="https://github.com/bloomberg/bde/wiki">BDE Standard Library</a>'s
583<code>baltzo::TimeZoneUtil</code> component contains a C++
584implementation of a <abbr>TZif</abbr> file reader. It is freely available under
585the Apache License.</li>
586<li><a href="https://github.com/google/cctz">CCTZ</a> is a simple C++
587library that translates between <abbr>UT</abbr> and civil time and
588can read <abbr>TZif</abbr> files. It is freely available under the Apache
589License.</li>
590<li><a href="https://github.com/derickr/timelib">Timelib</a> is a C
591library that reads <abbr>TZif</abbr> files and converts
592timestamps from one time zone or format to another.
593It is used by <a href="https://secure.php.net"><abbr
594title="PHP: Hypertext Preprocessor">PHP</abbr></a>,
595<a href="https://hhvm.com"><abbr title="HipHop Virtual Machine">HHVM</abbr></a>,
596and <a href="https://www.mongodb.com">MongoDB</a>.
597It is freely available under the <abbr>MIT</abbr> license.</li>
598<li>Tcl, mentioned <a href="#Tcl">above</a>, also contains a
599<abbr>TZif</abbr> file reader.</li>
600<li><a href="https://metacpan.org/pod/DateTime::TimeZone::Tzfile">
601DateTime::TimeZone::Tzfile</a>
602is a <abbr>TZif</abbr> file reader written in Perl.
603It is freely available under the same terms as Perl
604(dual <abbr>GPL</abbr> and Artistic license).</li>
605<li>Python has a <a id="python-zoneinfo"
606href="https://docs.python.org/3/library/zoneinfo.html"><code>zoneinfo.ZoneInfo</code>
607class</a> that reads <abbr>TZif</abbr> data and creates objects
608that represent <code><abbr>tzdb</abbr></code> timezones.
609Python is freely available under the
610<a href="https://docs.python.org/3/license.html">Python Software Foundation
611License</a>.
612A companion <a id="pypi-tzdata" href="https://pypi.org/">PyPI</a> module
613<a href="https://pypi.org/project/tzdata/"><code>tzdata</code></a>
614supplies TZif data if the underlying system data cannot be found;
615it is freely available under the Apache License.</li>
616<li>The
617public-domain <a href="https://github.com/dbaron/tz.js">tz.js</a>
618library contains a Python tool that
619converts <abbr>TZif</abbr> data into
620<abbr>JSON</abbr>-format data suitable for use
621in its JavaScript library for time zone conversion. Dates before 1970
622are not supported.</li>
623<li>The <a
624href="https://hackage.haskell.org/package/timezone-olson">timezone-olson</a>
625package contains <a href="https://www.haskell.org">Haskell</a> code that
626parses and uses <abbr>TZif</abbr> data. It is freely
627available under a <abbr>BSD</abbr>-style license.</li>
628</ul>
629</section>
630
631<section>
632<h2 id="software">Other <code><abbr>tz</abbr></code>-based time zone software</h2>
633<ul>
634<li><a href="https://foxclocks.org">FoxClocks</a>
635is an extension for <a href="https://www.google.com/chrome/">Google
636Chrome</a> and for <a
637href="https://wiki.mozilla.org/Modules/Toolkit">Mozilla
638Toolkit</a> applications like <a
639href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> and <a
640href="https://www.mozilla.org/en-US/thunderbird/">Thunderbird</a>.
641It displays multiple clocks in the application window, and has a mapping
642interface to <a href="https://www.google.com/earth/">Google Earth</a>.
643It is freely available under the <abbr>GPL</abbr>.</li>
644<li><a href="https://golang.org">Go programming language</a>
645implementations contain a copy of a 32-bit subset of a recent
646<code><abbr>tz</abbr></code> database in a
647Go-specific format.</li>
648<li>Microsoft Windows 8.1
649and later has <code><abbr>tz</abbr></code> data and <abbr>CLDR</abbr>
650data (mentioned <a href="#CLDR">below</a>) used by the
651<a href="https://en.wikipedia.org/wiki/Windows_Runtime">Windows Runtime</a> /
652<a href="https://en.wikipedia.org/wiki/Universal_Windows_Platform">Universal Windows Platform</a> classes
653<a href="https://docs.microsoft.com/uwp/api/Windows.Globalization.DateTimeFormatting.DateTimeFormatter"><code>DateTimeFormatter</code></a> and
654<a href="https://docs.microsoft.com/uwp/api/windows.globalization.calendar"><code>Calendar</code></a>.
655<a id="System.TimeZoneInfo"
656href="https://blogs.msdn.microsoft.com/bclteam/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free/">Exploring
657Windows Time Zones with <code>System.TimeZoneInfo</code></a> describes
658the older, proprietary method of Microsoft Windows 2000 and later,
659which stores time zone data in the
660<a href="https://en.wikipedia.org/wiki/Windows_Registry">Windows Registry</a>. The
661<a
662href="https://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
663Tzid table</a> or <a
664href="https://github.com/unicode-org/cldr/blob/master/common/supplemental/windowsZones.xml"><abbr>XML</abbr>
665file</a> of the <abbr>CLDR</abbr> data maps proprietary zone IDs
666to <code><abbr>tz</abbr></code> names.
667These mappings can be performed programmatically via the <a href="https://github.com/mj1856/TimeZoneConverter">TimeZoneConverter</a> .NET library,
668or the ICU Java and C++ libraries mentioned <a href="#ICU">above</a>.
669<li><a
670href="https://www.oracle.com/java/index.html">Oracle
671Java</a> contains a copy of a subset of a recent
672<code><abbr>tz</abbr></code> database in a
673Java-specific format.</li>
674</ul>
675</section>
676
677<section>
678<h2 id="other-dbs">Other time zone databases</h2>
679<ul>
680<li><a href="https://www.astro.com/atlas">Time-zone Atlas</a>
681is Astrodienst's Web version of Shanks and Pottenger's out-of-print
682time zone history atlases
683<a href="https://www.worldcat.org/oclc/468828649">for the US</a> and
684<a href="https://www.worldcat.org/oclc/76950459">for the world</a>.
685Although these extensive atlases
686<a href="https://astrologynewsservice.com/opinion/how-astrologers-contributed-to-the-information-age-a-brief-history-of-time/">were
687sources for much of the older <code><abbr>tz</abbr></code> data</a>,
688they are unreliable as Shanks appears to have
689guessed many <abbr>UT</abbr> offsets and transitions. The atlases cite no
690sources and do not indicate which entries are guesswork.</li>
691<li><a href="https://en.wikipedia.org/wiki/HP-UX">HP-UX</a> has a database in
692its own <code>tztab</code>(4) format.</li>
693<li>Microsoft Windows has proprietary data mentioned
694<a href="#System.TimeZoneInfo">above</a>.</li>
695<li><a href="https://www.worldtimeserver.com">World Time Server</a>
696is another time zone database.</li>
697<li>The <a
698href="https://www.iata.org/publications/store/Pages/standard-schedules-information.aspx">Standard
699Schedules Information Manual</a> of the
700International Air Transport Association
701gives current time zone rules for airports served by commercial aviation.</li>
702</ul>
703</section>
704
705<section>
706<h2 id="maps">Maps</h2>
707<ul>
708<li>The <a
709href="https://www.cia.gov/the-world-factbook/maps/world-regional/">World
710and Regional Maps section</a> of <em>The World Factbook</em>, published by the
711<a href="https://www.cia.gov">US Central Intelligence
712Agency (<abbr
713title="Central Intelligence Agency">CIA</abbr>)</a>, contains a time
714zone map; the
715<a
716href="https://legacy.lib.utexas.edu/maps/world.html">Perry&ndash;Casta&ntilde;eda
717Library Map Collection</a>
718of the University of Texas at Austin has copies of
719recent editions.
720The pictorial quality is good,
721but the maps do not indicate daylight saving time,
722and parts of the data are a few years out of date.</li>
723<li><a href="https://www.worldtimezone.com">World Time Zone Map
724with current time</a>
725has several fancy time zone maps; it covers Russia particularly well.
726The maps' pictorial quality is not quite as good as the
727<abbr>CIA</abbr>'s
728but the maps are more up to date.</li>
729<li><a
730href="https://blog.poormansmath.net/how-much-is-time-wrong-around-the-world/">How
731much is time wrong around the world?</a> maps the difference between
732mean solar and standard time, highlighting areas such as western China
733where the two differ greatly. It's a bit out of date, unfortunately.</li>
734</ul>
735</section>
736
737<section>
738<h2 id="boundaries">Time zone boundaries</h2>
739<p>Geographical boundaries between timezones are available
740from several <a
741href="https://en.wikipedia.org/wiki/Internet_geolocation">Internet
742geolocation</a>
743services and other sources.</p>
744<ul>
745<li><a href="https://github.com/evansiroky/timezone-boundary-builder">Timezone
746Boundary Builder</a> extracts
747<a href="https://www.openstreetmap.org">Open Street Map</a> data to build
748boundaries of <code><abbr>tzdb</abbr></code> timezones.
749Its code is freely available under the <abbr>MIT</abbr> license, and
750its data entries are freely available under the
751<a href="https://opendatacommons.org/licenses/odbl/">Open Data Commons
752Open Database License</a>. The maps' borders appear to be quite accurate.</li>
753<li>Programmatic interfaces that map geographical coordinates via tz_world to
754<code><abbr>tzdb</abbr></code> timezones include:
755<ul>
756<li><a href="https://github.com/mj1856/GeoTimeZone">GeoTimeZone</a> is
757written in <a
758href="https://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>
759and is freely available under the <abbr>MIT</abbr> license.</li>
760<li>The <a href="https://github.com/bradfitz/latlong">latlong package</a>
761is written in Go and is freely available under the Apache License.</li>
762<li><a href="https://github.com/drtimcooper/LatLongToTimezone">LatLongToTimezone</a>,
763in both Java and
764<a href="https://en.wikipedia.org/wiki/Swift_(programming_language)">Swift</a>
765form, is freely available under the MIT license.</li>
766<li>For Node.js,
767the <a href="https://www.npmjs.com/package/geo-tz">geo-tz module</a>
768is freely available under the MIT license, and
769the <a href="https://www.npmjs.com/package/tz-lookup">tz-lookup module</a>
770is in the public domain.</li>
771<li>The <a
772href="https://github.com/MrMinimal64/timezonefinder">timezonefinder</a>
773library for Python is freely available under the MIT license.
774<li>The <a
775href="https://github.com/gunyarakun/timezone_finder">timezone_finder</a>
776library for Ruby is freely available under the MIT license.</li>
777</ul></li>
778<li>Free access via a network API, if you register a key, is provided by
779the <a
780href="https://www.geonames.org/export/web-services.html#timezone">GeoNames
781Timezone web service</a>, the <a
782href="https://developers.google.com/maps/documentation/timezone/intro">Google
783Maps Time Zone API</a>, and
784the <a href="https://timezonedb.com/api">TimeZoneDB API</a>.
785Commercial network API access is provided
786by <a href="https://askgeo.com">AskGeo</a>
787and <a href="https://www.geogarage.com/blog/news-1/post/geogarage-time-zone-api-31">GeoGarage</a>.
788</li>
789<li>"<a
790href="https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates/16086964">How
791to get a time zone from a location using latitude and longitude
792coordinates?</a>" discusses other geolocation possibilities.</li>
793<li><a href="http://statoids.com/statoids.html">Administrative
794Divisions of Countries ("Statoids")</a> lists
795political subdivision data related to time zones.</li>
796<li><a href="https://home.kpn.nl/vanadovv/time/Multizones.html">Time
797zone boundaries for multizone countries</a> summarizes legal
798boundaries between time zones within countries.</li>
799<li><a href="https://manifold.net/info/freestuff.shtml">Manifold Software
800&ndash; GIS and Database Tools</a> includes a Manifold-format map of
801world time zone boundaries distributed under the
802<abbr>GPL</abbr>.</li>
803<li>A ship within the <a
804href="https://en.wikipedia.org/wiki/Territorial_waters">territorial
805waters</a> of any nation uses that nation's time. In international
806waters, time zone boundaries are meridians 15&deg; apart, except that
807<abbr>UT</abbr>&minus;12 and <abbr>UT</abbr>+12 are each 7.5&deg;
808wide and are separated by
809the 180&deg; meridian (not by the International Date Line, which is
810for land and territorial waters only). A captain can change ship's
811clocks any time after entering a new time zone; midnight changes are
812common.</li>
813</ul>
814</section>
815
816<section>
817<h2 id="civil">Civil time concepts and history</h2>
818<ul>
819<li><a href="https://www.nist.gov/pml/time-and-frequency-division/popular-links/walk-through-time">A
820Walk through Time</a>
821surveys the evolution of timekeeping.</li>
822<li>The history of daylight saving time is surveyed in <a
823href="http://www.webexhibits.org/daylightsaving/">About Daylight
824Saving Time &ndash; History, rationale, laws &amp; dates</a> and summarized in
825<a href="http://seizethedaylight.com/dst/">A Brief
826History of Daylight Saving Time</a>.</li>
827<li><a href="https://www.laphamsquarterly.org/roundtable/time-lords">Time
828Lords</a> discusses how authoritarians manipulate civil time.</li>
829<li><a href="https://www.w3.org/TR/timezone/">Working with Time Zones</a>
830contains guidelines and best practices for software applications that
831deal with civil time.</li>
832<li><a href="https://www.staff.science.uu.nl/~gent0113/idl/idl.htm">A History of
833the International Date Line</a> tells the story of the most important
834time zone boundary.</li>
835<li><a href="http://statoids.com/tconcept.html">Basic Time
836Zone Concepts</a> discusses terminological issues behind time zones.</li>
837</ul>
838</section>
839
840<section>
841<h2 id="national">National histories of legal time</h2>
842<dl>
843<dt>Australia</dt>
844<dd>The Parliamentary Library commissioned a <a
845href="https://www.aph.gov.au/binaries/library/pubs/rp/2009-10/10rp10.pdf">research
846paper on daylight saving time in Australia</a>.
847The Bureau of Meteorology publishes a list of <a
848href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">Implementation
849Dates of Daylight Savings Time within Australia</a>.</dd>
850<dt>Belgium</dt>
851<dd>The Royal Observatory of Belgium maintains a table of time in
852Belgium (in
853<a href="https://www.astro.oma.be/GENERAL/INFO/nli001a.html"
854hreflang="nl">Dutch</a> and <a
855href="https://www.astro.oma.be/GENERAL/INFO/fri001a.html"
856hreflang="fr">French</a>).</dd>
857<dt>Brazil</dt>
858<dd>The Time Service Department of the National Observatory
859records <a href="http://pcdsh01.on.br/DecHV.html"
860hreflang="pt-BR">Brazil's daylight saving time decrees (in
861Portuguese)</a>.</dd>
862<dt>Canada</dt>
863<dd>National Research Council Canada publishes current
864and some older information about <a
865href="https://nrc.canada.ca/en/certifications-evaluations-standards/canadas-official-time/time-zones-daylight-saving-time">time
866zones and daylight saving time</a>.</dd>
867<dt>Chile</dt>
868<dd>The Hydrographic and Oceanographic Service of the Chilean Navy publishes a
869<a href="https://www.horaoficial.cl/historia_hora.php" hreflang="es">history of
870Chile's official time (in Spanish)</a>.</dd>
871<dt>China</dt>
872<dd>The Hong Kong Observatory maintains a
873<a href="https://www.hko.gov.hk/en/gts/time/Summertime.htm">history of
874 summer time in Hong Kong</a>,
875and Macau's Meteorological and Geophysical Bureau maintains a <a
876href="https://www.smg.gov.mo/en/subpage/224/page/174">similar
877history for Macau</a>.
878Unfortunately the latter is incomplete and has errors.</dd>
879<dt>Czech Republic</dt>
880<dd><a href="https://kalendar.beda.cz/kdy-zacina-a-konci-letni-cas"
881hreflang="cs">When daylight saving time starts and ends (in Czech)</a>
882summarizes and cites historical <abbr>DST</abbr> regulations.</dd>
883<dt>Germany</dt>
884<dd>The National Institute for Science and Technology maintains the <a
885href="https://www.ptb.de/cms/en/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany.html">Realisation
886of Legal Time in Germany</a>.</dd>
887<dt>Israel</dt>
888<dd>The Interior Ministry periodically issues <a
889href="ftp://ftp.cs.huji.ac.il/pub/tz/announcements"
890hreflang="he">announcements (in Hebrew)</a>.</dd>
891<dt>Malaysia</dt>
892<dd>See Singapore <a href="#Singapore">below</a>.</dd>
893<dt>Mexico</dt>
894<dd>The Investigation and Analysis Service of the Mexican Library of
895Congress has published a <a
896href="https://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm"
897hreflang="es">history of Mexican local time (in Spanish)</a>.</dd>
898<dt>Netherlands</dt>
899<dd><a href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
900hreflang="nl">Legal time in the Netherlands (in Dutch)</a>
901covers the history of local time in the Netherlands from ancient times.</dd>
902<dt>New Zealand</dt>
903<dd>The Department of Internal Affairs maintains a brief <a
904href="https://www.dia.govt.nz/Daylight-Saving-History">History of
905Daylight Saving</a>.</dd>
906<dt>Portugal</dt>
907<dd>The Lisbon Astronomical Observatory publishes a
908<a href="https://oal.ul.pt/hora-legal/" hreflang="pt">history of
909legal time (in Portuguese)</a>.</dd>
910<dt>Singapore</dt>
911<dd><a id="Singapore"
912href="https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html">Why
913is Singapore in the "Wrong" Time Zone?</a> details the
914history of legal time in Singapore and Malaysia.</dd>
915<dt>United Kingdom</dt>
916<dd><a
917href="https://www.polyomino.org.uk/british-time/">History of
918legal time in Britain</a> discusses in detail the country
919with perhaps the best-documented history of clock adjustments.</dd>
920<dt>United States</dt>
921<dd>The Department of Transportation's <a
922href="https://www.transportation.gov/regulations/recent-time-zone-proceedings">Recent
923Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
924<dt>Uruguay</dt>
925<dd>The Oceanography, Hydrography, and Meteorology Service of the Uruguayan
926Navy (SOHMA) publishes an annual <a
927href="https://sohma.armada.mil.uy/index.php/servicios/datos-astronomicos" hreflang="es">almanac
928(in Spanish)</a>.</dd>
929</dl>
930</section>
931
932<section>
933<h2 id="costs">Costs and benefits of time shifts</h2>
934<p>Various sources argue for and against daylight saving time and time
935zone shifts, and many scientific studies have been conducted. This
936section summarizes reviews and position statements based on
937scientific literature in the area.</p>
938<ul>
939<li>Carey RN, Sarma KM.
940<a href="https://bmjopen.bmj.com/content/7/6/e014319.long">Impact of
941daylight saving time on road traffic collision risk: a systematic
942review</a>.
943<em>BMJ Open.</em> 2017;7(6):e014319. doi:<a href="https://doi.org/10.1136/bmjopen-2016-014319">10.1136/bmjopen-2016-014319</a>.
944This reviews research literature and concludes that the evidence
945neither supports nor refutes road safety benefits from
946shifts in time zones.</li>
947<li>Havranek T, Herman D, Irsova D.
948<a href="https://www.iaee.org/en/publications/ejarticle.aspx?id=3051">Does
949daylight saving save electricity? A meta-analysis.</a>
950<em>Energy J.</em> 2018;39(2):35&ndash;61.
951doi:<a href="https://doi.org/10.5547/01956574.39.2.thav">10.5547/01956574.39.2.thav</a>.
952This analyzes research literature and concludes, "Electricity savings
953are larger for countries farther away from the equator, while
954subtropical regions consume more electricity because of <abbr>DST</abbr>."</li>
955<li>Rishi MA, Ahmed O, Barrantes Perez JH <em>et al</em>.
956<a href="https://jcsm.aasm.org/doi/10.5664/jcsm.8780">Daylight saving time:
957an American Academy of Sleep Medicine position statement</a>.
958<em>J Clin Sleep Med.</em>
9592020;<a href="https://doi.org/10.5664/jcsm.8780">10.5664/jcsm.8780</a>.
960This argues for permanent standard time due to health risks of both
961<abbr>DST</abbr> transitions and permanent <abbr>DST</abbr>.</li>
962<li>Roenneberg T, Wirz-Justice A, Skene DJ <em>et al</em>.
963<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7205184/">Why
964should we abolish Daylight Saving Time?</a>
965<em>J Biol Rhythms</em>. 2019;34(3):227&ndash;230.
966doi:<a href="https://doi.org/10.1177/0748730419854197">10.1177/0748730419854197</a>.
967This position paper of the Society for Research on Biological Rhythms
968opposes DST changes and permanent DST, and advocates that governments adopt
969"permanent Standard Time for the health and safety of their citizens".</li>
970</ul>
971</section>
972
973<section>
974<h2 id="precision">Precision timekeeping</h2>
975<ul>
976<li><a
977href="http://leapsecond.com/hpan/an1289.pdf">The
978Science of Timekeeping</a> is a thorough introduction
979to the theory and practice of precision timekeeping.</li>
980<li><a href="https://doi.org/10.1007/978-3-319-59909-0">The Science of
981Time 2016</a> contains several freely-readable papers.</li>
982<li><a href="https://www.ntp.org"><abbr
983title="Network Time Protocol">NTP</abbr>: The Network
984Time Protocol</a> (Internet <abbr>RFC</abbr> 5905)
985discusses how to synchronize clocks of
986Internet hosts.</li>
987<li>The <a href="https://www.usenix.org/system/files/conference/nsdi18/nsdi18-geng.pdf"><span style="font-variant: small-caps">Huygens</span></a>
988family of software algorithms can achieve accuracy to a few tens of
989nanoseconds in scalable server farms without special hardware.</li>
990<li>The <a
991href="https://www.nist.gov/intelligent-systems-division/ieee-1588">Precision
992Time Protocol</a> (<abbr
993title="Institute of Electrical and Electronics Engineers">IEEE</abbr> 1588)
994can achieve submicrosecond clock accuracy on a local area network
995with special-purpose hardware.</li>
996<li><a
997href="https://datatracker.ietf.org/doc/html/rfc4833">Timezone
998Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a>
999(Internet <abbr>RFC</abbr> 4833)
1000specifies a <a
1001href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol"><abbr>DHCP</abbr></a>
1002option for a server to configure
1003a client's time zone and daylight saving settings automatically.</li>
1004<li><a href="https://www.ucolick.org/~sla/leapsecs/timescales.html">Time
1005Scales</a> describes astronomical time scales like
1006<abbr title="Terrestrial Dynamic Time">TDT</abbr>,
1007<abbr title="Geocentric Coordinate Time">TCG</abbr>, and
1008<abbr title="Barycentric Dynamic Time">TDB</abbr>.
1009<li>The <a href="https://www.iau.org"><abbr
1010title="International Astronomical Union">IAU</abbr></a>'s <a
1011href="https://www.iausofa.org"><abbr
1012title="Standards Of Fundamental Astronomy">SOFA</abbr></a>
1013collection contains C and <a
1014href="https://en.wikipedia.org/wiki/Fortran">Fortran</a>
1015code for converting among time scales like
1016<abbr title="International Atomic Time">TAI</abbr>,
1017<abbr>TDB</abbr>, <abbr>TDT</abbr> and
1018<abbr>UTC</abbr>. It is freely available under the
1019<a href="https://www.iausofa.org/tandc.html">SOFA license</a>.</li>
1020<li><a
1021href="https://www.giss.nasa.gov/tools/mars24/help/notes.html">Mars24 Sunclock
1022&ndash; Time on Mars</a> describes Airy Mean Time (<abbr>AMT</abbr>) and the
1023diverse local time
1024scales used by each landed mission on Mars.</li>
1025<li><a href="http://leapsecond.com">LeapSecond.com</a> is
1026dedicated not only to leap seconds but to precise time and frequency
1027in general. It covers the state of the art in amateur timekeeping, and
1028how the art has progressed over the past few decades.</li>
1029<li>The rules for leap seconds are specified in Annex 1 (Time scales) of <a
1030href="https://www.itu.int/rec/R-REC-TF.460-6-200202-I/">Standard-frequency
1031and time-signal emissions</a>, International Telecommunication Union &ndash;
1032Radiocommunication Sector (ITU-R) Recommendation TF.460-6 (02/2002).</li>
1033<li><a
1034href="https://www.iers.org/IERS/EN/Publications/Bulletins/bulletins.html"><abbr
1035title="International Earth Rotation and Reference Systems Service">IERS</abbr>
1036Bulletins</a> contains official publications of the International
1037Earth Rotation and Reference Systems Service, which decides when leap
1038seconds occur. The <code><abbr>tz</abbr></code> code and data support leap seconds
1039via an optional "<code>right</code>" configuration where a computer's internal
1040<code>time_t</code> integer clock counts every <abbr>TAI</abbr> second,
1041as opposed to the default "<code>posix</code>" configuration
1042where the internal clock ignores leap seconds.
1043The two configurations agree for timestamps starting with 1972-01-01 00:00:00
1044<abbr>UTC</abbr> (<code>time_t</code> 63&thinsp;072&thinsp;000) and diverge for
1045timestamps starting with <code>time_t</code> 78&thinsp;796&thinsp;800,
1046which corresponds to the first leap second
10471972-06-30 23:59:60 <abbr>UTC</abbr> in the "<code>right</code>" configuration,
1048and to
10491972-07-01 00:00:00 <abbr>UTC</abbr> in the "<code>posix</code>" configuration.
1050In practice the two configurations also agree for timestamps before
10511972 even though the historical situation is messy, partly because
1052neither <abbr>UTC</abbr> nor <abbr>TAI</abbr>
1053is well-defined for sufficiently-old timestamps.</li>
1054<li><a href="https://developers.google.com/time/smear">Leap Smear</a>
1055discusses how to gradually adjust <abbr>POSIX</abbr> clocks near a
1056leap second so that they disagree with <abbr>UTC</abbr> by at most a
1057half second, even though every <abbr>POSIX</abbr> minute has exactly
1058sixty seconds. This approach works with the default <code><abbr>tz</abbr></code>
1059"<code>posix</code>" configuration, is <a
1060href="http://bk1.ntp.org/ntp-stable/README.leapsmear">supported</a> by
1061the <abbr>NTP</abbr> reference implementation, <a
1062href="https://github.com/google/unsmear">supports</a> conversion between
1063<abbr>UTC</abbr> and smeared <abbr>POSIX</abbr> timestamps, and is used by major
1064cloud service providers. However, according to
1065<a href="https://datatracker.ietf.org/doc/html/rfc8633#section-3.7.1">&sect;3.7.1 of
1066Network Time Protocol Best Current Practices</a>
1067(Internet <abbr>RFC</abbr> 8633), leap smearing is not suitable for
1068applications requiring accurate <abbr>UTC</abbr> or civil time,
1069and is intended for use only in single, well-controlled environments.</li>
1070<li>The <a
1071href="https://pairlist6.pair.net/mailman/listinfo/leapsecs">Leap
1072Second Discussion List</a> covers <a
1073href="https://www2.unb.ca/gge/Resources/gpsworld.november99.pdf">McCarthy
1074and Klepczynski's 1999 proposal to discontinue leap seconds</a>,
1075discussed further in
1076<a href="https://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The
1077leap second: its history and possible future</a>.
1078<a href="https://www.ucolick.org/~sla/leapsecs/"><abbr>UTC</abbr>
1079might be redefined
1080without Leap Seconds</a> gives pointers on this
1081contentious issue, which was active until 2015 and could become active
1082again.</li>
1083</ul>
1084</section>
1085
1086<section>
1087<h2 id="notation">Time notation</h2>
1088<ul>
1089<li>The <a id="CLDR" href="https://cldr.unicode.org">Unicode Common Locale Data
1090Repository (<abbr>CLDR</abbr>) Project</a> has localizations for time
1091zone names, abbreviations, identifiers, and formats. For example, it
1092contains French translations for "Eastern European Summer Time",
1093"<abbr title="Eastern European Summer Time">EEST</abbr>", and
1094"Bucharest". Its
1095<a href="https://unicode.org/cldr/charts/latest/by_type/">by-type
1096charts</a> show these values for many locales. Data values are available in
1097both <abbr title="Locale Data Markup Language">LDML</abbr>
1098(an <abbr>XML</abbr> format) and <abbr>JSON</abbr>.
1099<li>
1100<a href="https://www.cl.cam.ac.uk/~mgk25/iso-time.html">A summary of
1101the international standard date and time notation</a> covers
1102<a
1103href="https://www.iso.org/standard/70907.html"><em><abbr
1104title="International Organization for Standardization">ISO</abbr>
11058601-1:2019 &ndash; Date and time &ndash; Representations for information
1106interchange &ndash; Part 1: Basic rules</em></a>.</li>
1107<li>
1108<a href="https://www.w3.org/TR/xmlschema/#dateTime"><abbr>XML</abbr>
1109Schema: Datatypes &ndash; dateTime</a> specifies a format inspired by
1110<abbr>ISO</abbr> 8601 that is in common use in <abbr>XML</abbr> data.</li>
1111<li><a href="https://datatracker.ietf.org/doc/html/rfc5322#section-3.3">&sect;3.3 of
1112Internet Message Format</a> (Internet <abbr>RFC</abbr> 5322)
1113specifies the time notation used in email and <a
1114href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol"><abbr>HTTP</abbr></a>
1115headers.</li>
1116<li>
1117<a href="https://datatracker.ietf.org/doc/html/rfc3339">Date and Time
1118on the Internet: Timestamps</a> (Internet <abbr>RFC</abbr> 3339)
1119specifies an <abbr>ISO</abbr> 8601
1120profile for use in new Internet
1121protocols.</li>
1122<li>
1123<a href="https://web.archive.org/web/20190130042457/https://www.hackcraft.net/web/datetime/">Date &amp; Time
1124Formats on the Web</a> surveys web- and Internet-oriented date and time
1125formats.</li>
1126<li>Alphabetic time zone abbreviations should not be used as unique
1127identifiers for <abbr>UT</abbr> offsets as they are ambiguous in
1128practice. For example, in English-speaking North America
1129"<abbr>CST</abbr>" denotes 6 hours behind <abbr>UT</abbr>,
1130but in China it denotes 8 hours ahead of <abbr>UT</abbr>,
1131and French-speaking North Americans prefer
1132"<abbr title="Heure Normale du Centre">HNC</abbr>" to
1133"<abbr>CST</abbr>". The <code><abbr>tz</abbr></code>
1134database contains English abbreviations for many timestamps;
1135unfortunately some of these abbreviations were merely the database maintainers'
1136inventions, and these have been removed when possible.</li>
1137<li>Numeric time zone abbreviations typically count hours east of
1138<abbr>UT</abbr>, e.g., +09 for Japan and
1139&minus;10 for Hawaii. However, the <abbr>POSIX</abbr>
1140<code><abbr>TZ</abbr></code> environment variable uses the opposite convention.
1141For example, one might use <code><abbr>TZ</abbr>="<abbr
1142title="Japan Standard Time">JST</abbr>-9"</code> and
1143<code><abbr>TZ</abbr>="<abbr title="Hawaii Standard Time">HST</abbr>10"</code>
1144for Japan and Hawaii, respectively. If the
1145<code><abbr>tz</abbr></code> database is available, it is usually better to use
1146settings like <code><abbr>TZ</abbr>="Asia/Tokyo"</code> and
1147<code><abbr>TZ</abbr>="Pacific/Honolulu"</code> instead, as this should avoid
1148confusion, handle old timestamps better, and insulate you better from
1149any future changes to the rules. One should never set
1150<abbr>POSIX</abbr> <code><abbr>TZ</abbr></code> to a value like
1151<code>"GMT-9"</code>, though, since this would incorrectly imply that
1152local time is nine hours ahead of <abbr>UT</abbr> and the time zone
1153is called "<abbr>GMT</abbr>".</li>
1154</ul>
1155</section>
1156
1157<section>
1158<h2 id="see-also">See also</h2>
1159<ul>
1160<li><a href="theory.html">Theory and pragmatics of the
1161<code><abbr>tz</abbr></code> code and data</a></li>
1162<li><a href="tz-art.html">Time and the Arts</a></li>
1163</ul>
1164</section>
1165
1166<footer>
1167<hr>
1168This web page is in the public domain, so clarified as of
11692009-05-17 by Arthur David Olson.
1170<br>
1171Please send corrections to this web page to the
1172<a href="mailto:tz@iana.org">time zone mailing list</a>.
1173</footer>
1174</body>
1175</html>
1176