diff options
Diffstat (limited to 'contrib/tzdata/theory.html')
-rw-r--r-- | contrib/tzdata/theory.html | 131 |
1 files changed, 80 insertions, 51 deletions
diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index 2b14c5114686..516d2a525111 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -23,7 +23,7 @@ <li><a href="#stability">Interface stability</a></li> <li><a href="#leapsec">Leap seconds</a></li> <li><a href="#calendar">Calendrical issues</a></li> - <li><a href="#planets">Time and time zones on other planets</a></li> + <li><a href="#planets">Time and time zones off earth</a></li> </ul> </nav> @@ -60,7 +60,6 @@ with current and future timestamps in the traditional North American mountain time zone can choose from the timezones <code>America/Denver</code> which observes US-style daylight saving time (<abbr>DST</abbr>), -<code>America/Mazatlan</code> which observes Mexican-style <abbr>DST</abbr>, and <code>America/Phoenix</code> which does not observe <abbr>DST</abbr>. Applications that also deal with past timestamps in the mountain time zone can choose from over a dozen timezones, such as @@ -96,7 +95,7 @@ Group Base Specifications Issue 7</a>, IEEE Std 1003.1-2017, 2018 Edition. Because the database's scope encompasses real-world changes to civil timekeeping, its model for describing time is more complex than the -standard and daylight saving times supported by POSIX. +standard and daylight saving times supported by POSIX.1-2017. A <code><abbr>tz</abbr></code> timezone corresponds to a ruleset that can have more than two changes per year, these changes need not merely flip back and forth between two alternatives, and the rules themselves @@ -122,7 +121,7 @@ If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see the <code>tzselect</code> program in the <code><abbr>tz</abbr></code> code. -The <a href="http://cldr.unicode.org">Unicode Common Locale Data +The <a href="https://cldr.unicode.org">Unicode Common Locale Data Repository</a> contains data that may be useful for other selection interfaces; it maps timezone names like <code>Europe/Prague</code> to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格". @@ -188,7 +187,7 @@ in decreasing order of importance: href="https://en.wikipedia.org/wiki/ASCII">ASCII</a> letters, '<code>.</code>', '<code>-</code>' and '<code>_</code>'. Do not use digits, as that might create an ambiguity with <a - href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03">POSIX + href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03">POSIX.1-2017 <code>TZ</code> strings</a>. A file name component must not exceed 14 characters or start with '<code>-</code>'. @@ -329,6 +328,7 @@ still supported. These legacy names are mostly defined in the file '<code>etcetera</code>'. Also, the file '<code>backward</code>' defines the legacy names +'<code>Etc/GMT0</code>', '<code>Etc/GMT-0</code>', '<code>Etc/GMT+0</code>', '<code>GMT0</code>', '<code>GMT-0</code>' and '<code>GMT+0</code>', and the file '<code>northamerica</code>' defines the legacy names '<code>EST5EDT</code>', '<code>CST6CDT</code>', @@ -362,6 +362,11 @@ The backward-compatibility file <code>zone.tab</code> is similar but conforms to the older-version guidelines related to <abbr>ISO</abbr> 3166-1; it lists only one country code per entry and unlike <code>zone1970.tab</code> it can list names defined in <code>backward</code>. +Applications that process only timestamps from now on can instead use the file +<code>zonenow.tab</code>, which partitions the world more coarsely, +into regions where clocks agree now and in the predicted future; +this file is smaller and simpler than <code>zone1970.tab</code> +and <code>zone.tab</code>. </p> <p> @@ -373,7 +378,7 @@ nowadays distributions typically use it and no great weight should be attached to whether a link is defined in <code>backward</code> or in some other file. The source file <code>etcetera</code> defines names that may be useful -on platforms that do not support POSIX-style <code>TZ</code> strings; +on platforms that do not support POSIX.1-2017-style <code>TZ</code> strings; no other source file other than <code>backward</code> contains links to its zones. One of <code>etcetera</code>'s names is <code>Etc/UTC</code>, @@ -421,7 +426,7 @@ in decreasing order of importance: expression <code>[-+[:alnum:]]{3,6}</code> should match the abbreviation. This guarantees that all abbreviations could have been specified by a - POSIX <code>TZ</code> string. + POSIX.1-2017 <code>TZ</code> string. </p> </li> <li> @@ -443,11 +448,11 @@ in decreasing order of importance: CAT/CAST Central Africa, CET/CEST/CEMT Central European, ChST Chamorro, - CST/CDT/CWT/CPT/CDDT Central [North America], + CST/CDT/CWT/CPT Central [North America], CST/CDT China, GMT/BST/IST/BDST Greenwich, EAT East Africa, - EST/EDT/EWT/EPT/EDDT Eastern [North America], + EST/EDT/EWT/EPT Eastern [North America], EET/EEST Eastern European, GST/GDT Guam, HST/HDT/HWT/HPT Hawaii, @@ -460,13 +465,13 @@ in decreasing order of importance: MET/MEST Middle European (a backward-compatibility alias for Central European), MSK/MSD Moscow, - MST/MDT/MWT/MPT/MDDT Mountain, + MST/MDT/MWT/MPT Mountain, NST/NDT/NWT/NPT/NDDT Newfoundland, NST/NDT/NWT/NPT Nome, NZMT/NZST New Zealand through 1945, NZST/NZDT New Zealand 1946–present, PKT/PKST Pakistan, - PST/PDT/PWT/PPT/PDDT Pacific, + PST/PDT/PWT/PPT Pacific, PST/PDT Philippine, SAST South Africa, SST Samoa, @@ -494,7 +499,7 @@ in decreasing order of importance: <p> <small>These abbreviations are: AMT Asunción, Athens; - BMT Baghdad, Bangkok, Batavia, Bermuda, Bern, Bogotá, Bridgetown, + BMT Baghdad, Bangkok, Batavia, Bermuda, Bern, Bogotá, Brussels, Bucharest; CMT Calamarca, Caracas, Chisinau, Colón, Córdoba; DMT Dublin/Dunsink; @@ -506,12 +511,13 @@ in decreasing order of importance: IMT Irkutsk, Istanbul; JMT Jerusalem; KMT Kaunas, Kyiv, Kingston; - LMT Lima, Lisbon, local, Luanda; + LMT Lima, Lisbon, local; MMT Macassar, Madras, Malé, Managua, Minsk, Monrovia, Montevideo, Moratuwa, Moscow; PLMT Phù Liễn; PMT Paramaribo, Paris, Perm, Pontianak, Prague; PMMT Port Moresby; + PPMT Port-au-Prince; QMT Quito; RMT Rangoon, Riga, Rome; SDMT Santo Domingo; @@ -519,8 +525,7 @@ in decreasing order of importance: SMT Santiago, Simferopol, Singapore, Stanley; TBMT Tbilisi; TMT Tallinn, Tehran; - WMT Warsaw; - ZMT Zomba.</small> + WMT Warsaw.</small> </p> <p> @@ -571,7 +576,7 @@ in decreasing order of importance: locations while uninhabited. The leading '<code>-</code>' is a flag that the <abbr>UT</abbr> offset is in some sense undefined; this notation is derived - from <a href="https://tools.ietf.org/html/rfc3339">Internet + from <a href="https://datatracker.ietf.org/doc/html/rfc3339">Internet <abbr title="Request For Comments">RFC</abbr> 3339</a>. </li> </ul> @@ -624,7 +629,7 @@ Errors in the <code><abbr>tz</abbr></code> database arise from many sources: should be observed. In her 2015 book <cite><a - href="http://www.hup.harvard.edu/catalog.php?isbn=9780674286146">The + href="https://www.hup.harvard.edu/catalog.php?isbn=9780674286146">The Global Transformation of Time, 1870–1950</a></cite>, Vanessa Ogle writes "Outside of Europe and North America there was no system of time @@ -765,12 +770,12 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes calendar with 24-hour days. These divergences range from relatively minor, such as Japanese bars giving times like "24:30" for the wee hours of the morning, to more-significant differences such as <a - href="https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time">the + href="https://theworld.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time">the east African practice of starting the day at dawn</a>, renumbering the Western 06:00 to be 12:00. These practices are largely outside the scope of the <code><abbr>tz</abbr></code> code and data, which provide only limited support for date and time localization - such as that required by POSIX. + such as that required by POSIX.1-2017. If <abbr>DST</abbr> is not used a different time zone can often do the trick; for example, in Kenya a <code>TZ</code> setting like <code><-03>3</code> or <code>America/Cayenne</code> starts @@ -791,7 +796,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes with days starting at midnight. Although <abbr>UT</abbr> equals <abbr>UTC</abbr> for modern timestamps, <abbr>UTC</abbr> was not defined until 1960, so - commentary uses the more-general abbreviation <abbr>UT</abbr> for + commentary uses the more general abbreviation <abbr>UT</abbr> for timestamps that might predate 1960. Since <abbr>UT</abbr>, <abbr>UT1</abbr>, etc. disagree slightly, and since pre-1972 <abbr>UTC</abbr> seconds varied in length, @@ -810,7 +815,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes See: Stephenson FR, Morrison LV, Hohenkerk CY. <a href="https://dx.doi.org/10.1098/rspa.2016.0404">Measurement of the Earth's rotation: 720 BC to AD 2015</a>. - <cite>Proc Royal Soc A</cite>. 2016 Dec 7;472:20160404. + <cite>Proc Royal Soc A</cite>. 2016;472:20160404. Also see: Espenak F. <a href="https://eclipse.gsfc.nasa.gov/SEhelp/uncertainty2004.html">Uncertainty in Delta T (ΔT)</a>. @@ -818,7 +823,8 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes <li> The relationship between POSIX time (that is, <abbr>UTC</abbr> but ignoring <a href="https://en.wikipedia.org/wiki/Leap_second">leap - seconds</a>) and <abbr>UTC</abbr> is not agreed upon after 1972. + seconds</a>) and <abbr>UTC</abbr> is not agreed upon. + This affects time stamps during the leap second era (1972–2035). Although the POSIX clock officially stops during an inserted leap second, at least one proposed standard has it jumping back a second instead; and in @@ -866,23 +872,23 @@ input is occasionally extended, and a platform may still be shipping an older <code>zic</code>. </p> -<h3 id="POSIX">POSIX properties and limitations</h3> +<h3 id="POSIX">POSIX.1-2017 properties and limitations</h3> <ul> <li> <p> - In POSIX, time display in a process is controlled by the + In POSIX.1-2017, time display in a process is controlled by the environment variable <code>TZ</code>. - Unfortunately, the POSIX + Unfortunately, the POSIX.1-2017 <code>TZ</code> string takes a form that is hard to describe and is error-prone in practice. - Also, POSIX <code>TZ</code> strings cannot deal with daylight + Also, POSIX.1-2017 <code>TZ</code> strings cannot deal with daylight saving time rules not based on the Gregorian calendar (as in - Iran), or with situations where more than two time zone + Morocco), or with situations where more than two time zone abbreviations or <abbr>UT</abbr> offsets are used in an area. </p> <p> - The POSIX <code>TZ</code> string takes the following form: + The POSIX.1-2017 <code>TZ</code> string takes the following form: </p> <p> @@ -913,8 +919,8 @@ an older <code>zic</code>. <dt><var>date</var>[<code>/</code><var>time</var>]<code>,</code><var>date</var>[<code>/</code><var>time</var>]</dt><dd> specifies the beginning and end of <abbr>DST</abbr>. If this is absent, the system supplies its own ruleset - for <abbr>DST</abbr>, and its rules can differ from year to year; - typically <abbr>US</abbr> <abbr>DST</abbr> rules are used. + for <abbr>DST</abbr>, typically current <abbr>US</abbr> + <abbr>DST</abbr> rules. </dd> <dt><var>time</var></dt><dd> takes the form @@ -949,7 +955,7 @@ an older <code>zic</code>. </dl> <p> - Here is an example POSIX <code>TZ</code> string for New + Here is an example POSIX.1-2017 <code>TZ</code> string for New Zealand after 2007. It says that standard time (<abbr>NZST</abbr>) is 12 hours ahead of <abbr>UT</abbr>, and that daylight saving time @@ -960,7 +966,7 @@ an older <code>zic</code>. <pre><code>TZ='NZST-12NZDT,M9.5.0,M4.1.0/3'</code></pre> <p> - This POSIX <code>TZ</code> string is hard to remember, and + This POSIX.1-2017 <code>TZ</code> string is hard to remember, and mishandles some timestamps before 2008. With this package you can use this instead: </p> @@ -974,10 +980,11 @@ an older <code>zic</code>. Traditionally the current <abbr>US</abbr> <abbr>DST</abbr> rules were used to interpret such values, but this meant that the <abbr>US</abbr> <abbr>DST</abbr> rules were compiled into each - program that did time conversion. This meant that when + time conversion package, and when <abbr>US</abbr> time conversion rules changed (as in the United - States in 1987), all programs that did time conversion had to be - recompiled to ensure proper results. + States in 1987 and again in 2007), all packages that + interpreted <code>TZ</code> values had to be updated + to ensure proper results. </li> <li> The <code>TZ</code> environment variable is process-global, which @@ -997,7 +1004,7 @@ an older <code>zic</code>. limit phone calls to off-peak hours. </li> <li> - POSIX provides no convenient and efficient way to determine + POSIX.1-2017 provides no convenient and efficient way to determine the <abbr>UT</abbr> offset and time zone abbreviation of arbitrary timestamps, particularly for timezones that do not fit into the POSIX model. @@ -1024,19 +1031,19 @@ an older <code>zic</code>. </li> </ul> -<h3 id="POSIX-extensions">Extensions to POSIX in the +<h3 id="POSIX-extensions">Extensions to POSIX.1-2017 in the <code><abbr>tz</abbr></code> code</h3> <ul> <li> <p> The <code>TZ</code> environment variable is used in generating the name of a file from which time-related information is read - (or is interpreted à la POSIX); <code>TZ</code> is no longer + (or is interpreted à la POSIX.1-2017); <code>TZ</code> is no longer constrained to be a string containing abbreviations and numeric data as described <a href="#POSIX">above</a>. The file's format is <dfn><abbr>TZif</abbr></dfn>, a timezone information format that contains binary data; see - <a href="https://tools.ietf.org/html/8536">Internet + <a href="https://datatracker.ietf.org/doc/html/8536">Internet <abbr>RFC</abbr> 8536</a>. The daylight saving time rules to be used for a particular timezone are encoded in the @@ -1064,11 +1071,12 @@ an older <code>zic</code>. </li> <li> The code supports platforms with a <abbr>UT</abbr> offset member - in <code>struct tm</code>, e.g., <code>tm_gmtoff</code>. - </li> - <li> - The code supports platforms with a time zone abbreviation member in - <code>struct tm</code>, e.g., <code>tm_zone</code>. + in <code>struct tm</code>, e.g., <code>tm_gmtoff</code>, + or with a time zone abbreviation member in + <code>struct tm</code>, e.g., <code>tm_zone</code>. As noted + in <a href="https://austingroupbugs.net/view.php?id=1533">Austin + Group defect 1533</a>, a future version of POSIX is planned to + require <code>tm_gmtoff</code> and <code>tm_zone</code>. </li> <li> Functions <code>tzalloc</code>, <code>tzfree</code>, @@ -1129,7 +1137,8 @@ The vestigial <abbr>API</abbr>s are: <abbr>API</abbr>s. Although it can still be used in arguments to <code>mktime</code> to disambiguate timestamps near - a <abbr>DST</abbr> transition when the clock jumps back, this + a <abbr>DST</abbr> transition when the clock jumps back on + platforms lacking <code>tm_gmtoff</code>, this disambiguation does not work when standard time itself jumps back, which can occur when a location changes to a time zone with a lesser <abbr>UT</abbr> offset. @@ -1171,7 +1180,7 @@ The vestigial <abbr>API</abbr>s are: </li> <li> The functions that are conditionally compiled - if <code>STD_INSPIRED</code> is defined should, at this point, be + if <code>STD_INSPIRED</code> is nonzero should, at this point, be looked on primarily as food for thought. They are not in any sense "standard compatible" – some are not, in fact, specified in <em>any</em> standard. @@ -1238,7 +1247,7 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces: Interface changes in a release attempt to preserve compatibility with recent releases. For example, <code><abbr>tz</abbr></code> data files typically do not -rely on recently-added <code>zic</code> features, so that users can +rely on recently added <code>zic</code> features, so that users can run older <code>zic</code> versions to process newer data files. <a href="tz-link.html#download">Downloading the <code><abbr>tz</abbr></code> database</a> describes how releases @@ -1267,6 +1276,18 @@ between now and the future time. <section> <h2 id="leapsec">Leap seconds</h2> <p> +Leap seconds were introduced in 1972 to accommodate the +difference between atomic time and the less regular rotation of the earth. +Unfortunately they caused so many problems with civil +timekeeping that they +are <a href="https://www.bipm.org/en/cgpm-2022/resolution-4">planned +to be discontinued by 2035</a>, with some as-yet-undetermined +mechanism replacing them, perhaps after the year 2135. +Despite their impending obsolescence, a record of leap seconds is still +needed to resolve timestamps from 1972 through 2035. +</p> + +<p> The <code><abbr>tz</abbr></code> code and data can account for leap seconds, thanks to code contributed by Bradley White. However, the leap second support of this package is rarely used directly @@ -1277,15 +1298,15 @@ the operating system kernel clock as described in <a href="tz-link.html#precision">Precision timekeeping</a>, and this package by default installs a <samp>leapseconds</samp> file commonly used by -<a href="http://www.ntp.org"><abbr title="Network Time Protocol">NTP</abbr></a> +<a href="https://www.ntp.org"><abbr title="Network Time Protocol">NTP</abbr></a> software that adjusts the kernel clock. However, kernel-clock twiddling approximates UTC only roughly, -and systems needing more-precise UTC can use this package's leap +and systems needing more precise UTC can use this package's leap second support directly. </p> <p> -The directly-supported mechanism assumes that <code>time_t</code> +The directly supported mechanism assumes that <code>time_t</code> counts of seconds since the POSIX epoch normally include leap seconds, as opposed to POSIX <code>time_t</code> counts which exclude leap seconds. This modified timescale is converted to <abbr>UTC</abbr> @@ -1346,7 +1367,15 @@ They sometimes disagree. </section> <section> - <h2 id="planets">Time and time zones on other planets</h2> + <h2 id="planets">Time and time zones off Earth</h2> +<p> +The European Space Agency is <a +href='https://www.esa.int/Applications/Navigation/Telling_time_on_the_Moon'>considering</a> +the establishment of a reference timescale for the Moon, which has +days roughly equivalent to 29.5 Earth days, and where relativistic +effects cause clocks to tick slightly faster than on Earth. +</p> + <p> Some people's work schedules have used <a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>. |