diff options
author | Stuart Bishop <stuart@stuartbishop.net> | 2022-10-02 15:50:54 +1100 |
---|---|---|
committer | Stuart Bishop <stuart@stuartbishop.net> | 2022-10-02 15:50:54 +1100 |
commit | 8eeefc360913ce56f8759c33b31e00542a0d3078 (patch) | |
tree | db6cab6439dfaafd597bb8dfb12048408272a6dc | |
parent | 301a880b1dd96605a98374576b0e210994a69f2d (diff) | |
download | pytz-git-8eeefc360913ce56f8759c33b31e00542a0d3078.tar.gz |
Squashed 'tz/' changes from b61a7acb4..82693eb52
0fc8f915a Release 2022d
43d32e3a6 tzselect.ksh: mention nawk (the one true awk)
2d49828e3 * asia: Add Palestine URL (thanks to Heba Hamad).
1a0e30a84 Tweak expression of Palestine transition
b6e732290 Fix NEWS typo in previous change
c42d108da Palestine transitions are now Saturdays at 02:00
92e33b2fb backzone: Uzhhorod comment fix (thanks to Garrett Wollman)
d25f00b73 * europe: Comment fix (thanks to Philip Paeps).
2ea205765 Fix commentary in previous change
4dffd914c Simplify three Ukraine zones to one
54e8becfa Additional sourcing for Crimea 2014 switch
a339d366d * southamerica: Add decree (thanks to Eduardo Romero Urra).
aca1a7057 Fix some post-1970 PACKRATLIST glitches
ce4d77644 Release 2022c
747f4a0e1 Spelling/capitalization fixes
4307b3a9d Update some documentation and commentary
aa7019f99 Prefer " to ' in HTML attributes
c9ba895d3 Remove zoneinfo2tdf.pl
e5f99199f Improve tzselect behavior for Turkey etc.
0b9b27e60 Fix bug with 'zic -d /a/b/c' if /a is unwriteable
d7f86ac32 Port .txt generation to macOS
e8171130f Work around macOS awk bug
git-subtree-dir: tz
git-subtree-split: 82693eb525a29a10ec95e9fddf31cb683b124d32
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | NEWS | 47 | ||||
-rw-r--r-- | asia | 34 | ||||
-rw-r--r-- | backward | 2 | ||||
-rw-r--r-- | backzone | 58 | ||||
-rw-r--r-- | europe | 58 | ||||
-rw-r--r-- | newctime.3 | 5 | ||||
-rw-r--r-- | private.h | 3 | ||||
-rw-r--r-- | southamerica | 10 | ||||
-rw-r--r-- | theory.html | 26 | ||||
-rw-r--r-- | time2posix.3 | 2 | ||||
-rw-r--r-- | tz-art.html | 30 | ||||
-rw-r--r-- | tz-link.html | 85 | ||||
-rw-r--r-- | tzfile.5 | 2 | ||||
-rw-r--r-- | tzselect.8 | 6 | ||||
-rw-r--r-- | tzselect.ksh | 55 | ||||
-rw-r--r-- | workman.sh | 18 | ||||
-rw-r--r-- | zic.8 | 6 | ||||
-rw-r--r-- | zic.c | 9 | ||||
-rw-r--r-- | ziguard.awk | 37 | ||||
-rw-r--r-- | zone.tab | 2 | ||||
-rw-r--r-- | zone1970.tab | 26 | ||||
-rwxr-xr-x | zoneinfo2tdf.pl | 53 |
23 files changed, 341 insertions, 242 deletions
@@ -298,8 +298,9 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. # Similarly, if your system has a "zone abbreviation" field, define # -DTM_ZONE=tm_zone -# and define NO_TM_ZONE to suppress any guessing. These two fields are not -# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# and define NO_TM_ZONE to suppress any guessing. Although these two fields +# not required by POSIX, a future version of POSIX is planned to require them +# and they are widely available on GNU/Linux and BSD systems. # # The next batch of options control support for external variables # exported by tzcode. In practice these variables are less useful @@ -538,7 +539,7 @@ DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ leapseconds $(ZONETABLES) AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ ziguard.awk zishrink.awk -MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +MISC= $(AWK_SCRIPTS) TZS_YEAR= 2050 TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs @@ -567,7 +568,7 @@ VERSION_DEPS= \ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ workman.sh zdump.8 zdump.c zic.8 zic.c \ ziguard.awk zishrink.awk \ - zone.tab zone1970.tab zoneinfo2tdf.pl + zone.tab zone1970.tab # And for the benefit of csh users on systems that assume the user # shell should be used to handle commands in Makefiles. . . @@ -1,5 +1,50 @@ News for the tz database +Release 2022d - 2022-09-23 12:02:57 -0700 + + Briefly: + Palestine transitions are now Saturdays at 02:00. + Simplify three Ukraine zones into one. + + Changes to future timestamps + + Palestine now springs forward and falls back at 02:00 on the + first Saturday on or after March 24 and October 24, respectively. + This means 2022 falls back 10-29 at 02:00, not 10-28 at 01:00. + (Thanks to Heba Hamad.) + + Changes to past timestamps + + Simplify three Ukraine zones to one, since the post-1970 + differences seem to have been imaginary. Move Europe/Uzhgorod and + Europe/Zaporozhye to 'backzone'; backward-compatibility links + still work, albeit with different timestamps before October 1991. + + +Release 2022c - 2022-08-15 17:47:18 -0700 + + Briefly: + Work around awk bug in FreeBSD, macOS, etc. + Improve tzselect on intercontinental Zones. + + Changes to code + + Work around a bug in onetrueawk that broke commands like + 'make traditional_tarballs' on FreeBSD, macOS, etc. + (Problem reported by Deborah Goldsmith.) + + Add code to tzselect that uses experimental structured comments in + zone1970.tab to clarify whether Zones like Africa/Abidjan and + Europe/Istanbul cross continent or ocean boundaries. + (Inspired by a problem reported by Peter Krefting.) + + Fix bug with 'zic -d /a/b/c' when /a is unwritable but the + directory /a/b already exists. + + Remove zoneinfo2tdf.pl, as it was unused and triggered false + malware alarms on some email servers. + + Release 2022b - 2022-08-10 15:38:32 -0700 Briefly: @@ -83,7 +128,7 @@ Release 2022b - 2022-08-10 15:38:32 -0700 zic no longer complains "can't determine time zone abbreviation to use just after until time" when a transition to a new standard - time occurs simultanously with the first DST fallback transition. + time occurs simultaneously with the first DST fallback transition. Changes to build procedure @@ -1505,8 +1505,8 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # onwards (which was during the Islamic Republic). # From Francis Santoni (2022-06-01): -# for Iran and 1977 the effective change is only 20 october -# (UIT No. 143 17.XI.1977) and not 23 september (UIT No. 141 13.IX.1977). +# for Iran and 1977 the effective change is only 20 October +# (UIT No. 143 17.XI.1977) and not 23 September (UIT No. 141 13.IX.1977). # UIT is the Operational Bulletin of International Telecommunication Union. # From Roozbeh Pournader (2003-03-15): @@ -3375,10 +3375,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # The winter time in 2015 started on October 23 at 01:00. # https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY # http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 -# -# From Paul Eggert (2019-04-10): -# For now, guess spring-ahead transitions are at 00:00 on the Saturday -# preceding March's last Sunday (i.e., Sat>=24). # From P Chan (2021-10-18): # http://wafa.ps/Pages/Details/34701 @@ -3395,6 +3391,18 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Heba Hamad (2022-03-10): # summer time will begin in Palestine from Sunday 03-27-2022, 00:00 AM. +# From Heba Hamad (2022-08-30): +# winter time will begin in Palestine from Saturday 10-29, 02:00 AM by +# 60 minutes backwards. Also the state of Palestine adopted the summer +# and winter time for the years: 2023,2024,2025,2026 ... +# https://mm.icann.org/pipermail/tz/attachments/20220830/9f024566/Time-0001.pdf +# (2022-08-31): ... the Saturday before the last Sunday in March and October +# at 2:00 AM ,for the years from 2023 to 2026. +# (2022-09-05): https://mtit.pna.ps/Site/New/1453 +# +# From Paul Eggert (2022-08-31): +# For now, assume that this rule will also be used after 2026. + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3425,14 +3433,16 @@ Rule Palestine 2013 only - Sep 27 0:00 0 - Rule Palestine 2014 only - Oct 24 0:00 0 - Rule Palestine 2015 only - Mar 28 0:00 1:00 S Rule Palestine 2015 only - Oct 23 1:00 0 - -Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2016 2018 - Mar Sat<=30 1:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat<=30 1:00 0 - Rule Palestine 2019 only - Mar 29 0:00 1:00 S -Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - -Rule Palestine 2020 2021 - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat<=30 0:00 0 - +Rule Palestine 2020 2021 - Mar Sat<=30 0:00 1:00 S Rule Palestine 2020 only - Oct 24 1:00 0 - -Rule Palestine 2021 max - Oct Fri>=23 1:00 0 - -Rule Palestine 2022 max - Mar Sun>=25 0:00 1:00 S +Rule Palestine 2021 only - Oct 29 1:00 0 - +Rule Palestine 2022 only - Mar 27 0:00 1:00 S +Rule Palestine 2022 max - Oct Sat<=30 2:00 0 - +Rule Palestine 2023 max - Mar Sat<=30 2:00 1:00 S # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -90,6 +90,8 @@ Link Etc/UTC Etc/UCT Link Europe/London Europe/Belfast Link Europe/Kyiv Europe/Kiev Link Europe/Chisinau Europe/Tiraspol +Link Europe/Kyiv Europe/Uzhgorod +Link Europe/Kyiv Europe/Zaporozhye Link Europe/London GB Link Europe/London GB-Eire Link Etc/GMT GMT+0 @@ -301,7 +301,7 @@ Zone Africa/Freetown -0:53:00 - LMT 1882 -0:53:00 - FMT 1913 Jul 1 # Freetown MT -1:00 SL %s 1939 Sep 5 -1:00 - -01 1941 Dec 6 24:00 - 0:00 SL GMT/+01 + 0:00 - GMT # Botswana # From Paul Eggert (2013-02-21): @@ -1480,6 +1480,27 @@ Zone Europe/Tiraspol 1:58:32 - LMT 1880 2:00 Russia EE%sT 1992 Jan 19 2:00 3:00 Russia MSK/MSD +# Ukraine +# +# Although Shanks & Pottenger say Transcarpathia used CET 1990/1991, +# this unreliable source contradicts contemporaneous government resolutions +# (see the commentary for Ukraine in the 'europe' file) +# so for now this dubious zone is in 'backzone'. +# "Uzhhorod" is the transliteration of the Ukrainian spelling, but +# "Uzhgorod" was a common English spelling when this dubious zone was +# added to TZDB in 1999. +Zone Europe/Uzhgorod 1:29:12 - LMT 1890 Oct + 1:00 - CET 1940 + 1:00 C-Eur CE%sT 1944 Oct + 1:00 1:00 CEST 1944 Oct 26 + 1:00 - CET 1945 Jun 29 + 3:00 Russia MSK/MSD 1990 + 3:00 - MSK 1990 Jul 1 2:00 + 1:00 - CET 1991 Mar 31 3:00 + 2:00 - EET 1992 Mar 20 + 2:00 C-Eur EE%sT 1996 May 13 + 2:00 EU EE%sT + # Liechtenstein # From Paul Eggert (2022-07-21): @@ -1502,6 +1523,25 @@ Zone Europe/Zagreb 1:03:52 - LMT 1884 1:00 - CET 1982 Nov 27 1:00 EU CE%sT +# Ukraine + +# Although Shanks & Pottenger say Zaporizhzhia and eastern Lugansk +# observed DST 1990/1991, this unreliable source contradicts contemporaneous +# government resolutions (see the commentary for Ukraine in the 'europe' file) +# so for now this dubious zone is in 'backzone'. +# "Zaporizhzhia" is the transliteration of the Ukrainian name, but +# "Zaporozhye" was a common English spelling when this dubious zone was +# added to TZDB in 1999. +Zone Europe/Zaporozhye 2:20:40 - LMT 1880 + 2:20 - +0220 1924 May 2 + 2:00 - EET 1930 Jun 21 + 3:00 - MSK 1941 Aug 25 + 1:00 C-Eur CE%sT 1943 Oct 25 + 3:00 Russia MSK/MSD 1991 Mar 31 2:00 + 2:00 E-Eur EE%sT 1992 Mar 20 + 2:00 C-Eur EE%sT 1996 May 13 + 2:00 EU EE%sT + # Madagascar Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul 3:00 - EAT 1954 Feb 27 23:00s @@ -1633,7 +1673,7 @@ Zone Pacific/Majuro 11:24:48 - LMT 1901 Zone Pacific/Midway -11:49:28 - LMT 1901 -11:00 - -11 1956 Jun 3 -11:00 1:00 -10 1956 Sep 2 - -11:00 - -11 + -11:00 - SST # S=Samoa # Micronesia # Also see Pacific/Chuuk and commentary for Micronesia in 'australasia'. @@ -1648,10 +1688,20 @@ Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia Link Pacific/Pohnpei Pacific/Ponape # N Mariana Is +# +# From Paul Eggert (2022-08-16): +# Although Shanks & Pottenger say Saipan used +09 and then switched +# to Guam time in October 1969, this is surely wrong. +# Saipan used Guam time in the late 1950s; see page 4 of the minutes on the +# conference of the 12th Saipan Legislature and the Select Committee on +# Saipan Mission, 5th Guam Legislature (1959-09-11): +# http://www.nmhcouncil.org/nmhc_archives/U.S.%20Navy%20Civil%20Affairs%20Files%201944-1962/1959/1959%2009%2017%20letter,%20minutes%20of%20conference,%20Borja.pdf +# For now, assume Saipan switched to Guam time after the Battle of Saipan. +# Zone Pacific/Saipan -14:17:00 - LMT 1844 Dec 31 9:43:00 - LMT 1901 - 9:00 - +09 1969 Oct - 10:00 - +10 2000 Dec 23 + 9:00 - +09 1944 Jul 9 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time @@ -2615,10 +2615,14 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 # From Alexander Krivenyshev (2014-03-17): # time change at 2:00 (2am) on March 30, 2014 # https://vz.ru/news/2014/3/17/677464.html -# From Paul Eggert (2014-03-30): -# Simferopol and Sevastopol reportedly changed their central town clocks -# late the previous day, but this appears to have been ceremonial -# and the discrepancies are small enough to not worry about. +# From Tim Parenti (2022-07-01), per Paul Eggert (2014-03-30): +# The clocks at the railway station in Simferopol were put forward from 22:00 +# to 24:00 the previous day in a "symbolic ceremony"; however, per +# contemporaneous news reports, "ordinary Crimeans [made] the daylight savings +# time switch at 2am" on Sunday. +# https://www.business-standard.com/article/pti-stories/crimea-to-set-clocks-to-russia-time-114033000014_1.html +# https://www.reuters.com/article/us-ukraine-crisis-crimea-time/crimea-switches-to-moscow-time-amid-incorporation-frenzy-idUKBREA2S0LT20140329 +# https://www.bbc.com/news/av/world-europe-26806583 2:00 EU EE%sT 2014 Mar 30 2:00 4:00 - MSK 2014 Oct 26 2:00s 3:00 - MSK @@ -3751,8 +3755,8 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. # US colleague David Cochrane) are still trying to get more # information upon these local deviations from Kiev rules. # -# From Paul Eggert (2022-02-08): -# For now, assume that Ukraine's other three zones followed the same rules, +# From Paul Eggert (2022-08-27): +# For now, assume that Ukraine's zones all followed the same rules, # except that Crimea switched to Moscow time in 1994 as described elsewhere. # From Igor Karpov, who works for the Ukrainian Ministry of Justice, @@ -3822,21 +3826,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. # * Ukrainian Government's Resolution of 20.03.1992, No. 139. # http://www.uazakon.com/documents/date_8u/pg_grcasa.htm -# From Paul Eggert (2022-04-12): -# As is usual in tzdb, Ukrainian zones use the most common English spellings. -# In particular, tzdb's name Europe/Kyiv uses the most common spelling in -# English for Ukraine's capital. Although tzdb's former name was Europe/Kiev, -# "Kyiv" is now more common due to widespread reporting of the current conflict. -# Conversely, tzdb continues to use the names Europe/Uzhgorod and -# Europe/Zaporozhye; this is similar to tzdb's use of Europe/Prague, which is -# certainly wrong as a transliteration of the Czech "Praha". -# English-language spelling of Ukrainian names is in flux, and -# some day "Uzhhorod" or "Zaporizhzhia" may become substantially more -# common in English; in the meantime, do not change these -# English spellings as that means less disruption for our users. - # Zone NAME STDOFF RULES FORMAT [UNTIL] -# This represents most of Ukraine. See above for the spelling of "Kyiv". Zone Europe/Kyiv 2:02:04 - LMT 1880 2:02:04 - KMT 1924 May 2 # Kyiv Mean Time 2:00 - EET 1930 Jun 21 @@ -3846,34 +3836,6 @@ Zone Europe/Kyiv 2:02:04 - LMT 1880 2:00 1:00 EEST 1991 Sep 29 3:00 2:00 C-Eur EE%sT 1996 May 13 2:00 EU EE%sT -# Transcarpathia used CET 1990/1991. -# "Uzhhorod" is the transliteration of the Rusyn/Ukrainian pronunciation, but -# "Uzhgorod" is more common in English. -Zone Europe/Uzhgorod 1:29:12 - LMT 1890 Oct - 1:00 - CET 1940 - 1:00 C-Eur CE%sT 1944 Oct - 1:00 1:00 CEST 1944 Oct 26 - 1:00 - CET 1945 Jun 29 - 3:00 Russia MSK/MSD 1990 - 3:00 - MSK 1990 Jul 1 2:00 - 1:00 - CET 1991 Mar 31 3:00 - 2:00 - EET 1992 Mar 20 - 2:00 C-Eur EE%sT 1996 May 13 - 2:00 EU EE%sT -# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991. -# "Zaporizhzhia" is the transliteration of the Ukrainian name, but -# "Zaporozh'ye" is more common in English. Use the common English -# spelling, except omit the apostrophe as it is not allowed in -# portable Posix file names. -Zone Europe/Zaporozhye 2:20:40 - LMT 1880 - 2:20 - +0220 1924 May 2 - 2:00 - EET 1930 Jun 21 - 3:00 - MSK 1941 Aug 25 - 1:00 C-Eur CE%sT 1943 Oct 25 - 3:00 Russia MSK/MSD 1991 Mar 31 2:00 - 2:00 E-Eur EE%sT 1992 Mar 20 - 2:00 C-Eur EE%sT 1996 May 13 - 2:00 EU EE%sT # Vatican City # See Europe/Rome. @@ -271,8 +271,9 @@ so were made when the library containing these functions was created. Similarly, the .B tzname -variable is optional. -There is no guarantee that these fields and this variable will +variable is optional; also, there is no guarantee that +.B tzname +will continue to exist in this form in future releases of this code. .SH FILES .ta \w'/usr/share/zoneinfo/posixrules\0\0'u @@ -168,6 +168,9 @@ # define EINVAL ERANGE #endif +#ifndef ELOOP +# define ELOOP EINVAL +#endif #ifndef ENAMETOOLONG # define ENAMETOOLONG EINVAL #endif diff --git a/southamerica b/southamerica index 2f2c873..2f51004 100644 --- a/southamerica +++ b/southamerica @@ -1309,8 +1309,14 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # for America/Santiago will start on midnight of September 11th; # and will end on April 1st, 2023. Magallanes region (America/Punta_Arenas) # will keep UTC -3 "indefinitely"... This is because on September 4th -# we will have a voting whether to approve a new Constitution.... -# https://www.interior.gob.cl/noticias/2022/08/09/comunicado-el-proximo-sabado-10-de-septiembre-los-relojes-se-deben-adelantar-una-hora/ +# we will have a voting whether to approve a new Constitution. +# +# From Eduardo Romero Urra (2022-08-17): +# https://www.diariooficial.interior.gob.cl/publicaciones/2022/08/13/43327/01/2172567.pdf +# +# From Paul Eggert (2022-08-17): +# Although the presidential decree stops at fall 2026, assume that +# similar DST rules will continue thereafter. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Chile 1927 1931 - Sep 1 0:00 1:00 - diff --git a/theory.html b/theory.html index 2b14c51..56390ae 100644 --- a/theory.html +++ b/theory.html @@ -122,7 +122,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 "布拉格". @@ -571,7 +571,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 +624,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 @@ -810,7 +810,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>. @@ -1036,7 +1036,7 @@ an older <code>zic</code>. 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 +1064,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 +1130,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. @@ -1277,7 +1279,7 @@ 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 diff --git a/time2posix.3 b/time2posix.3 index 2ea7edc..1fcdf9e 100644 --- a/time2posix.3 +++ b/time2posix.3 @@ -37,7 +37,7 @@ however, no such adjustment is needed and time_t values continue to increase over leap events (as a true -.q "seconds since..." +.q "seconds since...\&" value). This means that these values will differ from those required by POSIX by the net number of leap seconds inserted since the Epoch. diff --git a/tz-art.html b/tz-art.html index 73be9f9..5679534 100644 --- a/tz-art.html +++ b/tz-art.html @@ -483,19 +483,19 @@ Supernaw.</td></tr> <ul> <li> The webcomic <em>xkcd</em> has the strip -"<a href='https://xkcd.com/673/'>The Sun</a>" (2009-12-09) and the panels -"<a href='https://xkcd.com/1017/'>Backward in Time</a>" (2012-02-14), -"<a href='https://xkcd.com/1061/'>EST</a>" (2012-05-28), -"<a href='https://xkcd.com/1179/'>ISO 8601</a>" (2013-02-27), -"<a href='https://xkcd.com/1335/'>Now</a>" (2014-02-26), -"<a href='https://xkcd.com/1655/'>Doomsday Clock</a>" (2016-03-14), -"<a href='https://xkcd.com/1799/'>Bad Map Projection: Time Zones</a>" +"<a href="https://xkcd.com/673/">The Sun</a>" (2009-12-09) and the panels +"<a href="https://xkcd.com/1017/">Backward in Time</a>" (2012-02-14), +"<a href="https://xkcd.com/1061/">EST</a>" (2012-05-28), +"<a href="https://xkcd.com/1179/">ISO 8601</a>" (2013-02-27), +"<a href="https://xkcd.com/1335/">Now</a>" (2014-02-26), +"<a href="https://xkcd.com/1655/">Doomsday Clock</a>" (2016-03-14), +"<a href="https://xkcd.com/1799/">Bad Map Projection: Time Zones</a>" (2017-02-15), -"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30), -"<a href='https://xkcd.com/2050/'>6/6 Time</a>" (2018-09-24), -and "<a href='https://xkcd.com/2266/'>Leap Smearing</a>" (2020-02-10). +"<a href="https://xkcd.com/1883/">Supervillain Plan</a>" (2017-08-30), +"<a href="https://xkcd.com/2050/">6/6 Time</a>" (2018-09-24), +and "<a href="https://xkcd.com/2266/">Leap Smearing</a>" (2020-02-10). The related book <em>What If?</em> has an entry -"<a href='https://what-if.xkcd.com/26/'>Leap Seconds</a>" (2012-12-31). +"<a href="https://what-if.xkcd.com/26/">Leap Seconds</a>" (2012-12-31). </li> <li> Pig kills time in <a @@ -504,11 +504,11 @@ Before Swine</em> (2016-11-06)</a>. </li> <li> Stonehenge is abandoned in <a -href='https://www.gocomics.com/nonsequitur/2017/03/12'><em>Non Sequitur</em> +href="https://www.gocomics.com/nonsequitur/2017/03/12"><em>Non Sequitur</em> (2017-03-12)</a>. <li> The boss freaks out in <a -href='https://dilbert.com/strip/1998-03-14'><em>Dilbert</em> (1998-03-14)</a>. +href="https://dilbert.com/strip/1998-03-14"><em>Dilbert</em> (1998-03-14)</a>. </li> <li> Peppermint Patty: "What if the world comes to an end tonight, Marcie?" @@ -516,7 +516,7 @@ Peppermint Patty: "What if the world comes to an end tonight, Marcie?" Marcie: "I promise there'll be a tomorrow, sir ... in fact, it's already tomorrow in Australia!" <br> -(Charles M. Schulz, <a href='https://www.gocomics.com/peanuts/1980/06/13'><em>Peanuts</em>, 1980-06-13</a>) +(Charles M. Schulz, <a href="https://www.gocomics.com/peanuts/1980/06/13"><em>Peanuts</em>, 1980-06-13</a>) </li> </ul> <h2>Jokes</h2> @@ -621,7 +621,7 @@ but maybe in your time zone I haven't finished yet. So stay tuned!" </ul> <h2>See also</h2> <ul> -<li><a href="tz-link.html">Sources for Time Zone and Daylight Saving +<li><a href="tz-link.html">Time Zone and Daylight Saving Time Data</a></li> </ul> <hr> diff --git a/tz-link.html b/tz-link.html index 2532069..d3b3766 100644 --- a/tz-link.html +++ b/tz-link.html @@ -1,14 +1,14 @@ <!DOCTYPE html> <html lang="en"> <head> -<title>Sources for time zone and daylight saving time data</title> +<title>Time zone and daylight saving time data</title> <meta charset="UTF-8"> <style> pre {margin-left: 2em; white-space: pre-wrap;} </style> </head> <body> -<h1>Sources for time zone and daylight saving time data</h1> +<h1>Time zone and daylight saving time data</h1> <p> <a href="https://en.wikipedia.org/wiki/Time_zone">Time zone</a> and <a href="https://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a> @@ -52,9 +52,9 @@ area. <li><a href="#costs">Costs and benefits of time shifts</a></li> <li><a href="#precision">Precision timekeeping</a></li> <li><a href="#notation">Time notation</a></li> - <li><a href="#see-also">See also</a></li> </ul> </li> + <li><a href="#see-also">See also</a></li> </ul> </nav> @@ -80,7 +80,7 @@ C Library</a> (used in title="Berkeley Software Distribution">BSD</abbr></a>, <a href="https://netbsd.org">Net<abbr>BSD</abbr></a>, <a href="https://www.openbsd.org">Open<abbr>BSD</abbr></a>, -<a href="https://www.chromium.org/chromium-os">Chromium OS</a>, +<a href="https://www.chromium.org/chromium-os/">Chromium OS</a>, <a href="https://cygwin.com">Cygwin</a>, <a href="https://mariadb.org">MariaDB</a>, <a href="https://en.wikipedia.org/wiki/MINIX">MINIX</a>, @@ -166,7 +166,7 @@ Since 1996, each version has been a four-digit year followed by lower-case letter (<samp>a</samp> through <samp>z</samp>, then <samp>za</samp> through <samp>zz</samp>, then <samp>zza</samp> through <samp>zzz</samp>, and so on). -Since version 1999g, each release has been distributed in +Since version 2022a, each release has been distributed in <a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06">POSIX ustar interchange format</a>, compressed as described above; older releases use a nearly-compatible format. @@ -192,7 +192,7 @@ After obtaining the code and data files, see the The code lets you compile the <code><abbr>tz</abbr></code> source files into machine-readable binary files, one for each location. The binary files are in a special timezone information format (<dfn><abbr>TZif</abbr></dfn>) -specified by <a href="https://tools.ietf.org/html/8536">Internet +specified by <a href="https://datatracker.ietf.org/doc/html/8536">Internet <abbr>RFC</abbr> 8536</a>. The code also lets you read a <abbr>TZif</abbr> file and interpret timestamps for that @@ -276,7 +276,7 @@ Studio Code</a>. </p> <p> For further information about updates, please see -<a href="https://tools.ietf.org/html/rfc6557">Procedures for +<a href="https://datatracker.ietf.org/doc/html/rfc6557">Procedures for Maintaining the Time Zone Database</a> (Internet <abbr title="Request For Comments">RFC</abbr> 6557). More detail can be found in <a href="theory.html">Theory and pragmatics of the @@ -327,10 +327,8 @@ title="Structured Query Language">SQL</abbr></a> form.</li> href="https://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a> lets you see the <code><abbr>TZ</abbr></code> values directly.</li> <li><a -href="http://www.convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current +href="https://www.convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current Time in 1000 Places</a> uses descriptions of the values.</li> -<li><a href="https://timezoneconverterapp.com/">Time Zone Converter</a> -uses a pulldown menu.</li> <li><a href="https://home.kpn.nl/vanadovv/time/TZworld.html">Complete timezone information for all countries</a> displays tables of <abbr>DST</abbr> rules. @@ -340,8 +338,8 @@ Worldwide</a> lets you sort zone names and convert times.</li> time map and a time converter.</li> <li><a href="https://www.zeitverschiebung.net/en/">Time Difference</a> calculates the current time difference between locations.</li> -<li><a href="http://www.wx-now.com">Weather Now</a> and -<a href="http://www.thetimenow.com">The Time Now</a> list the weather too.</li> +<li><a href="https://www.wx-now.com">Weather Now</a> and +<a href="https://www.thetimenow.com">The Time Now</a> list the weather too.</li> </ul> </section> @@ -351,26 +349,26 @@ calculates the current time difference between locations.</li> <li>The <a href="https://www.ietf.org">Internet Engineering Task Force</a>'s <a href="https://datatracker.ietf.org/wg/tzdist/charter/">Time Zone Data Distribution Service (tzdist) working group</a> defined <a -href="https://tools.ietf.org/html/rfc7808">TZDIST</a> +href="https://datatracker.ietf.org/doc/html/rfc7808">TZDIST</a> (Internet <abbr>RFC</abbr> 7808), a time zone data distribution service, -along with <a href="https://tools.ietf.org/html/rfc7809">CalDAV</a> +along with <a href="https://datatracker.ietf.org/doc/html/rfc7809">CalDAV</a> (Internet <abbr>RFC</abbr> 7809), a calendar access protocol for transferring time zone data by reference. <a href="https://devguide.calconnect.org/Time-Zones/TZDS/">TZDIST implementations</a> are available. The <a href="https://www.ietf.org/mailman/listinfo/tzdist-bis">tzdist-bis mailing list</a> discusses possible extensions.</li> -<li>The <a href="https://tools.ietf.org/html/rfc5545"> +<li>The <a href="https://datatracker.ietf.org/doc/html/rfc5545"> Internet Calendaring and Scheduling Core Object Specification (iCalendar)</a> (Internet <abbr>RFC</abbr> 5445) covers time zone data; see its VTIMEZONE calendar component. The iCalendar format requires specialized parsers and generators; a -variant <a href="https://tools.ietf.org/html/rfc6321">xCal</a> +variant <a href="https://datatracker.ietf.org/doc/html/rfc6321">xCal</a> (Internet <abbr>RFC</abbr> 6321) uses <a href="https://www.w3.org/XML/"><abbr title="Extensible Markup Language">XML</abbr></a> format, and a variant -<a href="https://tools.ietf.org/html/rfc7265">jCal</a> +<a href="https://datatracker.ietf.org/doc/html/rfc7265">jCal</a> (Internet <abbr>RFC</abbr> 7265) uses <a href="https://www.json.org"><abbr title="JavaScript Object Notation">JSON</abbr></a> format.</li> @@ -413,13 +411,13 @@ transition in the <code><abbr>tz</abbr></code> database.</li> Database Parser</a> is a <a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a> parser and runtime library with <a -href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html">API</a> +href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html">API</a> adopted by <a href="https://en.wikipedia.org/wiki/C++20">C++20</a>, the current iteration of the C++ standard. It is freely available under the <abbr title="Massachusetts Institute of Technology">MIT</abbr> license.</li> -<li><a id="ICU" href="http://site.icu-project.org">International Components for +<li><a id="ICU" href="https://icu.unicode.org">International Components for Unicode (<abbr>ICU</abbr>)</a> contains C/C++ and <a href="https://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a> libraries for internationalization that @@ -549,7 +547,7 @@ Ruby Timezone Library</a> compiles <code><abbr>tz</abbr></code> source into <a href="https://www.ruby-lang.org/en/">Ruby</a>. It is freely available under the <abbr>MIT</abbr> license.</li> -<li>The <a href="http://www.squeaksource.com/Chronos/">Chronos Date/Time +<li>The <a href="https://www.squeaksource.com/Chronos/">Chronos Date/Time Library</a> is a <a href="https://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> class library that compiles <code><abbr>tz</abbr></code> source into a time @@ -798,7 +796,7 @@ political subdivision data related to time zones.</li> <li><a href="https://home.kpn.nl/vanadovv/time/Multizones.html">Time zone boundaries for multizone countries</a> summarizes legal boundaries between time zones within countries.</li> -<li><a href="http://manifold.net/info/freestuff.shtml">Manifold Software +<li><a href="https://manifold.net/info/freestuff.shtml">Manifold Software – GIS and Database Tools</a> includes a Manifold-format map of world time zone boundaries distributed under the <abbr>GPL</abbr>.</li> @@ -895,7 +893,7 @@ hreflang="he">announcements (in Hebrew)</a>.</dd> <dt>Mexico</dt> <dd>The Investigation and Analysis Service of the Mexican Library of Congress has published a <a -href="http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm" +href="https://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm" hreflang="es">history of Mexican local time (in Spanish)</a>.</dd> <dt>Netherlands</dt> <dd><a href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm" @@ -926,7 +924,7 @@ Time Zone Proceedings</a> lists changes to time zone boundaries.</dd> <dt>Uruguay</dt> <dd>The Oceanography, Hydrography, and Meteorology Service of the Uruguayan Navy (SOHMA) publishes an annual <a -href="http://sohma.armada.mil.uy/index.php/servicios/datos-astronomicos" hreflang="es">almanac +href="https://sohma.armada.mil.uy/index.php/servicios/datos-astronomicos" hreflang="es">almanac (in Spanish)</a>.</dd> </dl> </section> @@ -947,9 +945,9 @@ This reviews research literature and concludes that the evidence neither supports nor refutes road safety benefits from shifts in time zones.</li> <li>Havranek T, Herman D, Irsova D. -<a href="https://www.econstor.eu/handle/10419/174191">Does daylight -saving save electricity? A meta-analysis</a>. <em>Energy J.</em> -2018;39(2). +<a href="https://www.iaee.org/en/publications/ejarticle.aspx?id=3051">Does +daylight saving save electricity? A meta-analysis.</a> +<em>Energy J.</em> 2018;39(2):35–61. doi:<a href="https://doi.org/10.5547/01956574.39.2.thav">10.5547/01956574.39.2.thav</a>. This analyzes research literature and concludes, "Electricity savings are larger for countries farther away from the equator, while @@ -961,16 +959,14 @@ an American Academy of Sleep Medicine position statement</a>. 2020;<a href="https://doi.org/10.5664/jcsm.8780">10.5664/jcsm.8780</a>. This argues for permanent standard time due to health risks of both <abbr>DST</abbr> transitions and permanent <abbr>DST</abbr>.</li> -<li>Roenneberg T, Winnebeck EC, Klerman EB. -<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6692659/">Daylight -saving time and artificial time zones – a battle between -biological and social times</a>. <em>Front Physiol.</em> 2019;10:944. -doi:<a href="https://doi.org/10.3389/fphys.2019.00944">10.3389/fphys.2019.00944</a>. -This reviews evidence about the health effects of <abbr>DST</abbr> -and concludes, -"In summary, the scientific literature strongly argues against the -switching between <abbr>DST</abbr> and Standard Time and even more so against -adopting <abbr>DST</abbr> permanently."</li> +<li>Roenneberg T, Wirz-Justice A, Skene DJ <em>et al</em>. +<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7205184/">Why +should we abolish Daylight Saving Time?</a> +<em>J Biol Rhythms</em>. 2019;34(3):227–230. +doi:<a href="https://doi.org/10.1177/0748730419854197">10.1177/0748730419854197</a>. +This position paper of the Society for Research on Biological Rhythms +opposes DST changes and permanent DST, and advocates that governments adopt +"permanent Standard Time for the health and safety of their citizens".</li> </ul> </section> @@ -983,7 +979,7 @@ Science of Timekeeping</a> is a thorough introduction to the theory and practice of precision timekeeping.</li> <li><a href="https://doi.org/10.1007/978-3-319-59909-0">The Science of Time 2016</a> contains several freely-readable papers.</li> -<li><a href="http://www.ntp.org"><abbr +<li><a href="https://www.ntp.org"><abbr title="Network Time Protocol">NTP</abbr>: The Network Time Protocol</a> (Internet <abbr>RFC</abbr> 5905) discusses how to synchronize clocks of @@ -998,7 +994,7 @@ title="Institute of Electrical and Electronics Engineers">IEEE</abbr> 1588) can achieve submicrosecond clock accuracy on a local area network with special-purpose hardware.</li> <li><a -href="https://tools.ietf.org/html/rfc4833">Timezone +href="https://datatracker.ietf.org/doc/html/rfc4833">Timezone Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a> (Internet <abbr>RFC</abbr> 4833) specifies a <a @@ -1012,14 +1008,15 @@ Scales</a> describes astronomical time scales like <abbr title="Barycentric Dynamic Time">TDB</abbr>. <li>The <a href="https://www.iau.org"><abbr title="International Astronomical Union">IAU</abbr></a>'s <a -href="http://www.iausofa.org"><abbr +href="https://www.iausofa.org"><abbr title="Standards Of Fundamental Astronomy">SOFA</abbr></a> collection contains C and <a href="https://en.wikipedia.org/wiki/Fortran">Fortran</a> code for converting among time scales like <abbr title="International Atomic Time">TAI</abbr>, <abbr>TDB</abbr>, <abbr>TDT</abbr> and -<abbr>UTC</abbr>.</li> +<abbr>UTC</abbr>. It is freely available under the +<a href="https://www.iausofa.org/tandc.html">SOFA license</a>.</li> <li><a href="https://www.giss.nasa.gov/tools/mars24/help/notes.html">Mars24 Sunclock – Time on Mars</a> describes Airy Mean Time (<abbr>AMT</abbr>) and the @@ -1065,7 +1062,7 @@ the <abbr>NTP</abbr> reference implementation, <a href="https://github.com/google/unsmear">supports</a> conversion between <abbr>UTC</abbr> and smeared <abbr>POSIX</abbr> timestamps, and is used by major cloud service providers. However, according to -<a href="https://tools.ietf.org/html/rfc8633#section-3.7.1">§3.7.1 of +<a href="https://datatracker.ietf.org/doc/html/rfc8633#section-3.7.1">§3.7.1 of Network Time Protocol Best Current Practices</a> (Internet <abbr>RFC</abbr> 8633), leap smearing is not suitable for applications requiring accurate <abbr>UTC</abbr> or civil time, @@ -1089,7 +1086,7 @@ again.</li> <section> <h2 id="notation">Time notation</h2> <ul> -<li>The <a id="CLDR" href="http://cldr.unicode.org">Unicode Common Locale Data +<li>The <a id="CLDR" href="https://cldr.unicode.org">Unicode Common Locale Data Repository (<abbr>CLDR</abbr>) Project</a> has localizations for time zone names, abbreviations, identifiers, and formats. For example, it contains French translations for "Eastern European Summer Time", @@ -1111,13 +1108,13 @@ interchange – Part 1: Basic rules</em></a>.</li> <a href="https://www.w3.org/TR/xmlschema/#dateTime"><abbr>XML</abbr> Schema: Datatypes – dateTime</a> specifies a format inspired by <abbr>ISO</abbr> 8601 that is in common use in <abbr>XML</abbr> data.</li> -<li><a href="https://tools.ietf.org/html/rfc5322#section-3.3">§3.3 of +<li><a href="https://datatracker.ietf.org/doc/html/rfc5322#section-3.3">§3.3 of Internet Message Format</a> (Internet <abbr>RFC</abbr> 5322) specifies the time notation used in email and <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol"><abbr>HTTP</abbr></a> headers.</li> <li> -<a href="https://tools.ietf.org/html/rfc3339">Date and Time +<a href="https://datatracker.ietf.org/doc/html/rfc3339">Date and Time on the Internet: Timestamps</a> (Internet <abbr>RFC</abbr> 3339) specifies an <abbr>ISO</abbr> 8601 profile for use in new Internet @@ -486,7 +486,7 @@ of one hour, or of 15 minutes, or of 1 minute. .PP Olson A, Eggert P, Murchison K. The Time Zone Information Format (TZif). 2019 Feb. -.UR https://\:www.rfc-editor.org/\:info/\:rfc8536 +.UR https://\:datatracker.ietf.org/\:doc/\:html/\:rfc8536 Internet RFC 8536 .UE .UR https://\:doi.org/\:10.17487/\:RFC8536 @@ -7,12 +7,14 @@ tzselect \- select a timezone .ds d " degrees .ds m " minutes .ds s " seconds -.ds _ " \" -.if t .if \n(.g .if c \(de .if c \(fm .if c \(sd \{\ +.ds _ " \& +.if t \{\ +. if \n(.g .if c \(de .if c \(fm .if c \(sd \{\ . ds d \(de . ds m \(fm . ds s \(sd . ds _ \| +. \} .\} .B tzselect [ diff --git a/tzselect.ksh b/tzselect.ksh index 7b6b789..28c32a2 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -32,6 +32,7 @@ REPORT_BUGS_TO=tz@iana.org # # Gawk (GNU awk) <https://www.gnu.org/software/gawk/> # mawk <https://invisible-island.net/mawk/> +# nawk <https://github.com/onetrueawk/awk> # Specify default values for environment variables if they are unset. @@ -303,15 +304,24 @@ while quoted_continents=` $AWK ' + function handle_entry(entry) { + entry = substr(entry, 1, index(entry, "/") - 1) + if (entry == "America") + entry = entry "s" + if (entry ~ /^(Arctic|Atlantic|Indian|Pacific)$/) + entry = entry " Ocean" + printf "'\''%s'\''\n", entry + } BEGIN { FS = "\t" } /^[^#]/ { - entry = substr($3, 1, index($3, "/") - 1) - if (entry == "America") - entry = entry "s" - if (entry ~ /^(Arctic|Atlantic|Indian|Pacific)$/) - entry = entry " Ocean" - printf "'\''%s'\''\n", entry + handle_entry($3) } + /^#@/ { + ncont = split($2, cont, /,/) + for (ci = 1; ci <= ncont; ci++) { + handle_entry(cont[ci]) + } + } ' <"$TZ_ZONE_TABLE" | sort -u | tr '\n' ' ' @@ -395,15 +405,37 @@ while *) # Get list of names of countries in the continent or ocean. countries=`$AWK \ - -v continent="$continent" \ + -v continent_re="^$continent/" \ -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ ' BEGIN { FS = "\t" } - /^#/ { next } - $3 ~ ("^" continent "/") { - ncc = split($1, cc, /,/) - for (i = 1; i <= ncc; i++) + /^#$/ { next } + /^#[^@]/ { next } + { + commentary = $0 ~ /^#@/ + if (commentary) { + col1ccs = substr($1, 3) + conts = $2 + } else { + col1ccs = $1 + conts = $3 + } + ncc = split(col1ccs, cc, /,/) + ncont = split(conts, cont, /,/) + for (i = 1; i <= ncc; i++) { + elsewhere = commentary + for (ci = 1; ci <= ncont; ci++) { + if (cont[ci] ~ continent_re) { if (!cc_seen[cc[i]]++) cc_list[++ccs] = cc[i] + elsewhere = 0 + } + } + if (elsewhere) { + for (i = 1; i <= ncc; i++) { + cc_elsewhere[cc[i]] = 1 + } + } + } } END { while (getline <TZ_COUNTRY_TABLE) { @@ -411,6 +443,7 @@ while } for (i = 1; i <= ccs; i++) { country = cc_list[i] + if (cc_elsewhere[country]) continue if (cc_name[country]) { country = cc_name[country] } @@ -4,11 +4,13 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# Tell groff not to emit SGR escape sequences (ANSI color escapes). -GROFF_NO_SGR=1 -export GROFF_NO_SGR +if (type nroff && type perl) >/dev/null 2>&1; then -echo ".am TH + # Tell groff not to emit SGR escape sequences (ANSI color escapes). + GROFF_NO_SGR=1 + export GROFF_NO_SGR + + echo ".am TH .hy 0 .na .. @@ -30,4 +32,10 @@ echo ".am TH print "$_\n"; $didprint = 1; } -' + ' +elif (type mandoc && type col) >/dev/null 2>&1; then + mandoc -man -T ascii "$@" | col -bx +else + echo >&2 "$0: please install nroff and perl, or mandoc and col" + exit 1 +fi @@ -31,12 +31,14 @@ zic \- timezone compiler .ds d " degrees .ds m " minutes .ds s " seconds -.ds _ " \" -.if t .if \n(.g .if c \(de .if c \(fm .if c \(sd \{\ +.ds _ " \& +.if t \{\ +. if \n(.g .if c \(de .if c \(fm .if c \(sd \{\ . ds d \(de . ds m \(fm . ds s \(sd . ds _ \| +. \} .\} The .B zic @@ -3670,9 +3670,14 @@ mkdirs(char const *argname, bool ancestors) some other process might have made the directory in the meantime. Likewise for ENOSYS, because Solaris 10 mkdir fails with ENOSYS if the - directory is an automounted mount point. */ + directory is an automounted mount point. + Likewise for EACCES, since mkdir can fail + with EACCES merely because the parent directory + is unwritable. Likewise for most other error + numbers. */ int err = errno; - if (err != EEXIST && err != ENOSYS) { + if (err == ELOOP || err == ENAMETOOLONG + || err == ENOENT || err == ENOTDIR) { error(_("%s: Can't create directory %s: %s"), progname, name, strerror(err)); exit(EXIT_FAILURE); diff --git a/ziguard.awk b/ziguard.awk index 0728baa..0556cc4 100644 --- a/ziguard.awk +++ b/ziguard.awk @@ -91,12 +91,13 @@ $1 == "#PACKRATLIST" && $2 == PACKRATLIST { /^Zone/ { zone = $2 } DATAFORM != "main" { - in_comment = /^#/ + in_comment = $0 ~ /^#/ uncomment = comment_out = 0 # If this line should differ due to Czechoslovakia using negative SAVE values, # uncomment the desired version and comment out the undesired one. - if (zone == "Europe/Prague" && /^#?[\t ]+[01]:00[\t ]/ && /1947 Feb 23/) { + if (zone == "Europe/Prague" && $0 ~ /^#?[\t ]+[01]:00[\t ]/ \ + && $0 ~ /1947 Feb 23/) { if (($(in_comment + 2) != "-") == (DATAFORM != "rearguard")) { uncomment = in_comment } else { @@ -106,9 +107,9 @@ DATAFORM != "main" { # If this line should differ due to Ireland using negative SAVE values, # uncomment the desired version and comment out the undesired one. - Rule_Eire = /^#?Rule[\t ]+Eire[\t ]/ + Rule_Eire = $0 ~ /^#?Rule[\t ]+Eire[\t ]/ Zone_Dublin_post_1968 \ - = (zone == "Europe/Dublin" && /^#?[\t ]+[01]:00[\t ]/ \ + = (zone == "Europe/Dublin" && $0 ~ /^#?[\t ]+[01]:00[\t ]/ \ && (!$(in_comment + 4) || 1968 < $(in_comment + 4))) if (Rule_Eire || Zone_Dublin_post_1968) { if ((Rule_Eire \ @@ -122,9 +123,9 @@ DATAFORM != "main" { # If this line should differ due to Namibia using negative SAVE values, # uncomment the desired version and comment out the undesired one. - Rule_Namibia = /^#?Rule[\t ]+Namibia[\t ]/ + Rule_Namibia = $0 ~ /^#?Rule[\t ]+Namibia[\t ]/ Zone_using_Namibia_rule \ - = (zone == "Africa/Windhoek" && /^#?[\t ]+[12]:00[\t ]/ \ + = (zone == "Africa/Windhoek" && $0 ~ /^#?[\t ]+[12]:00[\t ]/ \ && ($(in_comment + 2) == "Namibia" \ || ($(in_comment + 2) == "-" && $(in_comment + 3) == "CAT" \ && ((1994 <= $(in_comment + 4) && $(in_comment + 4) <= 2017) \ @@ -142,8 +143,8 @@ DATAFORM != "main" { # If this line should differ due to Portugal benefiting from %z if supported, # uncomment the desired version and comment out the undesired one. - if (/^#?[\t ]+-[12]:00[\t ]+Port[\t ]+[%+-]/) { - if (/%z/ == (DATAFORM == "vanguard")) { + if ($0 ~ /^#?[\t ]+-[12]:00[\t ]+Port[\t ]+[%+-]/) { + if (($0 ~ /%z/) == (DATAFORM == "vanguard")) { uncomment = in_comment } else { comment_out = !in_comment @@ -164,8 +165,8 @@ DATAFORM != "main" { sub(/-00CHANGE-TO-%z/, "-00") sub(/[-+][^\t ]+CHANGE-TO-/, "") } else { - if (/^[^#]*%z/) { - stdoff_column = 2 * /^Zone/ + 1 + if ($0 ~ /^[^#]*%z/) { + stdoff_column = 2 * ($0 ~ /^Zone/) + 1 rules_column = stdoff_column + 1 stdoff = get_minutes($stdoff_column) rules = $rules_column @@ -184,9 +185,9 @@ DATAFORM != "main" { dstoff = 20 } else if (((rules == "Cook" || rules == "LH") && NF == 3) \ || (rules == "Uruguay" \ - && /[\t ](1942 Dec 14|1960|1970|1974 Dec 22)$/)) { + && $0 ~ /[\t ](1942 Dec 14|1960|1970|1974 Dec 22)$/)) { dstoff = 30 - } else if (rules == "Uruguay" && /[\t ]1974 Mar 10$/) { + } else if (rules == "Uruguay" && $0 ~ /[\t ]1974 Mar 10$/) { dstoff = 90 } else { dstoff = 60 @@ -222,7 +223,7 @@ DATAFORM != "main" { stdoff_subst[1] = rounded_stdoff } } else if (stdoff_subst[0]) { - stdoff_column = 2 * /^Zone/ + 1 + stdoff_column = 2 * ($0 ~ /^Zone/) + 1 stdoff_column_val = $stdoff_column if (stdoff_column_val == stdoff_subst[0]) { sub(stdoff_subst[0], stdoff_subst[1]) @@ -233,7 +234,7 @@ DATAFORM != "main" { # In rearguard form, change the Japan rule line with "Sat>=8 25:00" # to "Sun>=9 1:00", to cater to zic before 2007 and to older Java. - if (/^Rule/ && $2 == "Japan") { + if ($0 ~ /^Rule/ && $2 == "Japan") { if (DATAFORM == "rearguard") { if ($7 == "Sat>=8" && $8 == "25:00") { sub(/Sat>=8/, "Sun>=9") @@ -250,7 +251,7 @@ DATAFORM != "main" { # In rearguard form, change the Morocco lines with negative SAVE values # to use positive SAVE values. if ($2 == "Morocco") { - if (/^Rule/) { + if ($0 ~ /^Rule/) { if ($4 ~ /^201[78]$/ && $6 == "Oct") { if (DATAFORM == "rearguard") { sub(/\t2018\t/, "\t2017\t") @@ -290,8 +291,10 @@ DATAFORM != "main" { /^Zone/ { packrat_ignored = FILENAME == PACKRATDATA && PACKRATLIST && !packratlist[$2]; } -packrat_ignored && !/^Rule/ { - sub(/^/, "#") +{ + if (packrat_ignored && $0 !~ /^Rule/) { + sub(/^/, "#") + } } # If a Link line is followed by a Link or Zone line for the same data, comment @@ -401,8 +401,6 @@ TV -0831+17913 Pacific/Funafuti TW +2503+12130 Asia/Taipei TZ -0648+03917 Africa/Dar_es_Salaam UA +5026+03031 Europe/Kyiv Ukraine (most areas) -UA +4837+02218 Europe/Uzhgorod Transcarpathia -UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk UG +0019+03225 Africa/Kampala UM +2813-17722 Pacific/Midway Midway Islands UM +1917+16637 Pacific/Wake Wake Island diff --git a/zone1970.tab b/zone1970.tab index 3e1948c..cf9cf20 100644 --- a/zone1970.tab +++ b/zone1970.tab @@ -312,8 +312,6 @@ TO -210800-1751200 Pacific/Tongatapu TR +4101+02858 Europe/Istanbul TW +2503+12130 Asia/Taipei UA +5026+03031 Europe/Kyiv Ukraine (most areas) -UA +4837+02218 Europe/Uzhgorod Transcarpathia -UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk US +404251-0740023 America/New_York Eastern (most areas) US +421953-0830245 America/Detroit Eastern - MI (most areas) US +381515-0854534 America/Kentucky/Louisville Eastern - KY (Louisville area) @@ -351,3 +349,27 @@ VN +1045+10640 Asia/Ho_Chi_Minh Vietnam (south) VU -1740+16825 Pacific/Efate WS -1350-17144 Pacific/Apia ZA,LS,SZ -2615+02800 Africa/Johannesburg +# +# The next section contains experimental tab-separated comments for +# use by user agents like tzselect that identify continents and oceans. +# +# For example, the comment "#@AQ<tab>Antarctica/" means the country code +# AQ is in the continent Antarctica regardless of the Zone name, +# so Pacific/Auckland should be listed under Antarctica as well as +# under the Pacific because its line's country codes include AQ. +# +# If more than one country code is affected each is listed separated +# by commas, e.g., #@IS,SH<tab>Atlantic/". If a country code is in +# more than one continent or ocean, each is listed separated by +# commas, e.g., the second column of "#@CY,TR<tab>Asia/,Europe/". +# +# These experimental comments are present only for country codes where +# the continent or ocean is not already obvious from the Zone name. +# For example, there is no such comment for RU since it already +# corresponds to Zone names starting with both "Europe/" and "Asia/". +# +#@AQ Antarctica/ +#@IS,SH Atlantic/ +#@CY,TR Asia/,Europe/ +#@SJ Arctic/ +#@CC,CX,KM,MG,YT Indian/ diff --git a/zoneinfo2tdf.pl b/zoneinfo2tdf.pl deleted file mode 100755 index 176fce9..0000000 --- a/zoneinfo2tdf.pl +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/perl -w -# Summarize .zi input in a .zi-like format. - -# Courtesy Ken Pizzini. - -use strict; - -#This file released to the public domain. - -# Note: error checking is poor; trust the output only if the input -# has been checked by zic. - -my $contZone = ''; -while (<>) { - my $origline = $_; - my @fields = (); - while (s/^\s*((?:"[^"]*"|[^\s#])+)//) { - push @fields, $1; - } - next unless @fields; - - my $type = lc($fields[0]); - if ($contZone) { - @fields >= 3 or warn "bad continuation line"; - unshift @fields, '+', $contZone; - $type = 'zone'; - } - - $contZone = ''; - if ($type eq 'zone') { - # Zone NAME STDOFF RULES/SAVE FORMAT [UNTIL] - my $nfields = @fields; - $nfields >= 5 or warn "bad zone line"; - if ($nfields > 6) { - #this splice is optional, depending on one's preference - #(one big date-time field, or componentized date and time): - splice(@fields, 5, $nfields-5, "@fields[5..$nfields-1]"); - } - $contZone = $fields[1] if @fields > 5; - } elsif ($type eq 'rule') { - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S - @fields == 10 or warn "bad rule line"; - } elsif ($type eq 'link') { - # Link TARGET LINK-NAME - @fields == 3 or warn "bad link line"; - } elsif ($type eq 'leap') { - # Leap YEAR MONTH DAY HH:MM:SS CORR R/S - @fields == 7 or warn "bad leap line"; - } else { - warn "Fubar at input line $.: $origline"; - } - print join("\t", @fields), "\n"; -} |