summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart.bishop@canonical.com>2020-11-02 14:25:46 +1100
committerStuart Bishop <stuart.bishop@canonical.com>2020-11-02 14:25:46 +1100
commit5c4a3c6181ef26e585f20551dbac3a39137f71b1 (patch)
tree4909361574819b46825bf82c53cfff1408ef5d50
parent55e2d1c47162948bc9254d3352b95c3bd5d21a4e (diff)
parenta4a62d8d41eea2df3759cbcdbd9100a72e8c28c7 (diff)
downloadpytz-git-5c4a3c6181ef26e585f20551dbac3a39137f71b1.tar.gz
IANA 2020d
-rw-r--r--tz/Makefile113
-rw-r--r--tz/NEWS109
-rw-r--r--tz/README2
-rw-r--r--tz/africa74
-rw-r--r--tz/antarctica27
-rw-r--r--tz/asia121
-rw-r--r--tz/australasia54
-rw-r--r--tz/backzone33
-rw-r--r--tz/date.14
-rw-r--r--tz/date.c38
-rw-r--r--tz/europe245
-rw-r--r--tz/leap-seconds.list8
-rwxr-xr-xtz/leapseconds.awk6
-rw-r--r--tz/localtime.c20
-rw-r--r--tz/newctime.3104
-rw-r--r--tz/newstrftime.3129
-rw-r--r--tz/newtzset.334
-rw-r--r--tz/northamerica90
-rw-r--r--tz/pacificnew29
-rw-r--r--tz/private.h5
-rw-r--r--tz/southamerica18
-rw-r--r--tz/strftime.c24
-rw-r--r--tz/systemv39
-rw-r--r--tz/theory.html51
-rw-r--r--tz/time2posix.324
-rw-r--r--tz/tz-art.html9
-rw-r--r--tz/tz-how-to.html161
-rw-r--r--tz/tz-link.html90
-rw-r--r--tz/tzfile.552
-rw-r--r--tz/tzselect.82
-rw-r--r--tz/yearistype.sh39
-rw-r--r--tz/zdump.82
-rw-r--r--tz/zic.847
-rw-r--r--tz/zic.c205
-rw-r--r--tz/ziguard.awk9
-rw-r--r--tz/zishrink.awk4
-rwxr-xr-xtz/zoneinfo2tdf.pl2
37 files changed, 1168 insertions, 855 deletions
diff --git a/tz/Makefile b/tz/Makefile
index 610bf19..40b81d1 100644
--- a/tz/Makefile
+++ b/tz/Makefile
@@ -22,13 +22,13 @@ BUGEMAIL= tz@iana.org
# DATAFORM= main
# To wait even longer for new features, use:
# DATAFORM= rearguard
+# Rearguard users might also want "ZFLAGS = -b fat"; see below.
DATAFORM= main
# Change the line below for your timezone (after finding the one you want in
# one of the $(TDATA) source files, or adding it to a source file).
# Alternatively, if you discover you've got the wrong timezone, you can just
-# zic -l rightzone
-# to correct things.
+# 'zic -l -' to remove it, or 'zic -l rightzone' to change it.
# Use the command
# make zonenames
# to get a list of the values you can use for LOCALTIME.
@@ -37,33 +37,30 @@ LOCALTIME= GMT
# The POSIXRULES macro controls interpretation of nonstandard and obsolete
# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules.
-# In the reference implementation, if you want something other than Eastern
-# United States time as a template for handling these settings, you can
-# change the line below (after finding the timezone you want in the
-# one of the $(TDATA) source files, or adding it to a source file).
-# A setting like TZ='EET-2EEST' is supposed to use the rules in the
-# template file to determine "spring forward" and "fall back" days and
-# times; the environment variable itself specifies UT offsets of standard and
-# daylight saving time.
-# Alternatively, if you discover you've got the wrong timezone, you can just
-# zic -p rightzone
-# to correct things.
-# Use the command
-# make zonenames
-# to get a list of the values you can use for POSIXRULES.
+# Such a setting uses the rules in a template file to determine
+# "spring forward" and "fall back" days and times; the environment
+# variable itself specifies UT offsets of standard and daylight saving time.
#
-# If POSIXRULES is empty, no template is installed; this is the intended
-# future default for POSIXRULES.
+# If POSIXRULES is '-', no template is installed; this is the default.
#
-# Nonempty POSIXRULES is obsolete and should not be relied on, because:
+# Any other value for POSIXRULES is obsolete and should not be relied on, as:
# * It does not work correctly in popular implementations such as GNU/Linux.
# * It does not work in the tzdb implementation for timestamps after 2037.
# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions
# at standard time or UT rather than at local time.
# In short, software should avoid ruleless settings like TZ='EET-2EEST'
# and so should not depend on the value of POSIXRULES.
+#
+# If, despite the above, you want a template for handling these settings,
+# you can change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
+# 'zic -p -' to remove it, or 'zic -p rightzone' to change it.
+# Use the command
+# make zonenames
+# to get a list of the values you can use for POSIXRULES.
-POSIXRULES= America/New_York
+POSIXRULES= -
# Also see TZDEFRULESTRING below, which takes effect only
# if the time zone files cannot be accessed.
@@ -172,9 +169,6 @@ TZDATA_TEXT= leapseconds tzdata.zi
# For backward-compatibility links for old zone names, use
# BACKWARD= backward
-# If you also want the link US/Pacific-New, even though it is confusing
-# and is planned to be removed from the database eventually, use
-# BACKWARD= backward pacificnew
# To omit these links, use
# BACKWARD=
@@ -192,10 +186,6 @@ PACKRATDATA=
UTF8_LOCALE= en_US.utf8
-# Since "." may not be in PATH...
-
-YEARISTYPE= ./yearistype
-
# Non-default libraries needed to link.
LDLIBS=
@@ -253,13 +243,12 @@ LDLIBS=
# other than simply getting garbage data
# -DUSE_LTZ=0 to build zdump with the system time zone library
# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
-# -DZIC_BLOAT_DEFAULT=\"slim\" to default zic's -b option to "slim", and
-# similarly for "fat". Fat TZif files work around incompatibilities
+# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and
+# similarly for "slim". Fat TZif files work around incompatibilities
# and bugs in some TZif readers, notably readers that mishandle 64-bit
# data in TZif files. Slim TZif files are more efficient and do not
# work around these incompatibilities and bugs. If not given, the
-# current default is "fat" but this is intended to change as readers
-# requiring fat files often mishandle timestamps after 2037 anyway.
+# default is "slim".
# -DZIC_MAX_ABBR_LEN_WO_WARN=3
# (or some other number) to set the maximum time zone abbreviation length
# that zic will accept without a warning (the default is 6)
@@ -333,9 +322,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
# add
# -DSTD_INSPIRED
# to the end of the "CFLAGS=" line. This arranges for the functions
-# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
+# "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
-# "tzsetwall" is deprecated and is intended to be removed soon; see NEWS.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
@@ -395,7 +383,7 @@ ZIC= $(zic) $(ZFLAGS)
# To shrink the size of installed TZif files,
# append "-r @N" to omit data before N-seconds-after-the-Epoch.
-# You can also append "-b slim" if that is not already the default;
+# To grow the files and work around older application bugs, append "-b fat";
# see ZIC_BLOAT_DEFAULT above.
# See the zic man page for more about -b and -r.
ZFLAGS=
@@ -424,26 +412,6 @@ CURL= curl
# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
GPG= gpg
-# The path where SGML DTDs are kept and the catalog file(s) to use when
-# validating HTML 4.01. The default should work on both Debian and Red Hat.
-SGML_TOPDIR= /usr
-SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
-SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
-SGML_CATALOG_FILES= \
- $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat
-
-# The name, arguments and environment of a program to validate HTML 4.01.
-# See <http://openjade.sourceforge.net/doc/> for a validator, and
-# <https://validator.w3.org/source/> for a validation library.
-# Set VALIDATE=':' if you do not have such a program.
-VALIDATE = nsgmls
-VALIDATE_FLAGS = -s -B -wall -wno-unused-param
-VALIDATE_ENV = \
- SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
- SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
- SP_CHARSET_FIXED=YES \
- SP_ENCODING=UTF-8
-
# This expensive test requires USE_LTZ.
# To suppress it, define this macro to be empty.
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
@@ -538,8 +506,8 @@ DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
YDATA= $(PRIMARY_YDATA) etcetera
-NDATA= systemv factory
-TDATA_TO_CHECK= $(YDATA) $(NDATA) backward pacificnew
+NDATA= factory
+TDATA_TO_CHECK= $(YDATA) $(NDATA) backward
TDATA= $(YDATA) $(NDATA) $(BACKWARD)
ZONETABLES= zone1970.tab zone.tab
TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
@@ -547,7 +515,7 @@ LEAP_DEPS= leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
- leapseconds yearistype.sh $(ZONETABLES)
+ leapseconds $(ZONETABLES)
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
ziguard.awk zishrink.awk
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
@@ -573,12 +541,10 @@ VERSION_DEPS= \
etcetera europe factory iso3166.tab \
leap-seconds.list leapseconds.awk localtime.c \
newctime.3 newstrftime.3 newtzset.3 northamerica \
- pacificnew private.h \
- southamerica strftime.c systemv theory.html \
+ private.h southamerica strftime.c theory.html \
time2posix.3 tz-art.html tz-how-to.html tz-link.html \
tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
- workman.sh yearistype.sh \
- zdump.8 zdump.c zic.8 zic.c \
+ workman.sh zdump.8 zdump.c zic.8 zic.c \
ziguard.awk zishrink.awk \
zone.tab zone1970.tab zoneinfo2tdf.pl
@@ -587,7 +553,7 @@ VERSION_DEPS= \
SHELL= /bin/sh
-all: tzselect yearistype zic zdump libtz.a $(TABDATA) \
+all: tzselect zic zdump libtz.a $(TABDATA) \
vanguard.zi main.zi rearguard.zi
ALL: all date $(ENCHILADA)
@@ -657,10 +623,6 @@ zdump: $(TZDOBJS)
zic: $(TZCOBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
-yearistype: yearistype.sh
- cp yearistype.sh yearistype
- chmod +x yearistype
-
leapseconds: $(LEAP_DEPS)
$(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \
-f leapseconds.awk leap-seconds.list >$@.out
@@ -675,10 +637,9 @@ INSTALLARGS = \
PACKRATDATA='$(PACKRATDATA)' \
TZDEFAULT='$(TZDEFAULT)' \
TZDIR='$(TZDIR)' \
- YEARISTYPE='$(YEARISTYPE)' \
ZIC='$(ZIC)'
-INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
+INSTALL_DATA_DEPS = zic leapseconds tzdata.zi
# 'make install_data' installs one set of TZif files.
install_data: $(INSTALL_DATA_DEPS)
@@ -793,7 +754,7 @@ check_character_set: $(ENCHILADA)
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
Makefile && \
! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
- leapseconds yearistype.sh zone.tab && \
+ leapseconds zone.tab && \
! grep -Env $(OK_LINE) $(ENCHILADA); \
}
touch $@
@@ -845,15 +806,13 @@ check_tzs: $(TZS) $(TZS_NEW)
check_web: $(CHECK_WEB_PAGES)
check_theory.html: theory.html
check_tz-art.html: tz-art.html
+check_tz-how-to.html: tz-how-to.html
check_tz-link.html: tz-link.html
-check_theory.html check_tz-art.html check_tz-link.html:
+check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html:
$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
-F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
test ! -s $@.out || { cat $@.out; exit 1; }
mv $@.out $@
-check_tz-how-to.html: tz-how-to.html
- $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
- touch $@
# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
@@ -883,7 +842,7 @@ clean_misc:
rm -fr check_*.dir
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
check_* core typecheck_* \
- date tzselect version.h zdump zic yearistype libtz.a
+ date tzselect version.h zdump zic libtz.a
clean: clean_misc
rm -fr *.dir tzdb-*/
rm -f *.zi $(TZS_NEW)
@@ -1063,10 +1022,14 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
done
sed '1s/$$/-rearguard/' \
<version >tzdata$(VERSION)-rearguard.dir/version
+ : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier.
+ TZ=UTC0 touch -mt 202010122253.00 \
+ tzdata$(VERSION)-rearguard.dir/pacificnew
touch -cmr version tzdata$(VERSION)-rearguard.dir/version
LC_ALL=C && export LC_ALL && \
(cd tzdata$(VERSION)-rearguard.dir && \
- tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
+ tar $(TARFLAGS) -cf - \
+ $(COMMON) $(DATA) $(MISC) pacificnew | \
gzip $(GZIPFLAGS)) >$@.out
mv $@.out $@
diff --git a/tz/NEWS b/tz/NEWS
index 321e090..328face 100644
--- a/tz/NEWS
+++ b/tz/NEWS
@@ -1,5 +1,114 @@
News for the tz database
+Release 2020d - 2020-10-21 11:24:13 -0700
+
+ Briefly:
+ Palestine ends DST earlier than predicted, on 2020-10-24.
+
+ Changes to past and future timestamps
+
+ Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31
+ as previously predicted (thanks to Sharef Mustafa.) Its
+ 2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen
+ Thorsen.) Its 2015-10-23 transition was at 01:00 not 00:00, and
+ its spring 2020 transition was on March 28 at 00:00, not March 27
+ (thanks to Pierre Cashon.) This affects Asia/Gaza and
+ Asia/Hebron. Assume future spring and fall transitions will be on
+ the Saturday preceding the last Sunday of March and October,
+ respectively.
+
+
+Release 2020c - 2020-10-16 11:15:53 -0700
+
+ Briefly:
+ Fiji starts DST later than usual, on 2020-12-20.
+
+ Changes to future timestamps
+
+ Fiji will start DST on 2020-12-20, instead of 2020-11-08 as
+ previously predicted. DST will still end on 2021-01-17.
+ (Thanks to Raymond Kumar and Alan Mintz.) Assume for now that
+ the later-than-usual start date is a one-time departure from the
+ recent pattern.
+
+ Changes to build procedure
+
+ Rearguard tarballs now contain an empty file pacificnew.
+ Some older downstream software expects this file to exist.
+ (Problem reported by Mike Cullinan.)
+
+
+Release 2020b - 2020-10-06 18:35:04 -0700
+
+ Briefly:
+ Revised predictions for Morocco's changes starting in 2023.
+ Canada's Yukon changes to -07 on 2020-11-01, not 2020-03-08.
+ Macquarie Island has stayed in sync with Tasmania since 2011.
+ Casey, Antarctica is at +08 in winter and +11 in summer.
+ zic no longer supports -y, nor the TYPE field of Rules.
+
+ Changes to future timestamps
+
+ Morocco's spring-forward after Ramadan is now predicted to occur
+ no sooner than two days after Ramadan, instead of one day.
+ (Thanks to Milamber.) The first altered prediction is for 2023,
+ now predicted to spring-forward on April 30 instead of April 23.
+
+ Changes to past and future timestamps
+
+ Casey Station, Antarctica has been using +08 in winter and +11 in
+ summer since 2018. The most recent transition from +08 to +11 was
+ 2020-10-04 00:01. Also, Macquarie Island has been staying in
+ sync with Tasmania since 2011. (Thanks to Steffen Thorsen.)
+
+ Changes to past and future time zone abbreviations and DST flags
+
+ Canada's Yukon, represented by America/Whitehorse and
+ America/Dawson, changes its time zone rules from -08/-07 to
+ permanent -07 on 2020-11-01, not on 2020-03-08 as 2020a had it.
+ This change affects only the time zone abbreviation (MST vs PDT)
+ and daylight saving flag for the period between the two dates.
+ (Thanks to Andrew G. Smith.)
+
+ Changes to past timestamps
+
+ Correct several transitions for Hungary for 1918/1983.
+ For example, the 1983-09-25 fall-back was at 01:00, not 03:00.
+ (Thanks to Géza Nyáry.) Also, the 1890 transition to standard
+ time was on 11-01, not 10-01 (thanks to Michael Deckers).
+
+ The 1891 French transition was on March 16, not March 15. The
+ 1911-03-11 French transition was at midnight, not a minute later.
+ Monaco's transitions were on 1892-06-01 and 1911-03-29, not
+ 1891-03-15 and 1911-03-11. (Thanks to Michael Deckers.)
+
+ Changes to code
+
+ Support for zic's long-obsolete '-y YEARISTYPE' option has been
+ removed and, with it, so has support for the TYPE field in Rule
+ lines, which is now reserved for compatibility with earlier zic.
+ These features were previously deprecated in release 2015f.
+ (Thanks to Tim Parenti.)
+
+ zic now defaults to '-b slim' instead of to '-b fat'.
+
+ zic's new '-l -' and '-p -' options uninstall any existing
+ localtime and posixrules files, respectively.
+
+ The undocumented and ineffective tzsetwall function has been
+ removed.
+
+ Changes to build procedure
+
+ The Makefile now defaults POSIXRULES to '-', so the posixrules
+ feature (obsolete as of 2019b) is no longer installed by default.
+
+ Changes to documentation and commentary
+
+ The long-obsolete files pacificnew, systemv, and yearistype.sh have
+ been removed from the distribution. (Thanks to Tim Parenti.)
+
+
Release 2020a - 2020-04-23 16:03:47 -0700
Briefly:
diff --git a/tz/README b/tz/README
index dd6fcf7..145aacd 100644
--- a/tz/README
+++ b/tz/README
@@ -20,6 +20,8 @@ substituting your desired installation directory for "$HOME/tzdir":
make TOPDIR=$HOME/tzdir install
$HOME/tzdir/usr/bin/zdump -v America/Los_Angeles
+See the file tz-how-to.html for examples of how to read the data files.
+
This database of historical local time information has several goals:
* Provide a compendium of data about the history of civil time that
diff --git a/tz/africa b/tz/africa
index 724744f..566436b 100644
--- a/tz/africa
+++ b/tz/africa
@@ -64,7 +64,7 @@
# Corrections are welcome.
# Algeria
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Algeria 1916 only - Jun 14 23:00s 1:00 S
Rule Algeria 1916 1919 - Oct Sun>=1 23:00s 0 -
Rule Algeria 1917 only - Mar 24 23:00s 1:00 S
@@ -87,10 +87,9 @@ Rule Algeria 1978 only - Mar 24 1:00 1:00 S
Rule Algeria 1978 only - Sep 22 3:00 0 -
Rule Algeria 1980 only - Apr 25 0:00 1:00 S
Rule Algeria 1980 only - Oct 31 2:00 0 -
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
+# See Europe/Paris for PMT-related transitions.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01
+Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 16
0:09:21 - PMT 1911 Mar 11 # Paris Mean Time
0:00 Algeria WE%sT 1940 Feb 25 2:00
1:00 Algeria CE%sT 1946 Oct 7
@@ -176,7 +175,7 @@ Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
# did not apply to Cairo, Alexandria, or Port Said.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Egypt 1940 only - Jul 15 0:00 1:00 S
Rule Egypt 1940 only - Oct 1 0:00 0 -
Rule Egypt 1941 only - Apr 15 0:00 1:00 S
@@ -411,7 +410,7 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# now Ghana observed different DST regimes in different years. For
# lack of better info, use Shanks except treat the minus sign as a
# typo, and assume DST started in 1920 not 1936.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Ghana 1920 1942 - Sep 1 0:00 0:20 -
Rule Ghana 1920 1942 - Dec 31 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -501,7 +500,7 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# From Paul Eggert (2013-10-25):
# For now, assume they're reverting to the pre-2012 rules of permanent UT +02.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Libya 1951 only - Oct 14 2:00 1:00 S
Rule Libya 1952 only - Jan 1 0:00 0 -
Rule Libya 1953 only - Oct 9 2:00 1:00 S
@@ -624,7 +623,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# "The trial ended on March 29, 2009, when the clocks moved back by one hour
# at 2am (or 02:00) local time..."
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Mauritius 1982 only - Oct 10 0:00 1:00 -
Rule Mauritius 1983 only - Mar 21 0:00 0 -
Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 -
@@ -875,17 +874,30 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# https://maroc-diplomatique.net/maroc-le-retour-a-lheure-gmt-est-prevu-dimanche-prochain/
# http://aujourdhui.ma/actualite/gmt1-retour-a-lheure-normale-dimanche-prochain-1
#
-# From Paul Eggert (2020-04-14):
+# From Milamber (2020-05-31)
+# In Morocco (where I live), the end of Ramadan (Arabic month) is followed by
+# the Eid al-Fitr, and concretely it's 1 or 2 day offs for the people (with
+# traditional visiting of family, big lunches/dinners, etc.). So for this
+# year the astronomical calculations don't include the following 2 days off in
+# the calc. These 2 days fall in a Sunday/Monday, so it's not acceptable by
+# people to have a time shift during these 2 days off. Perhaps you can modify
+# the (predicted) rules for next years: if the end of Ramadan is a (probable)
+# Friday or Saturday (and so the 2 days off are on a weekend), the next time
+# shift will be the next weekend.
+#
+# From Paul Eggert (2020-05-31):
# For now, guess that in the future Morocco will fall back at 03:00
# the last Sunday before Ramadan, and spring forward at 02:00 the
-# first Sunday after the day after Ramadan. To implement this,
-# transition dates for 2021 through 2087 were determined by running
-# the following program under GNU Emacs 26.3.
-# (let ((islamic-year 1442))
+# first Sunday after two days after Ramadan. To implement this,
+# transition dates and times for 2019 through 2087 were determined by
+# running the following program under GNU Emacs 26.3. (This algorithm
+# also produces the correct transition dates for 2016 through 2018,
+# though the times differ due to Morocco's time zone change in 2018.)
+# (let ((islamic-year 1440))
# (require 'cal-islam)
# (while (< islamic-year 1511)
# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-# (b (1+ (calendar-islamic-to-absolute (list 10 1 islamic-year))))
+# (b (+ 2 (calendar-islamic-to-absolute (list 10 1 islamic-year))))
# (sunday 0))
# (while (/= sunday (mod (setq a (1- a)) 7)))
# (while (/= sunday (mod b 7))
@@ -900,7 +912,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
-# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 -
Rule Morocco 1939 only - Nov 19 0:00 0 -
Rule Morocco 1940 only - Feb 25 0:00 1:00 -
@@ -951,7 +963,7 @@ Rule Morocco 2021 only - May 16 2:00 0 -
Rule Morocco 2022 only - Mar 27 3:00 -1:00 -
Rule Morocco 2022 only - May 8 2:00 0 -
Rule Morocco 2023 only - Mar 19 3:00 -1:00 -
-Rule Morocco 2023 only - Apr 23 2:00 0 -
+Rule Morocco 2023 only - Apr 30 2:00 0 -
Rule Morocco 2024 only - Mar 10 3:00 -1:00 -
Rule Morocco 2024 only - Apr 14 2:00 0 -
Rule Morocco 2025 only - Feb 23 3:00 -1:00 -
@@ -967,7 +979,7 @@ Rule Morocco 2029 only - Feb 18 2:00 0 -
Rule Morocco 2029 only - Dec 30 3:00 -1:00 -
Rule Morocco 2030 only - Feb 10 2:00 0 -
Rule Morocco 2030 only - Dec 22 3:00 -1:00 -
-Rule Morocco 2031 only - Jan 26 2:00 0 -
+Rule Morocco 2031 only - Feb 2 2:00 0 -
Rule Morocco 2031 only - Dec 14 3:00 -1:00 -
Rule Morocco 2032 only - Jan 18 2:00 0 -
Rule Morocco 2032 only - Nov 28 3:00 -1:00 -
@@ -983,7 +995,7 @@ Rule Morocco 2036 only - Nov 23 2:00 0 -
Rule Morocco 2037 only - Oct 4 3:00 -1:00 -
Rule Morocco 2037 only - Nov 15 2:00 0 -
Rule Morocco 2038 only - Sep 26 3:00 -1:00 -
-Rule Morocco 2038 only - Oct 31 2:00 0 -
+Rule Morocco 2038 only - Nov 7 2:00 0 -
Rule Morocco 2039 only - Sep 18 3:00 -1:00 -
Rule Morocco 2039 only - Oct 23 2:00 0 -
Rule Morocco 2040 only - Sep 2 3:00 -1:00 -
@@ -999,7 +1011,7 @@ Rule Morocco 2044 only - Aug 28 2:00 0 -
Rule Morocco 2045 only - Jul 9 3:00 -1:00 -
Rule Morocco 2045 only - Aug 20 2:00 0 -
Rule Morocco 2046 only - Jul 1 3:00 -1:00 -
-Rule Morocco 2046 only - Aug 5 2:00 0 -
+Rule Morocco 2046 only - Aug 12 2:00 0 -
Rule Morocco 2047 only - Jun 23 3:00 -1:00 -
Rule Morocco 2047 only - Jul 28 2:00 0 -
Rule Morocco 2048 only - Jun 7 3:00 -1:00 -
@@ -1015,7 +1027,7 @@ Rule Morocco 2052 only - Jun 2 2:00 0 -
Rule Morocco 2053 only - Apr 13 3:00 -1:00 -
Rule Morocco 2053 only - May 25 2:00 0 -
Rule Morocco 2054 only - Apr 5 3:00 -1:00 -
-Rule Morocco 2054 only - May 10 2:00 0 -
+Rule Morocco 2054 only - May 17 2:00 0 -
Rule Morocco 2055 only - Mar 28 3:00 -1:00 -
Rule Morocco 2055 only - May 2 2:00 0 -
Rule Morocco 2056 only - Mar 12 3:00 -1:00 -
@@ -1031,7 +1043,7 @@ Rule Morocco 2060 only - Mar 7 2:00 0 -
Rule Morocco 2061 only - Jan 16 3:00 -1:00 -
Rule Morocco 2061 only - Feb 27 2:00 0 -
Rule Morocco 2062 only - Jan 8 3:00 -1:00 -
-Rule Morocco 2062 only - Feb 12 2:00 0 -
+Rule Morocco 2062 only - Feb 19 2:00 0 -
Rule Morocco 2062 only - Dec 31 3:00 -1:00 -
Rule Morocco 2063 only - Feb 4 2:00 0 -
Rule Morocco 2063 only - Dec 16 3:00 -1:00 -
@@ -1047,7 +1059,7 @@ Rule Morocco 2067 only - Dec 11 2:00 0 -
Rule Morocco 2068 only - Oct 21 3:00 -1:00 -
Rule Morocco 2068 only - Dec 2 2:00 0 -
Rule Morocco 2069 only - Oct 13 3:00 -1:00 -
-Rule Morocco 2069 only - Nov 17 2:00 0 -
+Rule Morocco 2069 only - Nov 24 2:00 0 -
Rule Morocco 2070 only - Oct 5 3:00 -1:00 -
Rule Morocco 2070 only - Nov 9 2:00 0 -
Rule Morocco 2071 only - Sep 20 3:00 -1:00 -
@@ -1063,7 +1075,7 @@ Rule Morocco 2075 only - Sep 15 2:00 0 -
Rule Morocco 2076 only - Jul 26 3:00 -1:00 -
Rule Morocco 2076 only - Sep 6 2:00 0 -
Rule Morocco 2077 only - Jul 18 3:00 -1:00 -
-Rule Morocco 2077 only - Aug 22 2:00 0 -
+Rule Morocco 2077 only - Aug 29 2:00 0 -
Rule Morocco 2078 only - Jul 10 3:00 -1:00 -
Rule Morocco 2078 only - Aug 14 2:00 0 -
Rule Morocco 2079 only - Jun 25 3:00 -1:00 -
@@ -1073,13 +1085,13 @@ Rule Morocco 2080 only - Jul 21 2:00 0 -
Rule Morocco 2081 only - Jun 1 3:00 -1:00 -
Rule Morocco 2081 only - Jul 13 2:00 0 -
Rule Morocco 2082 only - May 24 3:00 -1:00 -
-Rule Morocco 2082 only - Jun 28 2:00 0 -
+Rule Morocco 2082 only - Jul 5 2:00 0 -
Rule Morocco 2083 only - May 16 3:00 -1:00 -
Rule Morocco 2083 only - Jun 20 2:00 0 -
Rule Morocco 2084 only - Apr 30 3:00 -1:00 -
Rule Morocco 2084 only - Jun 11 2:00 0 -
Rule Morocco 2085 only - Apr 22 3:00 -1:00 -
-Rule Morocco 2085 only - May 27 2:00 0 -
+Rule Morocco 2085 only - Jun 3 2:00 0 -
Rule Morocco 2086 only - Apr 14 3:00 -1:00 -
Rule Morocco 2086 only - May 19 2:00 0 -
Rule Morocco 2087 only - Mar 30 3:00 -1:00 -
@@ -1180,7 +1192,7 @@ Link Africa/Maputo Africa/Lusaka # Zambia
# Use plain "WAT" and "CAT" for the time zone abbreviations, to be compatible
# with Namibia's neighbors.
-# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# Vanguard section, for zic and other parsers that support negative DST.
Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT
Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT
@@ -1303,7 +1315,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria
# See Africa/Nairobi.
# South Africa
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule SA 1942 1943 - Sep Sun>=15 2:00 1:00 -
Rule SA 1943 1944 - Mar Sun>=15 2:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1336,7 +1348,7 @@ Link Africa/Johannesburg Africa/Mbabane # Eswatini
# Abdalla of NTC, archived at:
# https://mm.icann.org/pipermail/tz/2017-October/025333.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Sudan 1970 only - May 1 0:00 1:00 S
Rule Sudan 1970 1985 - Oct 15 0:00 0 -
Rule Sudan 1971 only - Apr 30 0:00 1:00 S
@@ -1424,7 +1436,7 @@ Zone Africa/Juba 2:06:28 - LMT 1931
# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Tunisia 1939 only - Apr 15 23:00s 1:00 S
Rule Tunisia 1939 only - Nov 18 23:00s 0 -
Rule Tunisia 1940 only - Feb 25 23:00s 1:00 S
@@ -1451,9 +1463,7 @@ Rule Tunisia 2005 only - Sep 30 1:00s 0 -
Rule Tunisia 2006 2008 - Mar lastSun 2:00s 1:00 S
Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 -
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
-# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.
+# See Europe/Paris for PMT-related transitions.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
0:09:21 - PMT 1911 Mar 11 # Paris Mean Time
diff --git a/tz/antarctica b/tz/antarctica
index 2059983..ed750a8 100644
--- a/tz/antarctica
+++ b/tz/antarctica
@@ -70,15 +70,30 @@
# Australian Antarctica Division informed us that Casey changed time
# zone to UTC+11 in "the morning of 22nd October 2016".
+# From Steffen Thorsen (2020-10-02, as corrected):
+# Based on information we have received from the Australian Antarctic
+# Division, Casey station and Macquarie Island station will move to Tasmanian
+# daylight savings time on Sunday 4 October. This will take effect from 0001
+# hrs on Sunday 4 October 2020 and will mean Casey and Macquarie Island will
+# be on the same time zone as Hobart. Some past dates too for this 3 hour
+# time change back and forth between UTC+8 and UTC+11 for Casey:
+# - 2018 Oct 7 4:00 - 2019 Mar 17 3:00 - 2019 Oct 4 3:00 - 2020 Mar 8 3:00
+# and now - 2020 Oct 4 0:01
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Antarctica/Casey 0 - -00 1969
- 8:00 - +08 2009 Oct 18 2:00
+Zone Antarctica/Casey 0 - -00 1969
+ 8:00 - +08 2009 Oct 18 2:00
11:00 - +11 2010 Mar 5 2:00
- 8:00 - +08 2011 Oct 28 2:00
+ 8:00 - +08 2011 Oct 28 2:00
11:00 - +11 2012 Feb 21 17:00u
- 8:00 - +08 2016 Oct 22
+ 8:00 - +08 2016 Oct 22
11:00 - +11 2018 Mar 11 4:00
- 8:00 - +08
+ 8:00 - +08 2018 Oct 7 4:00
+ 11:00 - +11 2019 Mar 17 3:00
+ 8:00 - +08 2019 Oct 4 3:00
+ 11:00 - +11 2020 Mar 8 3:00
+ 8:00 - +08 2020 Oct 4 0:01
+ 11:00 - +11
Zone Antarctica/Davis 0 - -00 1957 Jan 13
7:00 - +07 1964 Nov
0 - -00 1969 Feb
@@ -224,7 +239,7 @@ Zone Antarctica/Syowa 0 - -00 1957 Jan 29
# suggested by Bengt-Inge Larsson comment them out for now, and approximate
# with only UTC and CEST. Uncomment them when 2014b is more prevalent.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
#Rule Troll 2005 max - Mar 1 1:00u 1:00 +01
Rule Troll 2005 max - Mar lastSun 1:00u 2:00 +02
#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 +01
diff --git a/tz/asia b/tz/asia
index 106efad..3ebfcb4 100644
--- a/tz/asia
+++ b/tz/asia
@@ -70,7 +70,7 @@
###############################################################################
# These rules are stolen from the 'europe' file.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule EUAsia 1981 max - Mar lastSun 1:00u 1:00 S
Rule EUAsia 1979 1995 - Sep lastSun 1:00u 0 -
Rule EUAsia 1996 max - Oct lastSun 1:00u 0 -
@@ -114,7 +114,7 @@ Zone Asia/Kabul 4:36:48 - LMT 1890
# or
# (brief)
# http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 -
Rule Armenia 2011 only - Oct lastSun 2:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -140,7 +140,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
# http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
# http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 -
Rule Azer 1997 2015 - Oct lastSun 5:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -227,7 +227,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2
# http://www.thedailystar.net/newDesign/latest_news.php?nid=22817
# http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Dhaka 2009 only - Jun 19 23:00 1:00 -
Rule Dhaka 2009 only - Dec 31 24:00 0 -
@@ -303,7 +303,7 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
# generally esteemed a success, it was announced early in 1920 that it would
# not be repeated."
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Shang 1919 only - Apr 12 24:00 1:00 D
Rule Shang 1919 only - Sep 30 24:00 0 S
@@ -399,7 +399,7 @@ Rule Shang 1919 only - Sep 30 24:00 0 S
# the Yangtze river delta area during that period of time although the scope
# of such use will need to be investigated to determine.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Shang 1940 only - Jun 1 0:00 1:00 D
Rule Shang 1940 only - Oct 12 24:00 0 S
Rule Shang 1941 only - Mar 15 0:00 1:00 D
@@ -462,7 +462,7 @@ Rule Shang 1948 1949 - Sep 30 24:00 0 S #plan
# to begin on 17 April.
# http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule PRC 1986 only - May 4 2:00 1:00 D
Rule PRC 1986 1991 - Sep Sun>=11 2:00 0 S
Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D
@@ -846,7 +846,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928
# or dates for the 1942 and 1945 transitions.
# The Japanese occupation of Hong Kong began 1941-12-25.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule HK 1946 only - Apr 21 0:00 1:00 S
Rule HK 1946 only - Dec 1 3:30s 0 -
Rule HK 1947 only - Apr 13 3:30s 1:00 S
@@ -973,7 +973,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42
# until 1945-09-21 at 01:00, overriding Shanks & Pottenger.
# Likewise, use Yu-Cheng Chuang's data for DST in Taiwan.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Taiwan 1946 only - May 15 0:00 1:00 D
Rule Taiwan 1946 only - Oct 1 0:00 0 S
Rule Taiwan 1947 only - Apr 15 0:00 1:00 D
@@ -1099,7 +1099,7 @@ Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1
# The 1904 decree says that Macau changed from the meridian of
# Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Macau 1942 1943 - Apr 30 23:00 1:00 -
Rule Macau 1942 only - Nov 17 23:00 0 -
Rule Macau 1943 only - Sep 30 23:00 0 S
@@ -1157,7 +1157,7 @@ Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30
# Cyprus to remain united in time. Cyprus Mail 2017-10-17.
# https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
Rule Cyprus 1976 only - May 15 0:00 1:00 S
@@ -1534,7 +1534,7 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# be changed back to its previous state on the 24 hours of the
# thirtieth day of Shahrivar.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Iran 1978 1980 - Mar 20 24:00 1:00 -
Rule Iran 1978 only - Oct 20 24:00 0 -
Rule Iran 1979 only - Sep 18 24:00 0 -
@@ -1676,7 +1676,7 @@ Zone Asia/Tehran 3:25:44 - LMT 1916
# We have published a short article in English about the change:
# https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Iraq 1982 only - May 1 0:00 1:00 -
Rule Iraq 1982 1984 - Oct 1 0:00 0 -
Rule Iraq 1983 only - Mar 31 0:00 1:00 -
@@ -1699,6 +1699,10 @@ Zone Asia/Baghdad 2:57:40 - LMT 1890
# Israel
+# For more info about the motivation for DST in Israel, see:
+# Barak Y. Israel's Daylight Saving Time controversy. Israel Affairs.
+# 2020-08-11. https://doi.org/10.1080/13537121.2020.1806564
+
# From Ephraim Silverberg (2001-01-11):
#
# I coined "IST/IDT" circa 1988. Until then there were three
@@ -1720,7 +1724,7 @@ Zone Asia/Baghdad 2:57:40 - LMT 1890
# family is from India).
# From Shanks & Pottenger:
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 1940 only - Jun 1 0:00 1:00 D
Rule Zion 1942 1944 - Nov 1 0:00 0 S
Rule Zion 1943 only - Apr 1 2:00 1:00 D
@@ -1812,7 +1816,7 @@ Rule Zion 1988 only - Sep 4 0:00 0 S
# (except in 2002) is three nights before Yom Kippur [Day of Atonement]
# (the eve of the 7th of Tishrei in the lunar Hebrew calendar).
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 1989 only - Apr 30 0:00 1:00 D
Rule Zion 1989 only - Sep 3 0:00 0 S
Rule Zion 1990 only - Mar 25 0:00 1:00 D
@@ -1828,7 +1832,7 @@ Rule Zion 1993 only - Sep 5 0:00 0 S
# Ministry of Interior, Jerusalem, Israel. The spokeswoman can be reached by
# calling the office directly at 972-2-6701447 or 972-2-6701448.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 1994 only - Apr 1 0:00 1:00 D
Rule Zion 1994 only - Aug 28 0:00 0 S
Rule Zion 1995 only - Mar 31 0:00 1:00 D
@@ -1848,7 +1852,7 @@ Rule Zion 1995 only - Sep 3 0:00 0 S
#
# where YYYY is the relevant year.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 1996 only - Mar 15 0:00 1:00 D
Rule Zion 1996 only - Sep 16 0:00 0 S
Rule Zion 1997 only - Mar 21 0:00 1:00 D
@@ -1871,7 +1875,7 @@ Rule Zion 1999 only - Sep 3 2:00 0 S
#
# ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-2004.ps.gz
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 2000 only - Apr 14 2:00 1:00 D
Rule Zion 2000 only - Oct 6 1:00 0 S
Rule Zion 2001 only - Apr 9 1:00 1:00 D
@@ -1893,7 +1897,7 @@ Rule Zion 2004 only - Sep 22 1:00 0 S
#
# ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 2005 2012 - Apr Fri<=1 2:00 1:00 D
Rule Zion 2005 only - Oct 9 2:00 0 S
Rule Zion 2006 only - Oct 1 2:00 0 S
@@ -1913,7 +1917,7 @@ Rule Zion 2012 only - Sep 23 2:00 0 S
# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
# in March. DST ends at 02:00 on the last Sunday of October.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 max - Oct lastSun 2:00 0 S
@@ -2013,7 +2017,7 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880
# do in any POSIX or C platform. The "25:00" assumes zic from 2007 or later,
# which should be safe now.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Japan 1948 only - May Sat>=1 24:00 1:00 D
Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S
Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D
@@ -2090,7 +2094,7 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# From Paul Eggert (2013-12-11):
# As Steffen suggested, consider the past 21-month experiment to be DST.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Jordan 1973 only - Jun 6 0:00 1:00 S
Rule Jordan 1973 1975 - Oct 1 0:00 0 -
Rule Jordan 1974 1977 - May 1 0:00 1:00 S
@@ -2416,7 +2420,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk
# Our government cancels daylight saving time 6th of August 2005.
# From 2005-08-12 our GMT-offset is +6, w/o any daylight saving.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Kyrgyz 1992 1996 - Apr Sun>=7 0:00s 1:00 -
Rule Kyrgyz 1992 1996 - Sep lastSun 0:00 0 -
Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 -
@@ -2472,7 +2476,7 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
# follow and continued to use GMT+9:00 for interoperability.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule ROK 1948 only - Jun 1 0:00 1:00 D
Rule ROK 1948 only - Sep 12 24:00 0 S
Rule ROK 1949 only - Apr 3 0:00 1:00 D
@@ -2560,7 +2564,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
# Lebanon
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Lebanon 1920 only - Mar 28 0:00 1:00 S
Rule Lebanon 1920 only - Oct 25 0:00 0 -
Rule Lebanon 1921 only - Apr 3 0:00 1:00 S
@@ -2590,7 +2594,7 @@ Zone Asia/Beirut 2:22:00 - LMT 1880
2:00 Lebanon EE%sT
# Malaysia
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 -
Rule NBorneo 1935 1941 - Dec 14 0:00 0 -
#
@@ -2735,7 +2739,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé
# September daylight saving time ends. Source:
# http://zasag.mn/news/view/8969
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Mongol 1983 1984 - Apr 1 0:00 1:00 -
Rule Mongol 1983 only - Oct 1 0:00 0 -
# Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00,
@@ -2923,7 +2927,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
# "People laud PM's announcement to end DST"
# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S
Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 -
Rule Pakistan 2008 only - Jun 1 0:00 1:00 S
@@ -3217,15 +3221,42 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# From Sharef Mustafa (2019-10-18):
# Palestine summer time will end on midnight Oct 26th 2019 ...
-# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948
#
-# From Paul Eggert (2019-04-10):
-# For now, guess spring-ahead transitions are March's last Friday at 00:00.
+# From Steffen Thorsen (2020-10-20):
+# Some sources such as these say, and display on clocks, that DST ended at
+# midnight last year...
+# https://www.amad.ps/ar/post/320006
+#
+# From Tim Parenti (2020-10-20):
+# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms
+# a decision on (translated): "The start of the winter time in Palestine, by
+# delaying the clock by sixty minutes, starting from midnight on Friday /
+# Saturday corresponding to 26/10/2019."
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948
+
+# From Sharef Mustafa (2020-10-20):
+# As per the palestinian cabinet announcement yesterday , the day light saving
+# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes.
+# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584
+
+# From Tim Parenti (2020-10-20):
+# Predict future fall transitions at 01:00 on the Saturday preceding October's
+# last Sunday (i.e., Sat>=24). This is consistent with our predictions since
+# 2016, although the time of the change differed slightly in 2019.
+
+# From Pierre Cashon (2020-10-20):
+# The summer time this year started on March 28 at 00:00.
+# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284
+# 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 Tim Parenti (2016-10-19):
-# Predict fall transitions on October's last Saturday at 01:00 from now on.
+# 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).
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# 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 -
Rule EgyptAsia 1958 only - May 1 0:00 1:00 S
@@ -3239,10 +3270,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 -
Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 -
-Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
+Rule Palestine 2007 only - Sep 13 2:00 0 -
Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S
Rule Palestine 2008 only - Sep 1 0:00 0 -
-Rule Palestine 2009 only - Sep Fri>=1 1:00 0 -
+Rule Palestine 2009 only - Sep 4 1:00 0 -
Rule Palestine 2010 only - Mar 26 0:00 1:00 S
Rule Palestine 2010 only - Aug 11 0:00 0 -
Rule Palestine 2011 only - Apr 1 0:01 1:00 S
@@ -3251,12 +3282,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S
Rule Palestine 2011 only - Sep 30 0:00 0 -
Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S
Rule Palestine 2012 only - Sep 21 1:00 0 -
-Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
-Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 -
-Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
+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 max - Oct lastSat 1:00 0 -
-Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S
+Rule Palestine 2016 2018 - Oct Sat>=24 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 max - Mar Sat>=24 0:00 1:00 S
+Rule Palestine 2020 max - Oct Sat>=24 1:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
@@ -3325,7 +3360,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
# influence of the sources. There is no current abbreviation for DST,
# so use "PDT", the usual American style.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Phil 1936 only - Nov 1 0:00 1:00 D
Rule Phil 1937 only - Feb 1 0:00 0 S
Rule Phil 1954 only - Apr 12 0:00 1:00 D
@@ -3473,7 +3508,7 @@ Zone Asia/Colombo 5:19:24 - LMT 1880
5:30 - +0530
# Syria
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Syria 1920 1923 - Apr Sun>=15 2:00 1:00 S
Rule Syria 1920 1923 - Oct Sun>=1 2:00 0 -
Rule Syria 1962 only - Apr 29 2:00 1:00 S
diff --git a/tz/australasia b/tz/australasia
index ac44c04..aa7ab7f 100644
--- a/tz/australasia
+++ b/tz/australasia
@@ -13,7 +13,7 @@
# Please see the notes below for the controversy about "EST" versus "AEST" etc.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Aus 1917 only - Jan 1 0:01 1:00 D
Rule Aus 1917 only - Mar 25 2:00 0 S
Rule Aus 1942 only - Jan 1 2:00 1:00 D
@@ -32,7 +32,7 @@ Zone Australia/Darwin 8:43:20 - LMT 1895 Feb
9:30 Aus AC%sT
# Western Australia
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AW 1974 only - Oct lastSun 2:00s 1:00 D
Rule AW 1975 only - Mar Sun>=1 2:00s 0 S
Rule AW 1983 only - Oct lastSun 2:00s 1:00 D
@@ -70,7 +70,7 @@ Zone Australia/Eucla 8:35:28 - LMT 1895 Dec
# applies to all of the Whitsundays.
# http://www.australia.gov.au/about-australia/australian-story/austn-islands
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AQ 1971 only - Oct lastSun 2:00s 1:00 D
Rule AQ 1972 only - Feb lastSun 2:00s 0 S
Rule AQ 1989 1991 - Oct lastSun 2:00s 1:00 D
@@ -86,7 +86,7 @@ Zone Australia/Lindeman 9:55:56 - LMT 1895
10:00 Holiday AE%sT
# South Australia
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AS 1971 1985 - Oct lastSun 2:00s 1:00 D
Rule AS 1986 only - Oct 19 2:00s 1:00 D
Rule AS 1987 2007 - Oct lastSun 2:00s 1:00 D
@@ -114,7 +114,7 @@ Zone Australia/Adelaide 9:14:20 - LMT 1895 Feb
# http://www.bom.gov.au/climate/averages/tables/dst_times.shtml
# says King Island didn't observe DST from WWII until late 1971.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AT 1967 only - Oct Sun>=1 2:00s 1:00 D
Rule AT 1968 only - Mar lastSun 2:00s 0 S
Rule AT 1968 1985 - Oct lastSun 2:00s 1:00 D
@@ -147,7 +147,7 @@ Zone Australia/Currie 9:35:28 - LMT 1895 Sep
10:00 AT AE%sT
# Victoria
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AV 1971 1985 - Oct lastSun 2:00s 1:00 D
Rule AV 1972 only - Feb lastSun 2:00s 0 S
Rule AV 1973 1985 - Mar Sun>=1 2:00s 0 S
@@ -168,7 +168,7 @@ Zone Australia/Melbourne 9:39:52 - LMT 1895 Feb
10:00 AV AE%sT
# New South Wales
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule AN 1971 1985 - Oct lastSun 2:00s 1:00 D
Rule AN 1972 only - Feb 27 2:00s 0 S
Rule AN 1973 1981 - Mar Sun>=1 2:00s 0 S
@@ -197,7 +197,7 @@ Zone Australia/Broken_Hill 9:25:48 - LMT 1895 Feb
9:30 AS AC%sT
# Lord Howe Island
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule LH 1981 1984 - Oct lastSun 2:00 1:00 -
Rule LH 1982 1985 - Mar Sun>=1 2:00 0 -
Rule LH 1985 only - Oct lastSun 2:00 0:30 -
@@ -252,8 +252,9 @@ Zone Antarctica/Macquarie 0 - -00 1899 Nov
10:00 Aus AE%sT 1919 Apr 1 0:00s
0 - -00 1948 Mar 25
10:00 Aus AE%sT 1967
- 10:00 AT AE%sT 2010 Apr 4 3:00
- 11:00 - +11
+ 10:00 AT AE%sT 2010
+ 10:00 1:00 AEDT 2011
+ 10:00 AT AE%sT
# Christmas
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -380,7 +381,20 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# From Michael Deckers (2019-08-06):
# https://www.laws.gov.fj/LawsAsMade/downloadfile/848
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# From Raymond Kumar (2020-10-08):
+# [DST in Fiji] is from December 20th 2020, till 17th January 2021.
+# From Alan Mintz (2020-10-08):
+# https://www.laws.gov.fj/LawsAsMade/GetFile/1071
+# From Tim Parenti (2020-10-08):
+# https://www.fijivillage.com/news/Daylight-saving-from-Dec-20th-this-year-to-Jan-17th-2021-8rf4x5/
+# "Minister for Employment, Parveen Bala says they had never thought of
+# stopping daylight saving. He says it was just to decide on when it should
+# start and end. Bala says it is a short period..."
+# Since the end date is still in line with our ongoing predictions, assume for
+# now that the later-than-usual start date is a one-time departure from the
+# recent second Sunday in November pattern.
+
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
Rule Fiji 2009 only - Nov 29 2:00 1:00 -
@@ -391,7 +405,9 @@ Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 2015 max - Jan Sun>=12 3:00 0 -
-Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 -
+Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 -
+Rule Fiji 2020 only - Dec 20 2:00 1:00 -
+Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13
@@ -409,7 +425,7 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete
# Guam
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf
# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf
Rule Guam 1959 only - Jun 27 2:00 1:00 D
@@ -520,7 +536,7 @@ Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe
12:00 - +12
# New Caledonia
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NC 1977 1978 - Dec Sun>=1 0:00 1:00 -
Rule NC 1978 1979 - Feb 27 0:00 0 -
Rule NC 1996 only - Dec 1 2:00s 1:00 -
@@ -535,7 +551,7 @@ Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 # Nouméa
# New Zealand
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NZ 1927 only - Nov 6 2:00 1:00 S
Rule NZ 1928 only - Mar 4 2:00 0 M
Rule NZ 1928 1933 - Oct Sun>=8 2:00 0:30 S
@@ -587,7 +603,7 @@ Link Pacific/Auckland Antarctica/McMurdo
# Cook Is
# From Shanks & Pottenger:
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Cook 1978 only - Nov 12 0:00 0:30 -
Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 -
Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 -
@@ -732,7 +748,7 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
# That web page currently lists transitions for 2012/3 and 2013/4.
# Assume the pattern instituted in 2012 will continue indefinitely.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule WS 2010 only - Sep lastSun 0:00 1 -
Rule WS 2011 only - Apr Sat>=1 4:00 0 -
Rule WS 2011 only - Sep lastSat 3:00 1 -
@@ -776,7 +792,7 @@ Zone Pacific/Fakaofo -11:24:56 - LMT 1901
13:00 - +13
# Tonga
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Tonga 1999 only - Oct 7 2:00s 1:00 -
Rule Tonga 2000 only - Mar 19 2:00s 0 -
Rule Tonga 2000 2001 - Nov Sun>=1 2:00 1:00 -
@@ -857,7 +873,7 @@ Zone Pacific/Wake 11:06:28 - LMT 1901
# Vanuatu
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Vanuatu 1983 only - Sep 25 0:00 1:00 -
Rule Vanuatu 1984 1991 - Mar Sun>=23 0:00 0 -
Rule Vanuatu 1984 only - Oct 23 0:00 1:00 -
diff --git a/tz/backzone b/tz/backzone
index 91fa21d..563aff6 100644
--- a/tz/backzone
+++ b/tz/backzone
@@ -150,7 +150,7 @@ Zone Africa/Douala 0:38:48 - LMT 1912
# Whitman gives Mar 31 - Aug 31 for 1931 on.
# The International Hydrographic Bulletin, 1932-33, p 63 says that
# Sierra Leone would advance its clocks by 20 minutes on 1933-10-01.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule SL 1935 1942 - Jun 1 0:00 0:40 -0020
Rule SL 1935 1942 - Oct 1 0:00 0 -01
Rule SL 1957 1962 - Jun 1 0:00 1:00 +01
@@ -351,7 +351,7 @@ Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe-à-Pitre
# Pottenger data. The post-1970 entries have been corrected, but the
# pre-1970 entries are unchecked and probably have errors.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Mont 1917 only - Mar 25 2:00 1:00 D
Rule Mont 1917 only - Apr 24 0:00 0 S
Rule Mont 1919 only - Mar 31 2:30 1:00 D
@@ -459,7 +459,34 @@ Zone Asia/Aden 2:59:54 - LMT 1950
3:00 - +03
# Bahrain
-Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah
+#
+# From Paul Eggert (2020-07-23):
+# Most of this data comes from:
+# Stewart A. Why Gulf Standard Time is far from standard: the fascinating story
+# behind the time zone's invention. The National (Abu Dhabi). 2020-07-22.
+# https://www.thenational.ae/arts-culture/why-gulf-standard-time-is-far-from-standard-the-fascinating-story-behind-the-time-zone-s-invention-1.1052589
+# Stewart writes that before 1941 some companies in Bahrain were at +0330 and
+# others at +0323. Reginald George Alban, a British political agent based in
+# Manama, worked to standardize this, and from 1941-07-20 Bahrain was at
+# +0330. However, BOAC asked that clocks be moved to gain more light at day's
+# end, so Bahrain switched to +04 on 1944-01-01.
+#
+# Re the 1941 transition, Stewart privately sent me this citation:
+# "File 16/53 Enquiries Re: Calculation of Local Time", British Library: India
+# Office Records and Private Papers, IOR/R/15/2/1564, in Qatar Digital Library
+# https://www.qdl.qa/archive/81055/vdc_100000000282.0x00012b
+# It says there was no real standard in Bahrain before 1941-07-20.
+# +0330 was used by steamers of the British India Co, by Petroleum Concessions
+# and by Cable & Wireless; +0323 was used by the Eastern Bank Ltd, BOAC, and
+# Bahrein Petroleum (Bapco), and California Arabian Standard Oil Co (Casoc)
+# adopted DST effective 1941-05-24. Alban suggested adopting DST, R.B. Coomb
+# of C&W countersuggested +0330, and although C.A. Rodstrom of Casoc (formerly
+# of Bapco) stated that Bahrain had formerly used +0330 before Bapco arrived
+# but Bapco switched to +0323 because of "constant confusion", the consensus
+# was +0330. The government adopted +0330 in 1941-07-20 and companies seem to
+# have switched by 08-01. No time of day was given for the 1940s transitions.
+Zone Asia/Bahrain 3:22:20 - LMT 1941 Jul 20 # Manamah
+ 3:30 - +0330 1944 Jan 1
4:00 - +04 1972 Jun
3:00 - +03
diff --git a/tz/date.1 b/tz/date.1
index 6e79cc1..432cab1 100644
--- a/tz/date.1
+++ b/tz/date.1
@@ -27,7 +27,9 @@ date \- show and set date and time
.de q
\\$3\*(lq\\$1\*(rq\\$2
..
-.I Date
+The
+.B date
+command
without arguments writes the date and time to the standard output in
the form
.ce 1
diff --git a/tz/date.c b/tz/date.c
index 2cc533f..ef4e4d4 100644
--- a/tz/date.c
+++ b/tz/date.c
@@ -59,8 +59,7 @@ static _Noreturn void usage(void);
int
main(const int argc, char *argv[])
{
- register const char * format;
- register const char * cp;
+ register const char * format = "+%+";
register int ch;
register bool rflag = false;
time_t t;
@@ -77,7 +76,6 @@ main(const int argc, char *argv[])
textdomain(TZ_DOMAIN);
#endif /* HAVE_GETTEXT */
t = time(NULL);
- format = NULL;
while ((ch = getopt(argc, argv, "ucr:")) != EOF && ch != -1) {
switch (ch) {
default:
@@ -108,20 +106,17 @@ main(const int argc, char *argv[])
break;
}
}
- while (optind < argc) {
- cp = argv[optind++];
- if (*cp == '+')
- if (format == NULL)
- format = cp + 1;
- else {
- fprintf(stderr,
-_("date: error: multiple formats in command line\n"));
- usage();
- }
- else {
- fprintf(stderr, _("date: unknown operand: %s\n"), cp);
- usage();
- }
+ if (optind < argc) {
+ if (argc - optind != 1) {
+ fprintf(stderr,
+ _("date: error: multiple operands in command line\n"));
+ usage();
+ }
+ format = argv[optind];
+ if (*format != '+') {
+ fprintf(stderr, _("date: unknown operand: %s\n"), format);
+ usage();
+ }
}
display(format, t);
@@ -186,7 +181,7 @@ display(char const *format, time_t now)
errensure();
return;
}
- timeout(stdout, format ? format : "%+", tmp);
+ timeout(stdout, format, tmp);
putchar('\n');
fflush(stdout);
fflush(stderr);
@@ -207,8 +202,6 @@ timeout(FILE *fp, char const *format, struct tm const *tmp)
size_t size;
struct tm tm;
- if (*format == '\0')
- return;
if (!tmp) {
fprintf(stderr, _("date: error: time out of range\n"));
errensure();
@@ -225,13 +218,12 @@ timeout(FILE *fp, char const *format, struct tm const *tmp)
errensure();
exit(retval);
}
- cp[0] = '\1';
result = strftime(cp, size, format, tmp);
- if (result != 0 || cp[0] == '\0')
+ if (result != 0)
break;
size += INCR;
cp = realloc(cp, size);
}
- fwrite(cp, 1, result, fp);
+ fwrite(cp + 1, 1, result - 1, fp);
free(cp);
}
diff --git a/tz/europe b/tz/europe
index 5593c60..ea23736 100644
--- a/tz/europe
+++ b/tz/europe
@@ -388,7 +388,7 @@
# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print
# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# Summer Time Act, 1916
Rule GB-Eire 1916 only - May 21 2:00s 1:00 BST
Rule GB-Eire 1916 only - Oct 1 2:00s 0 GMT
@@ -529,7 +529,7 @@ Link Europe/London Europe/Isle_of_Man
# The following is like GB-Eire and EU, except with standard time in
# summer and negative daylight saving time in winter. It is for when
# negative SAVE values are used.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Eire 1971 only - Oct 31 2:00u -1:00 -
Rule Eire 1972 1980 - Mar Sun>=16 2:00u 0 -
Rule Eire 1972 1980 - Oct Sun>=23 2:00u -1:00 -
@@ -566,7 +566,7 @@ Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
# predecessor organization, the European Communities.
# For brevity they are called "EU rules" elsewhere in this file.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S
Rule EU 1977 only - Sep lastSun 1:00u 0 -
Rule EU 1978 only - Oct 1 1:00u 0 -
@@ -606,13 +606,13 @@ Rule C-Eur 1944 only - Oct 2 2:00s 0 -
# corrected in version 2008d). The circumstantial evidence is simply the
# tz database itself, as seen below:
#
-# Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
+# Zone Europe/Paris ...
# 0:00 France WE%sT 1945 Sep 16 3:00
#
-# Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
+# Zone Europe/Monaco ...
# 0:00 France WE%sT 1945 Sep 16 3:00
#
-# Zone Europe/Belgrade 1:22:00 - LMT 1884
+# Zone Europe/Belgrade ...
# 1:00 1:00 CEST 1945 Sep 16 2:00s
#
# Rule France 1945 only - Sep 16 3:00 0 -
@@ -658,7 +658,7 @@ Rule E-Eur 1996 max - Oct lastSun 0:00 0 -
#
# The 1917-1921 decree URLs are from Alexander Belopolsky (2016-08-23).
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Russia 1917 only - Jul 1 23:00 1:00 MST # Moscow Summer Time
#
# Decree No. 142 (1917-12-22) http://istmat.info/node/28137
@@ -772,7 +772,7 @@ Zone EET 2:00 EU EE%sT
# Albania
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Albania 1940 only - Jun 16 0:00 1:00 S
Rule Albania 1942 only - Nov 2 3:00 0 -
Rule Albania 1943 only - Mar 29 2:00 1:00 S
@@ -826,7 +826,7 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am.
# Shanks had this right. Source: Die Weltpresse, 5. Oktober 1946, page 5.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Austria 1920 only - Apr 5 2:00s 1:00 S
Rule Austria 1920 only - Sep 13 2:00s 0 -
Rule Austria 1946 only - Apr 14 2:00s 1:00 S
@@ -913,7 +913,7 @@ Zone Europe/Minsk 1:50:16 - LMT 1880
# The 1918 rules are listed for completeness; they apply to unoccupied Belgium.
# Assume Brussels switched to WET in 1918 when the armistice took effect.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Belgium 1918 only - Mar 9 0:00s 1:00 S
Rule Belgium 1918 1919 - Oct Sat>=1 23:00s 0 -
Rule Belgium 1919 only - Mar 1 23:00s 1:00 S
@@ -973,7 +973,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880
# EET -> EETDST is in 03:00 Local time in last Sunday of March ...
# EETDST -> EET is in 04:00 Local time in last Sunday of October
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Bulg 1979 only - Mar 31 23:00 1:00 S
Rule Bulg 1979 only - Oct 1 1:00 0 -
Rule Bulg 1980 1982 - Apr Sat>=1 23:00 1:00 S
@@ -1005,7 +1005,7 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
# We know of no English-language name for historical Czech winter time;
# abbreviate it as "GMT", as it happened to be GMT.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Czech 1945 only - Apr Mon>=1 2:00s 1:00 S
Rule Czech 1945 only - Oct 1 2:00s 0 -
Rule Czech 1946 only - May 6 2:00s 1:00 S
@@ -1029,17 +1029,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# Denmark, Faroe Islands, and Greenland
# From Jesper Nørgaard Welen (2005-04-26):
-# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
-# [introducing standard time] was in effect from 1894-01-01....
-# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL
+# the law [introducing standard time] was in effect from 1894-01-01....
+# The page https://www.retsinformation.dk/eli/lta/1893/83
# confirms this, and states that the law was put forth 1893-03-29.
#
# The EU [actually, EEC and Euratom] treaty with effect from 1973:
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL
+# https://www.retsinformation.dk/eli/lta/1972/21100
#
# This provoked a new law from 1974 to make possible summer time changes
# in subsequent decrees with the law
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL
+# https://www.retsinformation.dk/eli/lta/1974/223
#
# It seems however that no decree was set forward until 1980. I have
# not found any decree, but in another related law, the effecting DST
@@ -1051,7 +1050,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# The law is about the management of the extra hour, concerning
# working hours reported and effect on obligatory-rest rules (which
# was suspended on that night):
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL
+# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267
# From Jesper Nørgaard Welen (2005-06-11):
# The Herning Folkeblad (1980-09-26) reported that the night between
@@ -1061,7 +1060,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# Hence the "02:00" of the 1980 law refers to standard time, not
# wall-clock time, and so the EU rules were in effect in 1980.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Denmark 1916 only - May 14 23:00 1:00 S
Rule Denmark 1916 only - Sep 30 23:00 0 -
Rule Denmark 1940 only - May 15 0:00 1:00 S
@@ -1163,7 +1162,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
# http://naalakkersuisut.gl/~/media/Nanoq/Files/Attached%20Files/Engelske-tekster/Legislation/Executive%20Order%20National%20Park.rtf
# It is their only National Park.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D
Rule Thule 1991 1992 - Sep lastSun 2:00 0 S
Rule Thule 1993 2006 - Apr Sun>=1 2:00 1:00 D
@@ -1294,7 +1293,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# From Paul Eggert (2014-06-14):
# Go with Oja over Shanks.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Finland 1942 only - Apr 2 24:00 1:00 S
Rule Finland 1942 only - Oct 4 1:00 0 -
Rule Finland 1981 1982 - Mar lastSun 2:00 1:00 S
@@ -1326,10 +1325,58 @@ Link Europe/Helsinki Europe/Mariehamn
# Françoise Gauquelin, Problèmes de l'heure résolus en astrologie,
# Guy Trédaniel, Paris 1987
+# From Michael Deckers (2020-06-11):
+# the law of 1891 <https://gallica.bnf.fr/ark:/12148/bpt6k64415343.texteImage>
+# was published on 1891-03-15, so it could only take force on 1891-03-16.
+
+# From Michael Deckers (2020-06-10):
+# Le Gaulois, 1911-03-11, page 1/6, online at
+# https://www.retronews.fr/societe/echo-de-presse/2018/01/29/1911-change-lheure-de-paris
+# ... [ Instantly, all pressure driven clock dials halted... Nine minutes and
+# twenty-one seconds later the hands resumed their circular motion. ]
+# There are also precise reports about how the change was prepared in train
+# stations: all the publicly visible clocks stopped at midnight railway time
+# (or were covered), only the chief of service had a watch, labeled
+# "Heure ancienne", that he kept running until it reached 00:04:21, when
+# he announced "Heure nouvelle". See the "Le Petit Journal 1911-03-11".
+# https://gallica.bnf.fr/ark:/12148/bpt6k6192911/f1.item.zoom
+#
+# From Michael Deckers (2020-06-12):
+# That "all French clocks stopped" for 00:09:21 is a misreading of French
+# newspapers; this sort of adjustment applies only to certain
+# remote-controlled clocks ("pendules pneumatiques", of which there existed
+# perhaps a dozen in Paris, and which simply could not be set back remotely),
+# but not to all the clocks in all French towns and villages. For instance,
+# the following story in the "Courrier de Saône-et-Loire" 1911-03-11, page 2:
+# only works if legal time was stepped back (was not monotone): ...
+# [One can observe that children who had been born at midnight less 5
+# minutes and who had died at midnight of the old time, would turn out to
+# be dead before being born, time having been set back and having
+# suppressed 9 minutes and 25 seconds of their existence, that is, more
+# than they could spend.]
+#
+# From Paul Eggert (2020-06-12):
+# French time in railway stations was legally five minutes behind civil time,
+# which explains why railway "old time" ran to 00:04:21 instead of to 00:09:21.
+# The law's text (which Michael Deckers noted is at
+# <https://gallica.bnf.fr/ark:/12148/bpt6k2022333z/f2>) says only that
+# at 1911-03-11 00:00 legal time was that of Paris mean time delayed by
+# nine minutes and twenty-one seconds, and does not say how the
+# transition from Paris mean time was to occur.
+#
+# tzdb has no way to represent stopped clocks. As the railway practice
+# was to keep a watch running on "old time" to decide when to restart
+# the other clocks, this could be modeled as a transition for "old time" at
+# 00:09:21. However, since the law was ambiguous and clocks outside railway
+# stations were probably done haphazardly with the popular impression being
+# that the transition was done at 00:00 "old time", simply leave the time
+# blank; this causes zic to default to 00:00 "old time" which is good enough.
+# Do something similar for the 1891-03-16 transition. There are similar
+# problems in Algiers, Monaco and Tunis.
#
# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule France 1916 only - Jun 14 23:00s 1:00 S
Rule France 1916 1919 - Oct Sun>=1 23:00s 0 -
Rule France 1917 only - Mar 24 23:00s 1:00 S
@@ -1389,13 +1436,11 @@ Rule France 1945 only - Sep 16 3:00 0 -
# go with Excoffier's 28/3/76 0hUT and 25/9/76 23hUT.
Rule France 1976 only - Mar 28 1:00 1:00 S
Rule France 1976 only - Sep 26 1:00 0 -
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time, and Whitman 0:09:05,
-# but Howse quotes the actual French legislation as saying 0:09:21.
-# Go with Howse. Howse writes that the time in France was officially based
+# Howse writes that the time in France was officially based
# on PMT-0:09:21 until 1978-08-09, when the time base finally switched to UTC.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
- 0:09:21 - PMT 1911 Mar 11 0:01 # Paris MT
+Zone Europe/Paris 0:09:21 - LMT 1891 Mar 16
+ 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time
# Shanks & Pottenger give 1940 Jun 14 0:00; go with Excoffier and Le Corre.
0:00 France WE%sT 1940 Jun 14 23:00
# Le Corre says Paris stuck with occupied-France time after the liberation;
@@ -1424,7 +1469,7 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
# this was equivalent to UT +03, not +04.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Germany 1946 only - Apr 14 2:00s 1:00 S
Rule Germany 1946 only - Oct 7 2:00s 0 -
Rule Germany 1947 1949 - Oct Sun>=1 2:00s 0 -
@@ -1476,7 +1521,7 @@ Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2 0:00s
1:00 EU CE%sT
# Greece
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# Whitman gives 1932 Jul 5 - Nov 1; go with Shanks & Pottenger.
Rule Greece 1932 only - Jul 7 0:00 1:00 S
Rule Greece 1932 only - Sep 1 0:00 0 -
@@ -1511,38 +1556,73 @@ Zone Europe/Athens 1:34:52 - LMT 1895 Sep 14
2:00 EU EE%sT
# Hungary
-# From Paul Eggert (2014-07-15):
-# Dates for 1916-1945 are taken from:
-# Oross A. Jelen a múlt jövője: a nyári időszámítás Magyarországon 1916-1945.
-# National Archives of Hungary (2012-10-29).
-# http://mnl.gov.hu/a_het_dokumentuma/a_nyari_idoszamitas_magyarorszagon_19161945.html
-# This source does not always give times, which are taken from Shanks
-# & Pottenger (which disagree about the dates).
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-Rule Hungary 1918 only - Apr 1 3:00 1:00 S
-Rule Hungary 1918 only - Sep 16 3:00 0 -
-Rule Hungary 1919 only - Apr 15 3:00 1:00 S
-Rule Hungary 1919 only - Nov 24 3:00 0 -
+
+# From Michael Deckers (2020-06-09):
+# an Austrian encyclopedia of railroads of 1913, online at
+# http://www.zeno.org/Roell-1912/A/Eisenbahnzeit
+# says that the switch [to CET] happened on 1890-11-01.
+
+# From Géza Nyáry (2020-06-07):
+# Data for 1918-1983 are based on the archive database of Library Hungaricana.
+# The dates are collected from original, scanned governmental orders,
+# bulletins, instructions and public press.
+# [See URLs below.]
+
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1918/?pg=238
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1919/?pg=808
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1920/?pg=201
+Rule Hungary 1918 1919 - Apr 15 2:00 1:00 S
+Rule Hungary 1918 1920 - Sep Mon>=15 3:00 0 -
+Rule Hungary 1920 only - Apr 5 2:00 1:00 S
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1945/?pg=882
Rule Hungary 1945 only - May 1 23:00 1:00 S
-Rule Hungary 1945 only - Nov 1 0:00 0 -
+Rule Hungary 1945 only - Nov 1 1:00 0 -
+# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1946_03/?pg=49
Rule Hungary 1946 only - Mar 31 2:00s 1:00 S
-Rule Hungary 1946 1949 - Oct Sun>=1 2:00s 0 -
+# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1946_09/?pg=54
+Rule Hungary 1946 only - Oct 7 2:00 0 -
+# https://library.hungaricana.hu/hu/view/KulfBelfHirek_1947_04_1__001-123/?pg=90
+# https://library.hungaricana.hu/hu/view/DunantuliNaplo_1947_09/?pg=128
+# https://library.hungaricana.hu/hu/view/KulfBelfHirek_1948_03_3__001-123/?pg=304
+# https://library.hungaricana.hu/hu/view/Zala_1948_09/?pg=64
+# https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=53
+# https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=160
+# https://library.hungaricana.hu/hu/view/UjSzo_1949_01-04/?pg=102
+# https://library.hungaricana.hu/hu/view/KeletMagyarorszag_1949_03/?pg=96
+# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1949_09/?pg=94
Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 S
-Rule Hungary 1950 only - Apr 17 2:00s 1:00 S
-Rule Hungary 1950 only - Oct 23 2:00s 0 -
-Rule Hungary 1954 1955 - May 23 0:00 1:00 S
-Rule Hungary 1954 1955 - Oct 3 0:00 0 -
-Rule Hungary 1956 only - Jun Sun>=1 0:00 1:00 S
-Rule Hungary 1956 only - Sep lastSun 0:00 0 -
-Rule Hungary 1957 only - Jun Sun>=1 1:00 1:00 S
-Rule Hungary 1957 only - Sep lastSun 3:00 0 -
-Rule Hungary 1980 only - Apr 6 1:00 1:00 S
+Rule Hungary 1947 1949 - Oct Sun>=1 2:00s 0 -
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1954/?pg=513
+Rule Hungary 1954 only - May 23 0:00 1:00 S
+Rule Hungary 1954 only - Oct 3 0:00 0 -
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1955/?pg=398
+Rule Hungary 1955 only - May 22 2:00 1:00 S
+Rule Hungary 1955 only - Oct 2 3:00 0 -
+# https://library.hungaricana.hu/hu/view/HevesMegyeiNepujsag_1956_06/?pg=0
+# https://library.hungaricana.hu/hu/view/EszakMagyarorszag_1956_06/?pg=6
+# https://library.hungaricana.hu/hu/view/SzolnokMegyeiNeplap_1957_04/?pg=120
+# https://library.hungaricana.hu/hu/view/PestMegyeiHirlap_1957_09/?pg=143
+Rule Hungary 1956 1957 - Jun Sun>=1 2:00 1:00 S
+Rule Hungary 1956 1957 - Sep lastSun 3:00 0 -
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=189
+Rule Hungary 1980 only - Apr 6 0:00 1:00 S
+Rule Hungary 1980 only - Sep 28 1:00 0 -
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227
+# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1981_01/?pg=79
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1982/?pg=115
+# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1983/?pg=85
+Rule Hungary 1981 1983 - Mar lastSun 0:00 1:00 S
+Rule Hungary 1981 1983 - Sep lastSun 1:00 0 -
+#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Budapest 1:16:20 - LMT 1890 Oct
+Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1
1:00 C-Eur CE%sT 1918
- 1:00 Hungary CE%sT 1941 Apr 8
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1941/?pg=1204
+# https://library.hungaricana.hu/hu/view/OGYK_RT_1942/?pg=3955
+ 1:00 Hungary CE%sT 1941 Apr 7 23:00
1:00 C-Eur CE%sT 1945
- 1:00 Hungary CE%sT 1980 Sep 28 2:00s
+ 1:00 Hungary CE%sT 1984
1:00 EU CE%sT
# Iceland
@@ -1578,7 +1658,7 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct
# The information below is taken from the 1988 Almanak; see
# http://www.almanak.hi.is/klukkan.html
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Iceland 1917 1919 - Feb 19 23:00 1:00 -
Rule Iceland 1917 only - Oct 21 1:00 0 -
Rule Iceland 1918 1919 - Nov 16 1:00 0 -
@@ -1670,7 +1750,7 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
# to 1944-06-04; although Rome was an open city during this period, it
# was effectively controlled by Germany.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Italy 1916 only - Jun 3 24:00 1:00 S
Rule Italy 1916 1917 - Sep 30 24:00 0 -
Rule Italy 1917 only - Mar 31 24:00 1:00 S
@@ -1780,7 +1860,7 @@ Link Europe/Rome Europe/San_Marino
# urged Lithuania and Estonia to adopt a similar time policy, but it
# appears that they will not do so....
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Latvia 1989 1996 - Mar lastSun 2:00s 1:00 S
Rule Latvia 1989 1996 - Sep lastSun 2:00s 0 -
@@ -1873,7 +1953,7 @@ Zone Europe/Vilnius 1:41:16 - LMT 1880
# Luxembourg
# Whitman disagrees with most of these dates in minor ways;
# go with Shanks & Pottenger.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Lux 1916 only - May 14 23:00 1:00 S
Rule Lux 1916 only - Oct 1 1:00 0 -
Rule Lux 1917 only - Apr 28 23:00 1:00 S
@@ -1914,7 +1994,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
# From Paul Eggert (2016-10-21):
# Assume 1900-1972 was like Rome, overriding Shanks.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Malta 1973 only - Mar 31 0:00s 1:00 S
Rule Malta 1973 only - Sep 29 0:00s 0 -
Rule Malta 1974 only - Apr 21 0:00s 1:00 S
@@ -1987,7 +2067,7 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
# says the 2014-03-30 spring-forward transition was at 02:00 local time.
# Guess that since 1997 Moldova has switched one hour before the EU.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Moldova 1997 max - Mar lastSun 2:00 1:00 S
Rule Moldova 1997 max - Oct lastSun 3:00 0 -
@@ -2005,11 +2085,24 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
2:00 Moldova EE%sT
# Monaco
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
+#
+# From Michael Deckers (2020-06-12):
+# In the "Journal de Monaco" of 1892-05-24, online at
+# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/b1c67c12c5af11b41ea888fb048e4fe8.pdf
+# we read: ...
+# [In virtue of a Sovereign Ordinance of the May 13 of the current [year],
+# legal time in the Principality will be set to, from the date of June 1,
+# 1892 onwards, to the meridian of Paris, as in France.]
+# In the "Journal de Monaco" of 1911-03-28, online at
+# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/de74ffb7db53d4f599059fe8f0ed482a.pdf
+# we read an ordinance of 1911-03-16: ...
+# [Legal time in the Principality will be set, from the date of promulgation
+# of the present ordinance, to legal time in France.... Consequently, legal
+# time will be retarded by 9 minutes and 21 seconds.]
+#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
- 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time
+Zone Europe/Monaco 0:29:32 - LMT 1892 Jun 1
+ 0:09:21 - PMT 1911 Mar 29 # Paris Mean Time
0:00 France WE%sT 1945 Sep 16 3:00
1:00 France CE%sT 1977
1:00 EU CE%sT
@@ -2057,7 +2150,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
# The data entries before 1945 are taken from
# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
Rule Neth 1916 only - Oct 1 0:00 0 AMT # Amsterdam Mean Time
Rule Neth 1917 only - Apr 16 2:00s 1:00 NST
@@ -2094,7 +2187,7 @@ Zone Europe/Amsterdam 0:19:32 - LMT 1835
# Norway
# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
# Pottenger.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Norway 1916 only - May 22 1:00 1:00 S
Rule Norway 1916 only - Sep 30 0:00 0 -
Rule Norway 1945 only - Apr 2 2:00s 1:00 S
@@ -2163,7 +2256,7 @@ Link Europe/Oslo Arctic/Longyearbyen
# The 1919 dates and times can be found in Tygodnik Urzędowy nr 1 (1919-03-20),
# <http://www.wbc.poznan.pl/publication/32156> pp 1-2.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Poland 1918 1919 - Sep 16 2:00s 0 -
Rule Poland 1919 only - Apr 15 2:00s 1:00 S
Rule Poland 1944 only - Apr 3 2:00s 1:00 S
@@ -2234,7 +2327,7 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal
# harmonized with EU rules), and that they stayed +0:00 that winter.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not
# done every year, depending on what Spain did, because of railroad schedules.
# Go with Shanks & Pottenger.
@@ -2347,7 +2440,7 @@ Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
# assume that Romania and Moldova switched to EU rules in 1997,
# the same year as Bulgaria.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Romania 1932 only - May 21 0:00s 1:00 S
Rule Romania 1932 1939 - Oct Sun>=1 0:00s 0 -
Rule Romania 1933 1939 - Apr Sun>=2 0:00s 1:00 S
@@ -3445,14 +3538,14 @@ Link Europe/Prague Europe/Bratislava
# fallback transition from the next day's 00:59... to 00:00.
# From Michael Deckers (2016-12-15):
-# The Royal Decree of 1900-06-26 quoted by Planesas, online at
+# The Royal Decree of 1900-07-26 quoted by Planesas, online at
# https://www.boe.es/datos/pdfs/BOE//1900/209/A00383-00384.pdf
# says in its article 5 (my translation):
# These dispositions will enter into force beginning with the
# instant at which, according to the time indicated in article 1,
# the 1st day of January of 1901 will begin.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Spain 1918 only - Apr 15 23:00 1:00 S
Rule Spain 1918 1919 - Oct 6 24:00s 0 -
Rule Spain 1919 only - Apr 6 23:00 1:00 S
@@ -3589,7 +3682,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
# By the end of the 18th century clocks and watches became commonplace
# and their performance improved enormously. Communities began to keep
# mean time in preference to apparent time - Geneva from 1780 ....
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# From Whitman (who writes "Midnight?"):
# Rule Swiss 1940 only - Nov 2 0:00 1:00 S
# Rule Swiss 1940 only - Dec 31 0:00 0 -
@@ -3676,7 +3769,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
# 1853-07-16, though it probably occurred at some other date in Zurich, and
# legal civil time probably changed at still some other transition date.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -3825,7 +3918,7 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
# Although Google Translate misfires on that source, it looks like
# Turkey reversed last month's decision, and so will stay at +03.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Turkey 1916 only - May 1 0:00 1:00 S
Rule Turkey 1916 only - Oct 1 0:00 0 -
Rule Turkey 1920 only - Mar 28 0:00 1:00 S
@@ -3983,7 +4076,7 @@ Zone Europe/Kiev 2:02:04 - LMT 1880
2:00 1:00 EEST 1991 Sep 29 3:00
2:00 E-Eur EE%sT 1995
2:00 EU EE%sT
-# Ruthenia used CET 1990/1991.
+# 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
diff --git a/tz/leap-seconds.list b/tz/leap-seconds.list
index ac153da..e897a86 100644
--- a/tz/leap-seconds.list
+++ b/tz/leap-seconds.list
@@ -204,10 +204,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
-# Updated through IERS Bulletin C59
-# File expires on: 28 December 2020
+# Updated through IERS Bulletin C60
+# File expires on: 28 June 2021
#
-#@ 3818102400
+#@ 3833827200
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -252,4 +252,4 @@
# the hash line is also ignored in the
# computation.
#
-#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
+#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c
diff --git a/tz/leapseconds.awk b/tz/leapseconds.awk
index 924ade9..1d3c606 100755
--- a/tz/leapseconds.awk
+++ b/tz/leapseconds.awk
@@ -105,8 +105,10 @@ END {
print ""
print "# UTC timestamp when this leap second list expires."
print "# Any additional leap seconds will come after this."
- print "# This Expires line is commented out for now,"
- print "# so that pre-2020a zic implementations do not reject this file."
+ if (! EXPIRES_LINE) {
+ print "# This Expires line is commented out for now,"
+ print "# so that pre-2020a zic implementations do not reject this file."
+ }
printf "%sExpires %.4d\t%s\t%.2d\t%.2d:%.2d:%.2d\n", \
EXPIRES_LINE ? "" : "#", \
ss_year, monthabbr[ss_month], ss_mday, ss_hour, ss_min, ss_sec
diff --git a/tz/localtime.c b/tz/localtime.c
index 6623eac..d3e406b 100644
--- a/tz/localtime.c
+++ b/tz/localtime.c
@@ -1355,8 +1355,9 @@ zoneinit(struct state *sp, char const *name)
}
static void
-tzsetlcl(char const *name)
+tzset_unlocked(void)
{
+ char const *name = getenv("TZ");
struct state *sp = lclptr;
int lcl = name ? strlen(name) < sizeof lcl_TZname : -1;
if (lcl < 0
@@ -1377,23 +1378,6 @@ tzsetlcl(char const *name)
lcl_is_set = lcl;
}
-#ifdef STD_INSPIRED
-void
-tzsetwall(void)
-{
- if (lock() != 0)
- return;
- tzsetlcl(NULL);
- unlock();
-}
-#endif
-
-static void
-tzset_unlocked(void)
-{
- tzsetlcl(getenv("TZ"));
-}
-
void
tzset(void)
{
diff --git a/tz/newctime.3 b/tz/newctime.3
index 565e89a..cc56e2c 100644
--- a/tz/newctime.3
+++ b/tz/newctime.3
@@ -51,7 +51,9 @@ asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time
.de q
\\$3\*(lq\\$1\*(rq\\$2
..
-.I Ctime
+The
+.B ctime
+function
converts a long integer, pointed to by
.IR clock ,
and returns a pointer to a
@@ -86,45 +88,55 @@ and can therefore represent timestamps that predate the
introduction of UTC and are some other flavor of Universal Time (UT).
Some implementations support leap seconds, in contradiction to POSIX.
.PP
-.I Localtime
+The
+.B localtime
and
-.I gmtime
+.B gmtime
+functions
return pointers to
.q "tm"
structures, described below.
-.I Localtime
+The
+.B localtime
+function
corrects for the time zone and any time zone adjustments
(such as Daylight Saving Time in the United States).
After filling in the
.q "tm"
structure,
-.I localtime
+.B localtime
sets the
.BR tm_isdst 'th
element of
.B tzname
to a pointer to a string that's the time zone abbreviation to be used with
-.IR localtime 's
+.BR localtime 's
return value.
.PP
-.I Gmtime
+The
+.B gmtime
+function
converts to Coordinated Universal Time.
.PP
-.I Asctime
+The
+.B asctime
+function
converts a time value contained in a
.q "tm"
structure to a string,
as shown in the above example,
and returns a pointer to the string.
.PP
-.I Mktime
+The
+.B mktime
+function
converts the broken-down time,
expressed as local time,
in the structure pointed to by
.I tm
into a calendar time value with the same encoding as that of the values
returned by the
-.I time
+.B time
function.
The original values of the
.B tm_wday
@@ -136,14 +148,14 @@ to their normal ranges.
(A positive or zero value for
.B tm_isdst
causes
-.I mktime
+.B mktime
to presume initially that daylight saving time
respectively,
is or is not in effect for the specified time.
A negative value for
.B tm_isdst
causes the
-.I mktime
+.B mktime
function to attempt to divine whether daylight saving time is in effect
for the specified time; in this case it does not use a consistent
rule and may give a different answer when later
@@ -161,29 +173,37 @@ is not set until
and
.B tm_year
are determined.
-.I Mktime
+The
+.B mktime
+function
returns the specified calendar time;
If the calendar time cannot be represented,
it returns \-1.
.PP
-.I Difftime
+The
+.B difftime
+function
returns the difference between two calendar times,
.RI ( time1
\-
.IR time0 ),
expressed in seconds.
.PP
-.IR Ctime_r ,
-.IR localtime_r ,
-.IR gmtime_r ,
+The
+.BR ctime_r ,
+.BR localtime_r ,
+.BR gmtime_r ,
and
-.I asctime_r
+.B asctime_r
+functions
are like their unsuffixed counterparts, except that they accept an
additional argument specifying where to store the result if successful.
.PP
-.IR Localtime_rz
+The
+.B localtime_rz
and
-.I mktime_z
+.B mktime_z
+functions
are like their unsuffixed counterparts, except that they accept an
extra initial
.B zone
@@ -193,9 +213,9 @@ If
is null, UT is used; otherwise,
.B zone
should be have been allocated by
-.I tzalloc
+.B tzalloc
and should not be freed until after all uses (e.g., by calls to
-.IR strftime )
+.BR strftime )
of the filled-in
.B tm_zone
fields.
@@ -227,21 +247,25 @@ includes the following fields:
.fi
.RE
.PP
-.I Tm_isdst
+The
+.B tm_isdst
+field
is non-zero if daylight saving time is in effect.
.PP
-.I Tm_gmtoff
+The
+.B tm_gmtoff
+field
is the offset (in seconds) of the time represented
from UT, with positive values indicating east
of the Prime Meridian.
The field's name is derived from Greenwich Mean Time, a precursor of UT.
.PP
In
-.B struct tm
+.B "struct tm"
the
-.I tm_zone
+.B tm_zone
and
-.I tm_gmtoff
+.B tm_gmtoff
fields exist, and are filled in, only if arrangements to do
so were made when the library containing these functions was
created.
@@ -273,11 +297,11 @@ time(2),
tzfile(5)
.SH NOTES
The return values of
-.IR asctime ,
-.IR ctime ,
-.IR gmtime ,
+.BR asctime ,
+.BR ctime ,
+.BR gmtime ,
and
-.I localtime
+.B localtime
point to static data
overwritten by each call.
The
@@ -288,19 +312,21 @@ field of a returned
.B "struct tm"
both point to an array of characters that
can be freed or overwritten by later calls to the functions
-.IR localtime ,
-.IR tzfree ,
+.BR localtime ,
+.BR tzfree ,
and
-.IR tzset ,
+.BR tzset ,
if these functions affect the timezone information that specifies the
abbreviation in question.
The remaining functions and data are thread-safe.
.PP
-.IR Asctime ,
-.IR asctime_r ,
-.IR ctime ,
+The
+.BR asctime ,
+.BR asctime_r ,
+.BR ctime ,
and
-.I ctime_r
+.B ctime_r
+functions
behave strangely for years before 1000 or after 9999.
The 1989 and 1999 editions of the C Standard say
that years from \-99 through 999 are converted without
@@ -311,7 +337,7 @@ is undefined if the year is before 1000 or after 9999.
Traditional implementations of these two functions are
restricted to years in the range 1900 through 2099.
To avoid this portability mess, new programs should use
-.I strftime
+.B strftime
instead.
.\" This file is in the public domain, so clarified as of
.\" 2009-05-17 by Arthur David Olson.
diff --git a/tz/newstrftime.3 b/tz/newstrftime.3
index eee503e..887aba5 100644
--- a/tz/newstrftime.3
+++ b/tz/newstrftime.3
@@ -50,20 +50,22 @@ strftime \- format date and time
.B cc ... \-ltz
.fi
.SH DESCRIPTION
-.ie '\(en'' .ds en \-
-.el .ds en \(en
.ie '\(lq'' .ds lq \&"\"
.el .ds lq \(lq\"
.ie '\(rq'' .ds rq \&"\"
.el .ds rq \(rq\"
+.de c
+.ie \n(.g \f(CW\\$1\fP\\$2
+.el \\$1\\$2
+..
.de q
\\$3\*(lq\\$1\*(rq\\$2
..
The
-.I strftime
+.B strftime
function formats the information from
.I timeptr
-into the buffer
+into the array pointed to by
.I buf
according to the string pointed to by
.IR format .
@@ -72,24 +74,17 @@ The
.I format
string consists of zero or more conversion specifications and
ordinary characters.
-All ordinary characters are copied directly into the buffer.
+All ordinary characters are copied directly into the array.
A conversion specification consists of a percent sign
.Ql %
and one other character.
.PP
No more than
.I maxsize
-characters are placed into the array.
-If the total number of resulting characters, including the terminating
-null character, is not more than
-.IR maxsize ,
-.I strftime
-returns the number of characters in the array, not counting the
-terminating null.
-Otherwise, zero is returned.
+bytes are placed into the array.
.PP
Each conversion specification is replaced by the characters as
-follows which are then copied into the buffer.
+follows which are then copied into the array.
.TP
%A
is replaced by the locale's full weekday name.
@@ -105,99 +100,122 @@ is replaced by the locale's abbreviated month name.
.TP
%C
is replaced by the century (a year divided by 100 and truncated to an integer)
-as a decimal number (00\*(en99).
+as a decimal number [00,99].
.TP
%c
is replaced by the locale's appropriate date and time representation.
.TP
%D
-is replaced by the date in the format %m/%d/%y.
+is equivalent to
+.c %m/%d/%y .
.TP
%d
-is replaced by the day of the month as a decimal number (01\*(en31).
+is replaced by the day of the month as a decimal number [01,31].
.TP
%e
-is replaced by the day of month as a decimal number (1\*(en31);
+is replaced by the day of month as a decimal number [1,31];
single digits are preceded by a blank.
.TP
%F
-is replaced by the date in the format %Y\*-%m\*-%d.
+is equivalent to
+.c %Y-%m-%d
+(the ISO 8601 date format).
.TP
%G
is replaced by the ISO 8601 year with century as a decimal number.
+See also the
+.c %V
+conversion specification.
.TP
%g
-is replaced by the ISO 8601 year without century as a decimal number (00\*(en99).
+is replaced by the ISO 8601 year without century as a decimal number [00,99].
+This is the year that includes the greater part of the week.
+(Monday as the first day of a week).
+See also the
+.c %V
+conversion specification.
.TP
%H
-is replaced by the hour (24-hour clock) as a decimal number (00\*(en23).
+is replaced by the hour (24-hour clock) as a decimal number [00,23].
.TP
%I
-is replaced by the hour (12-hour clock) as a decimal number (01\*(en12).
+is replaced by the hour (12-hour clock) as a decimal number [01,12].
.TP
%j
-is replaced by the day of the year as a decimal number (001\*(en366).
+is replaced by the day of the year as a decimal number [001,366].
.TP
%k
-is replaced by the hour (24-hour clock) as a decimal number (0\*(en23);
+is replaced by the hour (24-hour clock) as a decimal number [0,23];
single digits are preceded by a blank.
.TP
%l
-is replaced by the hour (12-hour clock) as a decimal number (1\*(en12);
+is replaced by the hour (12-hour clock) as a decimal number [1,12];
single digits are preceded by a blank.
.TP
%M
-is replaced by the minute as a decimal number (00\*(en59).
+is replaced by the minute as a decimal number [00,59].
.TP
%m
-is replaced by the month as a decimal number (01\*(en12).
+is replaced by the month as a decimal number [01,12].
.TP
%n
is replaced by a newline.
.TP
%p
-is replaced by the locale's equivalent of either AM or PM.
+is replaced by the locale's equivalent of either
+.q AM
+or
+.q PM .
.TP
%R
-is replaced by the time in the format %H:%M.
+is replaced by the time in the format
+.c %H:%M .
.TP
%r
is replaced by the locale's representation of 12-hour clock time
using AM/PM notation.
.TP
%S
-is replaced by the second as a decimal number (00\*(en60).
+is replaced by the second as a decimal number [00,60].
+The range of
+seconds is [00,60] instead of [00,59] to allow for the periodic occurrence
+of leap seconds.
.TP
%s
-is replaced by the number of seconds since the Epoch (see newctime(3)).
+is replaced by the number of seconds since the Epoch (see
+.BR ctime (3)).
.TP
%T
-is replaced by the time in the format %H:%M:%S.
+is replaced by the time in the format
+.c %H:%M:%S .
.TP
%t
is replaced by a tab.
.TP
%U
is replaced by the week number of the year (Sunday as the first day of
-the week) as a decimal number (00\*(en53).
+the week) as a decimal number [00,53].
.TP
%u
is replaced by the weekday (Monday as the first day of the week)
-as a decimal number (1\*(en7).
+as a decimal number [1,7].
.TP
%V
is replaced by the week number of the year (Monday as the first day of
-the week) as a decimal number (01\*(en53). If the week containing January
+the week) as a decimal number [01,53]. If the week containing January
1 has four or more days in the new year, then it is week 1; otherwise
it is week 53 of the previous year, and the next week is week 1.
+The year is given by the
+.c %G
+conversion specification.
.TP
%W
is replaced by the week number of the year (Monday as the first day of
-the week) as a decimal number (00\*(en53).
+the week) as a decimal number [00,53].
.TP
%w
is replaced by the weekday (Sunday as the first day of the week)
-as a decimal number (0\*(en6).
+as a decimal number [0,6].
.TP
%X
is replaced by the locale's appropriate time representation.
@@ -209,7 +227,7 @@ is replaced by the locale's appropriate date representation.
is replaced by the year with century as a decimal number.
.TP
%y
-is replaced by the year without century as a decimal number (00\*(en99).
+is replaced by the year without century as a decimal number [00,99].
.TP
%Z
is replaced by the time zone abbreviation,
@@ -217,7 +235,7 @@ or by the empty string if this is not determinable.
.TP
%z
is replaced by the offset from the Prime Meridian
-in the format +HHMM or \*-HHMM as appropriate,
+in the format +HHMM or \*-HHMM (ISO 8601) as appropriate,
with positive values representing locations east of Greenwich,
or by the empty string if this is not determinable.
The numeric time zone abbreviation \*-0000 is used when the time is
@@ -231,7 +249,36 @@ time zone abbreviation begins with
is replaced by a single %.
.TP
%+
-is replaced by the date and time in date(1) format.
+is replaced by the locale's date and time in
+.BR date (1)
+format.
+.SH "RETURN VALUE"
+If the conversion is successful,
+.B strftime
+returns the number of bytes placed into the array, not counting the
+terminating NUL;
+.B errno
+is unchanged if the returned value is zero.
+Otherwise,
+.B errno
+is set to indicate the error, zero is returned,
+and the array contents are unspecified.
+.SH ERRORS
+This function fails if:
+.TP
+[ERANGE]
+The total number of resulting bytes, including the terminating
+NUL character, is more than
+.IR maxsize .
+.PP
+This function may fail if:
+.TP
+[EOVERFLOW]
+The format includes an
+.c %s
+conversion and the number of seconds since the Epoch cannot be represented
+in a
+.c time_t .
.SH SEE ALSO
date(1),
getenv(3),
@@ -239,3 +286,5 @@ newctime(3),
newtzset(3),
time(2),
tzfile(5)
+.SH BUGS
+There is no conversion specification for the phase of the moon.
diff --git a/tz/newtzset.3 b/tz/newtzset.3
index 4959851..05aa350 100644
--- a/tz/newtzset.3
+++ b/tz/newtzset.3
@@ -25,49 +25,55 @@ tzset \- initialize time conversion information
.de q
\\$3\*(lq\\$1\*(rq\\$2
..
-.I Tzalloc
+The
+.B tzalloc
+function
allocates and returns a timezone object described by
.BR TZ .
If
.B TZ
is not a valid timezone description, or if the object cannot be allocated,
-.I tzalloc
+.B tzalloc
returns a null pointer and sets
.BR errno .
.PP
-.I Tzfree
+The
+.B tzfree
+function
frees a timezone object
.BR tz ,
which should have been successfully allocated by
-.IR tzalloc .
+.BR tzalloc .
This invalidates any
.B tm_zone
pointers that
.B tz
was used to set.
.PP
-.I Tzset
+The
+.B tzset
+function
acts like
.BR tzalloc(getenv("TZ")) ,
except it saves any resulting timezone object into internal
storage that is accessed by
-.IR localtime ,
-.IR localtime_r ,
+.BR localtime ,
+.BR localtime_r ,
and
-.IR mktime .
+.BR mktime .
The anonymous shared timezone object is freed by the next call to
-.IR tzset .
+.BR tzset .
If the implied call to
.B tzalloc
fails,
-.I tzset
+.B tzset
falls back on Universal Time (UT).
.PP
If
.B TZ
is null, the best available approximation to local (wall
clock) time, as specified by the
-.IR tzfile (5)-format
+.BR tzfile (5)-format
file
.B localtime
in the system time conversion information directory, is used.
@@ -76,7 +82,7 @@ If
is the empty string,
UT is used, with the abbreviation "UTC"
and without leap second correction; please see
-.IR newctime (3)
+.BR newctime (3)
for more about UT, UTC, and leap seconds. If
.B TZ
is nonnull and nonempty:
@@ -96,7 +102,7 @@ it is used as an absolute pathname; otherwise,
it is used as a pathname relative to a system time conversion information
directory.
The file must be in the format specified in
-.IR tzfile (5).
+.BR tzfile (5).
.PP
When
.B TZ
@@ -304,7 +310,7 @@ is present in
.BR TZ ,
the rules specified
by the
-.IR tzfile (5)-format
+.BR tzfile (5)-format
file
.B posixrules
in the system time conversion information directory are used, with the
diff --git a/tz/northamerica b/tz/northamerica
index febf05b..675c648 100644
--- a/tz/northamerica
+++ b/tz/northamerica
@@ -170,7 +170,7 @@
# U.S. government action. So even though the "US" rules have changed
# in the latest release, other countries won't be affected.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule US 1918 1919 - Mar lastSun 2:00 1:00 D
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
@@ -347,7 +347,7 @@ Zone PST8PDT -8:00 US P%sT
# Eastern time (i.e., -4:56:01.6) just before the 1883 switch. Round to the
# nearest second.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule NYC 1920 only - Mar lastSun 2:00 1:00 D
Rule NYC 1920 only - Oct lastSun 2:00 0 S
Rule NYC 1921 1966 - Apr lastSun 2:00 1:00 D
@@ -431,7 +431,7 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
# The Tennessean 2007-05-11, republished 2015-04-06.
# https://www.tennessean.com/story/insider/extras/2015/04/06/archives-seigenthaler-for-100-years-the-tennessean-had-it-covered/25348545/
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Chicago 1920 only - Jun 13 2:00 1:00 D
Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S
Rule Chicago 1921 only - Mar lastSun 2:00 1:00 D
@@ -500,7 +500,7 @@ Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
# El Paso Times. 2018-10-24 06:40 -06.
# https://www.elpasotimes.com/story/news/local/el-paso/2018/10/24/el-pasoans-were-time-rebels-fought-stay-mountain-zone/1744509002/
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Denver 1920 1921 - Mar lastSun 2:00 1:00 D
Rule Denver 1920 only - Oct lastSun 2:00 0 S
Rule Denver 1921 only - May 22 2:00 0 S
@@ -553,7 +553,7 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule CA 1948 only - Mar 14 2:01 1:00 D
Rule CA 1949 only - Jan 1 2:00 0 S
Rule CA 1950 1966 - Apr lastSun 1:00 1:00 D
@@ -911,7 +911,7 @@ Zone America/Boise -7:44:49 - LMT 1883 Nov 18 12:15:11
# going to switch from Central to Eastern Time on March 11, 2007....
# http://www.indystar.com/apps/pbcs.dll/article?AID=/20070207/LOCAL190108/702070524/0/LOCAL
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Indianapolis 1941 only - Jun 22 2:00 1:00 D
Rule Indianapolis 1941 1954 - Sep lastSun 2:00 0 S
Rule Indianapolis 1946 1954 - Apr lastSun 2:00 1:00 D
@@ -930,7 +930,7 @@ Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 12:15:22
#
# Eastern Crawford County, Indiana, left its clocks alone in 1974,
# as well as from 1976 through 2005.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Marengo 1951 only - Apr lastSun 2:00 1:00 D
Rule Marengo 1951 only - Sep lastSun 2:00 0 S
Rule Marengo 1954 1960 - Apr lastSun 2:00 1:00 D
@@ -949,7 +949,7 @@ Zone America/Indiana/Marengo -5:45:23 - LMT 1883 Nov 18 12:14:37
# Daviess, Dubois, Knox, and Martin Counties, Indiana,
# switched from eastern to central time in April 2006, then switched back
# in November 2007.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Vincennes 1946 only - Apr lastSun 2:00 1:00 D
Rule Vincennes 1946 only - Sep lastSun 2:00 0 S
Rule Vincennes 1953 1954 - Apr lastSun 2:00 1:00 D
@@ -974,7 +974,7 @@ Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov 18 12:09:53
# The Indianapolis News, Friday 27 October 1967 states that Perry County
# returned to CST. It went again to EST on 27 April 1969, as documented by the
# Indianapolis star of Saturday 26 April.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Perry 1955 only - May 1 0:00 1:00 D
Rule Perry 1955 1960 - Sep lastSun 2:00 0 S
Rule Perry 1956 1963 - Apr lastSun 2:00 1:00 D
@@ -991,7 +991,7 @@ Zone America/Indiana/Tell_City -5:47:03 - LMT 1883 Nov 18 12:12:57
#
# Pike County, Indiana moved from central to eastern time in 1977,
# then switched back in 2006, then switched back again in 2007.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Pike 1955 only - May 1 0:00 1:00 D
Rule Pike 1955 1960 - Sep lastSun 2:00 0 S
Rule Pike 1956 1964 - Apr lastSun 2:00 1:00 D
@@ -1012,7 +1012,7 @@ Zone America/Indiana/Petersburg -5:49:07 - LMT 1883 Nov 18 12:10:53
# An article on page A3 of the Sunday, 1991-10-27 Washington Post
# notes that Starke County switched from Central time to Eastern time as of
# 1991-10-27.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Starke 1947 1961 - Apr lastSun 2:00 1:00 D
Rule Starke 1947 1954 - Sep lastSun 2:00 0 S
Rule Starke 1955 1956 - Oct lastSun 2:00 0 S
@@ -1029,7 +1029,7 @@ Zone America/Indiana/Knox -5:46:30 - LMT 1883 Nov 18 12:13:30
#
# Pulaski County, Indiana, switched from eastern to central time in
# April 2006 and then switched back in March 2007.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Pulaski 1946 1960 - Apr lastSun 2:00 1:00 D
Rule Pulaski 1946 1954 - Sep lastSun 2:00 0 S
Rule Pulaski 1955 1956 - Oct lastSun 2:00 0 S
@@ -1071,7 +1071,7 @@ Zone America/Indiana/Vevay -5:40:16 - LMT 1883 Nov 18 12:19:44
#
# Part of Kentucky left its clocks alone in 1974.
# This also includes Clark, Floyd, and Harrison counties in Indiana.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Louisville 1921 only - May 1 2:00 1:00 D
Rule Louisville 1921 only - Sep 1 2:00 0 S
Rule Louisville 1941 only - Apr lastSun 2:00 1:00 D
@@ -1185,7 +1185,7 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# election Michigan voters narrowly repealed DST, effective 1969.
#
# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Detroit 1948 only - Apr lastSun 2:00 1:00 D
Rule Detroit 1948 only - Sep lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1202,7 +1202,7 @@ Zone America/Detroit -5:32:11 - LMT 1905
#
# Dickinson, Gogebic, Iron, and Menominee Counties, Michigan,
# switched from EST to CST/CDT in 1973.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Menominee 1946 only - Apr lastSun 2:00 1:00 D
Rule Menominee 1946 only - Sep lastSun 2:00 0 S
Rule Menominee 1966 only - Apr lastSun 2:00 1:00 D
@@ -1372,7 +1372,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# Oct 31, to Oct 27, 1918 (and Sunday is a more likely transition day
# than Thursday) in all Canadian rulesets.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Canada 1918 only - Apr 14 2:00 1:00 D
Rule Canada 1918 only - Oct 27 2:00 0 S
Rule Canada 1942 only - Feb 9 2:00 1:00 W # War
@@ -1395,7 +1395,7 @@ Rule Canada 2007 max - Nov Sun>=1 2:00 0 S
# that follows the rules is the southeast corner, including Port Hope
# Simpson and Mary's Harbour, but excluding, say, Black Tickle.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule StJohns 1917 only - Apr 8 2:00 1:00 D
Rule StJohns 1917 only - Sep 17 2:00 0 S
# Whitman gives 1919 Apr 5 and 1920 Apr 5; go with Shanks & Pottenger.
@@ -1497,7 +1497,7 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay
# bill say that it is "accommodating the customs and practices" of those
# regions, which suggests that they have always been in-line with Halifax.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Halifax 1916 only - Apr 1 0:00 1:00 D
Rule Halifax 1916 only - Oct 1 0:00 0 S
Rule Halifax 1920 only - May 9 0:00 1:00 D
@@ -1563,7 +1563,7 @@ Zone America/Glace_Bay -3:59:48 - LMT 1902 Jun 15
# clear that this was the case since at least 1993.
# For now, assume it started in 1993.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Moncton 1933 1935 - Jun Sun>=8 1:00 1:00 D
Rule Moncton 1933 1935 - Sep Sun>=8 1:00 0 S
Rule Moncton 1936 1938 - Jun Sun>=1 1:00 1:00 D
@@ -1772,7 +1772,7 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# With some exceptions, the use of daylight saving may be said to be limited
# to those cities and towns lying between Quebec city and Windsor, Ont.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Toronto 1919 only - Mar 30 23:30 1:00 D
Rule Toronto 1919 only - Oct 26 0:00 0 S
Rule Toronto 1920 only - May 2 2:00 1:00 D
@@ -1870,7 +1870,7 @@ Zone America/Atikokan -6:06:28 - LMT 1895
# starting 1966. Since 02:00s is clearly correct for 1967 on, assume
# it was also 02:00s in 1966.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Winn 1916 only - Apr 23 0:00 1:00 D
Rule Winn 1916 only - Sep 17 0:00 0 S
Rule Winn 1918 only - Apr 14 2:00 1:00 D
@@ -1961,7 +1961,7 @@ Zone America/Winnipeg -6:28:36 - LMT 1887 Jul 16
# long and rather painful to read.
# http://www.qp.gov.sk.ca/documents/English/Statutes/Statutes/T14.pdf
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Regina 1918 only - Apr 14 2:00 1:00 D
Rule Regina 1918 only - Oct 27 2:00 0 S
Rule Regina 1930 1934 - May Sun>=1 0:00 1:00 D
@@ -2011,7 +2011,7 @@ Zone America/Swift_Current -7:11:20 - LMT 1905 Sep
# Boyer JP. Forcing Choice: The Risky Reward of Referendums. Dundum. 2017.
# ISBN 978-1459739123.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Edm 1918 1919 - Apr Sun>=8 2:00 1:00 D
Rule Edm 1918 only - Oct 27 2:00 0 S
Rule Edm 1919 only - May 27 2:00 0 S
@@ -2120,7 +2120,7 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep
# https://searcharchives.vancouver.ca/daylight-saving-1918-starts-again-july-7-1941-start-d-s-sept-27-end-of-d-s-1941
# We have no further details, so omit them for now.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Vanc 1918 only - Apr 14 2:00 1:00 D
Rule Vanc 1918 only - Oct 27 2:00 0 S
Rule Vanc 1942 only - Feb 9 2:00 1:00 W # War
@@ -2449,7 +2449,19 @@ Zone America/Creston -7:46:04 - LMT 1884
# consistency with nearby Dawson Creek, Creston, and Fort Nelson.
# https://yukon.ca/en/news/yukon-end-seasonal-time-change
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# From Andrew G. Smith (2020-09-24):
+# Yukon has completed its regulatory change to be on UTC -7 year-round....
+# http://www.gov.yk.ca/legislation/regs/oic2020_125.pdf
+# What we have done is re-defined Yukon Standard Time, as we are
+# authorized to do under section 33 of our Interpretation Act:
+# http://www.gov.yk.ca/legislation/acts/interpretation_c.pdf
+#
+# From Paul Eggert (2020-09-24):
+# tzdb uses the obsolete YST abbreviation for standard time in Yukon through
+# about 1970, and uses PST for standard time in Yukon since then. Consistent
+# with that, use MST for -07, the new standard time in Yukon effective Nov. 1.
+
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NT_YK 1918 only - Apr 14 2:00 1:00 D
Rule NT_YK 1918 only - Oct 27 2:00 0 S
Rule NT_YK 1919 only - May 25 2:00 1:00 D
@@ -2503,12 +2515,12 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded
Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20
-9:00 NT_YK Y%sT 1967 May 28 0:00
-8:00 NT_YK P%sT 1980
- -8:00 Canada P%sT 2020 Mar 8 2:00
+ -8:00 Canada P%sT 2020 Nov 1
-7:00 - MST
Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
-9:00 NT_YK Y%sT 1973 Oct 28 0:00
-8:00 NT_YK P%sT 1980
- -8:00 Canada P%sT 2020 Mar 8 2:00
+ -8:00 Canada P%sT 2020 Nov 1
-7:00 - MST
@@ -2723,7 +2735,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# 5- The islands, reefs and keys shall take their timezone from the
# longitude they are located at.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S
Rule Mexico 1940 only - Dec 9 0:00 1:00 D
@@ -2928,7 +2940,7 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
# rules to sync with the U.S. starting in 2007....
# http://www.jonesbahamas.com/?c=45&a=10412
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -2940,7 +2952,7 @@ Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
# For 1899 Milne gives -3:58:29.2; round that.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
@@ -2953,7 +2965,7 @@ Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown
# Belize
# Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Belize 1918 1942 - Oct Sun>=2 0:00 0:30 -0530
Rule Belize 1919 1943 - Feb Sun>=9 0:00 0 CST
Rule Belize 1973 only - Dec 5 0:00 1:00 CDT
@@ -2990,7 +3002,7 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton
# Milne gives -5:36:13.3 as San José mean time; round to nearest.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S
Rule CR 1991 1992 - Jan Sat>=15 0:00 1:00 D
@@ -3164,7 +3176,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# From Paul Eggert (2012-11-03):
# For now, assume the future rule is first Sunday in November.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Cuba 1928 only - Jun 10 0:00 1:00 D
Rule Cuba 1928 only - Oct 10 0:00 0 S
Rule Cuba 1940 1942 - Jun Sun>=1 0:00 1:00 D
@@ -3233,7 +3245,7 @@ Zone America/Havana -5:29:28 - LMT 1890
# decided to revert.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule DR 1966 only - Oct 30 0:00 1:00 EDT
Rule DR 1967 only - Feb 28 0:00 0 EST
Rule DR 1969 1973 - Oct lastSun 0:00 0:30 -0430
@@ -3250,7 +3262,7 @@ Zone America/Santo_Domingo -4:39:36 - LMT 1890
# El Salvador
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Salv 1987 1988 - May Sun>=1 0:00 1:00 D
Rule Salv 1987 1988 - Sep lastSun 0:00 0 S
# There are too many San Salvadors elsewhere, so use America/El_Salvador
@@ -3279,7 +3291,7 @@ Zone America/El_Salvador -5:56:48 - LMT 1921 # San Salvador
# (2006-04-19), says DST ends at 24:00. See
# http://www.sieca.org.gt/Sitio_publico/Energeticos/Doc/Medidas/Cambio_Horario_Nac_190406.pdf
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Guat 1973 only - Nov 25 0:00 1:00 D
Rule Guat 1974 only - Feb 24 0:00 0 S
Rule Guat 1983 only - May 21 0:00 1:00 D
@@ -3360,7 +3372,7 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# I have not been able to find a more authoritative source:
# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D
Rule Haiti 1984 1987 - Apr lastSun 0:00 1:00 D
Rule Haiti 1983 1987 - Oct lastSun 0:00 0 S
@@ -3408,7 +3420,7 @@ Zone America/Port-au-Prince -4:49:20 - LMT 1890
# http://www.laprensahn.com/pais_nota.php?id04962=7386
# So it seems that Honduras will not enter DST this year....
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Hond 1987 1988 - May Sun>=1 0:00 1:00 D
Rule Hond 1987 1988 - Sep lastSun 0:00 0 S
Rule Hond 2006 only - May Sun>=1 0:00 1:00 D
@@ -3499,7 +3511,7 @@ Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France
# The natural sun time is restored in all the national territory, in that the
# time is returned one hour at 01:00 am of October 1 of 2006.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Nic 1979 1980 - Mar Sun>=16 0:00 1:00 D
Rule Nic 1979 1980 - Jun Mon>=23 0:00 0 S
Rule Nic 2005 only - Apr 10 0:00 1:00 D
diff --git a/tz/pacificnew b/tz/pacificnew
deleted file mode 100644
index 8403219..0000000
--- a/tz/pacificnew
+++ /dev/null
@@ -1,29 +0,0 @@
-# tzdb data for proposed US election time (this file is obsolete)
-
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# From Arthur David Olson (1989-04-05):
-# On 1989-04-05, the U. S. House of Representatives passed (238-154) a bill
-# establishing "Pacific Presidential Election Time"; it was not acted on
-# by the Senate or signed into law by the President.
-# You might want to change the "PE" (Presidential Election) below to
-# "Q" (Quadrennial) to maintain three-character zone abbreviations.
-# If you're really conservative, you might want to change it to "D".
-# Avoid "L" (Leap Year), which won't be true in 2100.
-
-# If Presidential Election Time is ever established, replace "XXXX" below
-# with the year the law takes effect and uncomment the "##" lines.
-
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-## Rule Twilite XXXX max - Apr Sun>=1 2:00 1:00 D
-## Rule Twilite XXXX max uspres Oct lastSun 2:00 1:00 PE
-## Rule Twilite XXXX max uspres Nov Sun>=7 2:00 0 S
-## Rule Twilite XXXX max nonpres Oct lastSun 2:00 0 S
-
-# Zone NAME STDOFF RULES/SAVE FORMAT [UNTIL]
-## Zone America/Los_Angeles-PET -8:00 US P%sT XXXX
-## -8:00 Twilite P%sT
-
-# For now...
-Link America/Los_Angeles US/Pacific-New ##
diff --git a/tz/private.h b/tz/private.h
index 8513663..9efcd78 100644
--- a/tz/private.h
+++ b/tz/private.h
@@ -477,8 +477,6 @@ typedef time_tz tz_time_t;
# define tzfree tz_tzfree
# undef tzset
# define tzset tz_tzset
-# undef tzsetwall
-# define tzsetwall tz_tzsetwall
# if HAVE_STRFTIME_L
# undef strftime_l
# define strftime_l tz_strftime_l
@@ -551,9 +549,6 @@ extern long altzone;
*/
#ifdef STD_INSPIRED
-# if TZ_TIME_T || !defined tzsetwall
-void tzsetwall(void);
-# endif
# if TZ_TIME_T || !defined offtime
struct tm *offtime(time_t const *, long);
# endif
diff --git a/tz/southamerica b/tz/southamerica
index 9b679c6..aad8b2d 100644
--- a/tz/southamerica
+++ b/tz/southamerica
@@ -48,7 +48,7 @@
# I am sending modifications to the Argentine time zone table...
# AR was chosen because they are the ISO letters that represent Argentina.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Arg 1930 only - Dec 1 0:00 1:00 -
Rule Arg 1931 only - Apr 1 0:00 0 -
Rule Arg 1931 only - Oct 15 0:00 1:00 -
@@ -769,7 +769,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Paul Eggert (2013-10-17):
# For now, assume western Amazonas will change as well.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# Decree 20,466 <http://pcdsh01.on.br/HV20466.htm> (1931-10-01)
# Decree 21,896 <http://pcdsh01.on.br/HV21896.htm> (1932-01-10)
Rule Brazil 1931 only - Oct 3 11:00 1:00 -
@@ -1258,7 +1258,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# For now, assume that they will not revert,
# since they have extended the expiration date once already.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Chile 1927 1931 - Sep 1 0:00 1:00 -
Rule Chile 1928 1932 - Apr 1 0:00 0 -
Rule Chile 1968 only - Nov 3 4:00u 1:00 -
@@ -1358,7 +1358,7 @@ Zone Antarctica/Palmer 0 - -00 1965
# Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest. He writes,
# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 -
Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1418,7 +1418,7 @@ Link America/Curacao America/Kralendijk # Caribbean Netherlands
# (Not one step back), the clocks went back in 1993 and the experiment was not
# repeated. For now, assume transitions were at 00:00 local time country-wide.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Ecuador 1992 only - Nov 28 0:00 1:00 -
Rule Ecuador 1993 only - Feb 5 0:00 0 -
#
@@ -1512,7 +1512,7 @@ Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno
# For now we will assume permanent -03 for the Falklands
# until advised differently (to apply for 2012 and beyond, after the 2011
# experiment was apparently successful.)
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 -
Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 -
Rule Falk 1939 only - Oct 1 0:00 1:00 -
@@ -1558,7 +1558,7 @@ Zone America/Guyana -3:52:40 - LMT 1915 Mar # Georgetown
# No time of the day is established for the adjustment, so people normally
# adjust their clocks at 0 hour of the given dates.
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Para 1975 1988 - Oct 1 0:00 1:00 -
Rule Para 1975 1978 - Mar 1 0:00 0 -
Rule Para 1979 1991 - Apr 1 0:00 0 -
@@ -1651,7 +1651,7 @@ Zone America/Asuncion -3:50:40 - LMT 1890
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger don't have this transition. Assume 1986 was like 1987.
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Peru 1938 only - Jan 1 0:00 1:00 -
Rule Peru 1938 only - Apr 1 0:00 0 -
Rule Peru 1938 1939 - Sep lastSun 0:00 1:00 -
@@ -1747,7 +1747,7 @@ Link America/Port_of_Spain America/Tortola # Virgin Islands (UK)
# https://www.impo.com.uy/diariooficial/1926/03/10/2
# https://www.impo.com.uy/diariooficial/1926/03/18/2
#
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Uruguay 1923 1925 - Oct 1 0:00 0:30 -
Rule Uruguay 1924 1926 - Apr 1 0:00 0 -
# From Tim Parenti (2018-02-15):
diff --git a/tz/strftime.c b/tz/strftime.c
index 14cbc9a..4f871cd 100644
--- a/tz/strftime.c
+++ b/tz/strftime.c
@@ -130,10 +130,15 @@ size_t
strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
{
char * p;
+ int saved_errno = errno;
enum warn warn = IN_NONE;
tzset();
p = _fmt(format, t, s, s + maxsize, &warn);
+ if (!p) {
+ errno = EOVERFLOW;
+ return 0;
+ }
if (DEPRECATE_TWO_DIGIT_YEARS
&& warn != IN_NONE && getenv(YEAR_2000_NAME)) {
fprintf(stderr, "\n");
@@ -146,9 +151,12 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
else fprintf(stderr, "all locales");
fprintf(stderr, "\n");
}
- if (p == s + maxsize)
+ if (p == s + maxsize) {
+ errno = ERANGE;
return 0;
+ }
*p = '\0';
+ errno = saved_errno;
return p - s;
}
@@ -312,7 +320,21 @@ label:
time_t mkt;
tm = *t;
+ tm.tm_yday = -1;
mkt = mktime(&tm);
+ if (mkt == (time_t) -1) {
+ /* Fail unless this -1 represents
+ a valid time. */
+ struct tm tm_1;
+ if (!localtime_r(&mkt, &tm_1))
+ return NULL;
+ if (!(tm.tm_year == tm_1.tm_year
+ && tm.tm_yday == tm_1.tm_yday
+ && tm.tm_hour == tm_1.tm_hour
+ && tm.tm_min == tm_1.tm_min
+ && tm.tm_sec == tm_1.tm_sec))
+ return NULL;
+ }
if (TYPE_SIGNED(time_t))
sprintf(buf, "%"PRIdMAX,
(intmax_t) mkt);
diff --git a/tz/systemv b/tz/systemv
deleted file mode 100644
index a8c037c..0000000
--- a/tz/systemv
+++ /dev/null
@@ -1,39 +0,0 @@
-# tzdb data for System V rules (this file is obsolete)
-
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# Old rules, should the need arise.
-# No attempt is made to handle Newfoundland, since it cannot be expressed
-# using the System V "TZ" scheme (half-hour offset), or anything outside
-# North America (no support for non-standard DST start/end dates), nor
-# the changes in the DST rules in the US after 1976 (which occurred after
-# the old rules were written).
-#
-# If you need the old rules, uncomment ## lines.
-# Compile this *without* leap second correction for true conformance.
-
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-Rule SystemV min 1973 - Apr lastSun 2:00 1:00 D
-Rule SystemV min 1973 - Oct lastSun 2:00 0 S
-Rule SystemV 1974 only - Jan 6 2:00 1:00 D
-Rule SystemV 1974 only - Nov lastSun 2:00 0 S
-Rule SystemV 1975 only - Feb 23 2:00 1:00 D
-Rule SystemV 1975 only - Oct lastSun 2:00 0 S
-Rule SystemV 1976 max - Apr lastSun 2:00 1:00 D
-Rule SystemV 1976 max - Oct lastSun 2:00 0 S
-
-# Zone NAME STDOFF RULES/SAVE FORMAT [UNTIL]
-## Zone SystemV/AST4ADT -4:00 SystemV A%sT
-## Zone SystemV/EST5EDT -5:00 SystemV E%sT
-## Zone SystemV/CST6CDT -6:00 SystemV C%sT
-## Zone SystemV/MST7MDT -7:00 SystemV M%sT
-## Zone SystemV/PST8PDT -8:00 SystemV P%sT
-## Zone SystemV/YST9YDT -9:00 SystemV Y%sT
-## Zone SystemV/AST4 -4:00 - AST
-## Zone SystemV/EST5 -5:00 - EST
-## Zone SystemV/CST6 -6:00 - CST
-## Zone SystemV/MST7 -7:00 - MST
-## Zone SystemV/PST8 -8:00 - PST
-## Zone SystemV/YST9 -9:00 - YST
-## Zone SystemV/HST10 -10:00 - HST
diff --git a/tz/theory.html b/tz/theory.html
index c0e6f02..4613799 100644
--- a/tz/theory.html
+++ b/tz/theory.html
@@ -33,7 +33,7 @@
The <a
href="https://www.iana.org/time-zones"><code><abbr>tz</abbr></code>
database</a> attempts to record the history and predicted future of
-all computer-based clocks that track civil time.
+civil time scales.
It organizes <a href="tz-link.html">time zone and daylight saving time
data</a> by partitioning the world into <a
href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"><dfn>timezones</dfn></a>
@@ -115,17 +115,15 @@ Each timezone has a name that uniquely identifies the timezone.
Inexperienced users are not expected to select these names unaided.
Distributors should provide documentation and/or a simple selection
interface that explains each name via a map or via descriptive text like
-"Ruthenia" instead of the timezone name "<code>Europe/Uzhgorod</code>".
+"Czech Republic" instead of the timezone name "<code>Europe/Prague</code>".
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="http://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/Uzhgorod</code>
-to CLDR names like <code>uauzh</code> which are in turn mapped to
-locale-dependent strings like "Uzhhorod", "Ungvár", "Ужгород", and
-"乌日哥罗德".
+interfaces; it maps timezone names like <code>Europe/Prague</code> to
+locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".
</p>
<p>
@@ -693,6 +691,14 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
<code><abbr>tz</abbr></code> database requires.
</li>
<li>
+ The <code><abbr>tz</abbr></code> database cannot represent stopped clocks.
+ However, on 1911-03-11 at 00:00, some public-facing French clocks
+ were changed by stopping them for a few minutes to effect a transition.
+ The <code><abbr>tz</abbr></code> database models this via a
+ backward transition; the relevant French legislation does not
+ specify exactly how the transition was to occur.
+ </li>
+ <li>
Sometimes historical timekeeping was specified more precisely
than what the <code><abbr>tz</abbr></code> code can handle.
For example, from 1909 to 1937 <a
@@ -1321,17 +1327,21 @@ They sometimes disagree.
<section>
<h2 id="planets">Time and time zones on other planets</h2>
<p>
-Some people's work schedules
-use <a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.
+Some people's work schedules have used
+<a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.
Jet Propulsion Laboratory (JPL) coordinators kept Mars time on
and off during the
<a href="https://en.wikipedia.org/wiki/Mars_Pathfinder">Mars
-Pathfinder</a> mission.
+Pathfinder</a> mission (1997).
Some of their family members also adapted to Mars time.
Dozens of special Mars watches were built for JPL workers who kept
-Mars time during the Mars Exploration Rovers mission (2004).
-These timepieces look like normal Seikos and Citizens but use Mars
-seconds rather than terrestrial seconds.
+Mars time during the
+<a href="https://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars
+Exploration Rovers (MER)</a> mission (2004&ndash;2018).
+These timepieces looked like normal Seikos and Citizens but were adjusted
+to use Mars seconds rather than terrestrial seconds, although
+unfortunately the adjusted watches were unreliable and appear to have
+had only limited use.
</p>
<p>
@@ -1339,6 +1349,8 @@ A Mars solar day is called a "sol" and has a mean period equal to
about 24 hours 39 minutes 35.244 seconds in terrestrial time.
It is divided into a conventional 24-hour clock, so each Mars second
equals about 1.02749125 terrestrial seconds.
+(One MER worker noted, "If I am working Mars hours, and Mars hours are
+2.5% more than Earth hours, shouldn't I get an extra 2.5% pay raise?")
</p>
<p>
@@ -1354,12 +1366,12 @@ called Mars Coordinated Time (<abbr>MTC</abbr>).
<p>
Each landed mission on Mars has adopted a different reference for
solar timekeeping, so there is no real standard for Mars time zones.
-For example, the
-<a href="https://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars
-Exploration Rover</a> project (2004) defined two time zones "Local
+For example, the MER mission defined two time zones "Local
Solar Time A" and "Local Solar Time B" for its two missions, each zone
designed so that its time equals local true solar time at
approximately the middle of the nominal mission.
+The A and B zones differ enough so that an MER worker assigned to
+the A zone might suffer "Mars lag" when switching to work in the B zone.
Such a "time zone" is not particularly suited for any application
other than the mission itself.
</p>
@@ -1408,7 +1420,12 @@ Sources for time on other planets:
Michael Allison and Robert Schmunk,
"<a href="https://www.giss.nasa.gov/tools/mars24/help/notes.html">Technical
Notes on Mars Solar Time as Adopted by the Mars24 Sunclock</a>"
- (2018-12-13).
+ (2020-03-08).
+ </li>
+ <li>
+ Zara Mirmalek,
+ <em><a href="https://mitpress.mit.edu/books/making-time-mars">Making
+ Time on Mars</a></em>, MIT Press (March 2020), ISBN 978-0262043854.
</li>
<li>
Jia-Rui Chong,
diff --git a/tz/time2posix.3 b/tz/time2posix.3
index e4b8e81..fbb5766 100644
--- a/tz/time2posix.3
+++ b/tz/time2posix.3
@@ -47,11 +47,11 @@ to be
(mostly)
opaque \*(en time_t values should only be obtained-from and
passed-to functions such as
-.IR time(2) ,
-.IR localtime(3) ,
-.IR mktime(3) ,
+.BR time(2) ,
+.BR localtime(3) ,
+.BR mktime(3) ,
and
-.IR difftime(3) .
+.BR difftime(3) .
However,
POSIX gives an arithmetic
expression for directly computing a time_t value from a given date/time,
@@ -63,9 +63,9 @@ using such a relationship will typically not handle intervals
over leap seconds correctly.
.PP
The
-.I time2posix
+.B time2posix
and
-.I posix2time
+.B posix2time
functions are provided to address this time_t mismatch by converting
between local time_t values and their POSIX equivalents.
This is done by accounting for the number of time-base changes that
@@ -75,12 +75,16 @@ These converted values can then be used in lieu of correcting the older
applications,
or when communicating with POSIX-compliant systems.
.PP
-.I Time2posix
+The
+.B time2posix
+function
is single-valued.
That is,
every local time_t
corresponds to a single POSIX time_t.
-.I Posix2time
+The
+.B posix2time
+function
is less well-behaved:
for a positive leap second hit the result is not unique,
and for a negative leap second hit the corresponding
@@ -116,9 +120,9 @@ If leap-second support is not enabled,
local time_t's and
POSIX time_t's are equivalent,
and both
-.I time2posix
+.B time2posix
and
-.I posix2time
+.B posix2time
degenerate to the identity function.
.SH SEE ALSO
difftime(3),
diff --git a/tz/tz-art.html b/tz/tz-art.html
index 93a99e4..72b9654 100644
--- a/tz/tz-art.html
+++ b/tz/tz-art.html
@@ -22,6 +22,10 @@ into problems that programmers have with timekeeping.</li>
Explaining The Mysteries Of Time Zones</a>" (2017; 2:15)
briefly says why France has more time zones than Russia.
<li>
+"<a href="https://www.youtube.com/watch?v=yRz-Dl60Lfc">Why Denmark is
+.17 Seconds Behind The World</a>" (2019; 6:29) explains why Denmark and
+the United Kingdom don't exactly follow their own law about civil time.
+<li>
"About Time" (1962; 59 minutes) is part of the
Bell Science extravaganza, with Frank Baxter, Richard Deacon, and Les Tremayne.
Its advisor was Richard Feynman, and it was voiced by Mel Blanc.
@@ -109,6 +113,11 @@ premonition in the "We Had a Dream" episode of <em>Medium</em>
(originally aired 2007-02-28).
</li>
<li>
+A criminal's failure to account for the start of daylight saving is pivotal
+in "<a href="https://monk.fandom.com/wiki/Mr._Monk_and_the_Rapper">Mr. Monk
+and the Rapper</a>" (first aired 2007-07-20).
+</li>
+<li>
In the <em>30 Rock</em> episode "Anna Howard Shaw Day"
(first broadcast 2010-02-11),
Jack Donaghy's date realizes that a Geneva-to-New-York business phone call
diff --git a/tz/tz-how-to.html b/tz/tz-how-to.html
index 2e4842d..bf3e86f 100644
--- a/tz/tz-how-to.html
+++ b/tz/tz-how-to.html
@@ -1,12 +1,16 @@
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
+<!DOCTYPE html>
+<html lang="en">
<head>
<title>How to Read the tz Database</title>
-<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
-<style type="text/css">
+<meta charset="UTF-8">
+<style>
pre {margin-left: 2em; white-space: pre-wrap;}
+pre.td {margin-left: 0;}
+td {text-align: center;}
+table {border: 1px outset;}
+th, td {border: 1px inset;}
+table.rule {border: none; margin: auto;}
+td.footnote {text-align: left;}
</style>
</head>
<body>
@@ -31,14 +35,16 @@ about the zones.</p>
for Chicago (from the <code>northamerica</code> file in
the <code>data</code> subdirectory):</p>
-<table border="1">
+<table>
<tr>
<th colspan="6">From the Source File</th>
</tr>
<tr>
- <td colspan="6" align="center"><table><tr><td>
-<pre>
-#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+ <td colspan="6">
+ <table class="rule">
+ <tr><td style="border:none;text-align:left">
+<pre class="td">
+#Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule Chicago 1920 only - Jun 13 2:00 1:00 D
Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S
Rule Chicago 1921 only - Mar lastSun 2:00 1:00 D
@@ -58,49 +64,58 @@ Rule Chicago 1955 1966 - Oct lastSun 2:00 0 S
<th>At</th>
<th>Action</th>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">1920 only</td>
<td colspan="2">June 13<small><sup>th</sup></small></td>
<td rowspan="6">02:00 local</td>
<td>go to daylight saving time</td>
</tr>
-<tr align="center">
+<tr>
<td>1920</td>
<td>1921</td>
<td rowspan="5">last Sunday</td>
<td>in October</td>
<td>return to standard time</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">1921 only</td>
<td>in March</td>
<td rowspan="2">go to daylight saving time</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">1922</td>
<td>1966</td>
<td>in April</td>
</tr>
-<tr align="center">
+<tr>
<td>1954</td>
<td>in September</td>
<td rowspan="2">return to standard time</td>
</tr>
-<tr align="center">
+<tr>
<td>1955</td>
<td>1966</td>
<td>in October</td>
</tr>
</table>
-<p>We&rsquo;ll basically just ignore the <code>TYPE</code> column.
-In the 2007j release, the most recent as of this writing, the
-<code>TYPE</code> column never contains anything but a hyphen,
-a kind of null value. (From the description in <code>zic.8.txt</code>,
-this appears to be a mechanism for removing years from a set
-in some localizable way. It&rsquo;s used in the file, <code>pacificnew</code>,
-to determine whether a given year will have a US presidential election;
-but everything related to that use is commented out.)
+<p>The <code>FROM</code> and <code>TO</code> columns, respectively, specify the
+first and last calendar years defining a contiguous range over which a specific
+Rule line is to apply. The keyword <code>only</code> can be used in the
+<code>TO</code> field to repeat the value of the <code>FROM</code> field in the
+event that a rule should only apply to a single year. Often, the keyword
+<code>max</code> is used to extend a rule&rsquo;s application into the
+indefinite future; it is a platform-agnostic stand-in for the largest
+representable year.
+
+<p>The next column, <code>-</code>, is reserved; for compatibility with earlier
+releases, it always contains a hyphen, which acts as a kind of null value.
+Prior to the 2020b release, it was called the <code>TYPE</code> field, though
+it was never used in the main data. An obsolescent supplementary file used the
+field as a proof-of-concept to allow <code>zic</code> to apply a given Rule
+line only to certain &ldquo;types&rdquo; of years within the specified range as
+dictated by the output of a separate script, such as: only years which would
+have a US presidential election, or only years which wouldn&rsquo;t.
<p>The <code>SAVE</code> column contains the local (wall clock) offset from
local standard time.
@@ -141,14 +156,16 @@ time changed in 1955. Got it?</p>
<p>OK, now for the somewhat more interesting &ldquo;US&rdquo; rules:</p>
-<table border="1">
+<table>
<tr>
<th colspan="6">From the Source File</th>
</tr>
<tr>
- <td colspan="6" align="center"><table><tr><td>
-<pre>
-#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+ <td colspan="6">
+ <table class="rule">
+ <tr><td style="border:none;text-align:left">
+<pre class="td">
+#Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule US 1918 1919 - Mar lastSun 2:00 1:00 D
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
@@ -175,7 +192,7 @@ Rule US 2007 max - Nov Sun&gt;=1 2:00 0 S
<th>At</th>
<th>Action</th>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">1918</td>
<td rowspan="2">1919</td>
<td rowspan="2">last Sunday</td>
@@ -183,16 +200,16 @@ Rule US 2007 max - Nov Sun&gt;=1 2:00 0 S
<td rowspan="3">02:00 local</td>
<td>go to daylight saving time</td>
</tr>
-<tr align="center">
+<tr>
<td>in October</td>
<td>return to standard time</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">1942 only</td>
<td colspan="2">February 9<small><sup>th</sup></small></td>
<td>go to &ldquo;war time&rdquo;</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2" rowspan="2">1945 only</td>
<td colspan="2">August 14<small><sup>th</sup></small></td>
<td>23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a></td>
@@ -201,47 +218,47 @@ Rule US 2007 max - Nov Sun&gt;=1 2:00 0 S
clocks don&rsquo;t change
</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">September 30<small><sup>th</sup></small></td>
<td rowspan="9">02:00 local</td>
<td rowspan="2">return to standard time</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">1967</td>
<td>2006</td>
<td rowspan="2">last Sunday</td>
<td>in October</td>
</tr>
-<tr align="center">
+<tr>
<td>1973</td>
<td>in April</td>
<td rowspan="6">go to daylight saving time</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">1974 only</td>
<td colspan="2">January 6<small><sup>th</sup></small></td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">1975 only</td>
<td colspan="2">February 23<small><sup>rd</sup></small></td>
</tr>
-<tr align="center">
+<tr>
<td>1976</td>
<td>1986</td>
<td>last Sunday</td>
<td rowspan="2">in April</td>
</tr>
-<tr align="center">
+<tr>
<td>1987</td>
<td>2006</td>
<td>first Sunday</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">2007</td>
<td rowspan="2">present</td>
<td colspan="2">second Sunday in March</td>
</tr>
-<tr align="center">
+<tr>
<td colspan="2">first Sunday in November</td>
<td>return to standard time</td>
</tr>
@@ -307,13 +324,15 @@ rule, so there should be no change.</li>
<p>OK, now let&rsquo;s look at a Zone record:</p>
-<table border="1">
+<table>
<tr>
<th colspan="5">From the Source File</th>
</tr>
<tr>
- <td colspan="6" align="center"><table><tr><td>
-<pre>
+ <td colspan="5">
+ <table class="rule">
+ <tr><td style="border:none;text-align:left">
+<pre class="td">
#Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 12:09:24
-6:00 US C%sT 1920
@@ -341,49 +360,49 @@ Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 12:09:24
<th>Date</th>
<th>Time</th>
</tr>
-<tr align="center">
+<tr>
<td>&minus;5:50:36</td>
<td>not observed</td>
<td>LMT</td>
<td>1883-11-18</td>
<td>12:09:24</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">&minus;6:00:00</td>
<td>US rules</td>
<td rowspan="2">CST or CDT</td>
<td>1920-01-01</td>
<td>00:00:00</td>
</tr>
-<tr align="center">
+<tr>
<td>Chicago rules</td>
<td>1936-03-01</td>
<td rowspan="2">02:00:00</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;5:00:00</td>
<td>not observed</td>
<td>EST</td>
<td>1936-11-15</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="4">&minus;6:00:00</td>
<td>Chicago rules</td>
<td>CST or CDT</td>
<td>1942-01-01</td>
<td rowspan="3">00:00:00</td>
</tr>
-<tr align="center">
+<tr>
<td>US rules</td>
<td>CST, CWT or CPT</td>
<td>1946-01-01</td>
</tr>
-<tr align="center">
+<tr>
<td>Chicago rules</td>
<td rowspan="2">CST or CDT</td>
<td>1967-01-01</td>
</tr>
-<tr align="center">
+<tr>
<td>US rules</td>
<td colspan="2">&mdash;</td>
</tr>
@@ -548,14 +567,16 @@ the true offset is undefined.
<p>As a final example, here&rsquo;s the complete history for Hawaii:</p>
-<table border="1">
+<table>
<tr>
<th colspan="6">Relevant Excerpts from the US Rules</th>
</tr>
<tr>
- <td colspan="6" align="center"><table><tr><td>
-<pre>
-#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+ <td colspan="6">
+ <table class="rule">
+ <tr><td style="border:none;text-align:left">
+<pre class="td">
+#Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
@@ -567,8 +588,10 @@ Rule US 1945 only - Sep lastSun 2:00 0 S
<th colspan="6">The Zone Record</th>
</tr>
<tr>
- <td colspan="6" align="center"><table><tr><td>
-<pre>
+ <td colspan="6">
+ <table class="rule">
+ <tr><td style="border:none;text-align:left">
+<pre class="td">
#Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
-10:30 - HST 1933 Apr 30 2:00
@@ -593,7 +616,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<th>Date</th>
<th>Time</th>
</tr>
-<tr align="center">
+<tr>
<td>&minus;10:31:26</td>
<td>&mdash;</td>
<td>LMT</td>
@@ -601,7 +624,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<td>1896-01-13</td>
<td>12:00</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;10:30</td>
<td>+0:01:26</td>
<td>HST</td>
@@ -609,7 +632,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<td>1933-04-30</td>
<td>02:00</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;9:30</td>
<td>+1:00</td>
<td>HDT</td>
@@ -617,7 +640,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<td>1933-05-21</td>
<td>12:00</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;10:30&sup1;</td>
<td>&minus;1:00&sup1;</td>
<td>HST&sup1;</td>
@@ -625,7 +648,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<td>1942-02-09</td>
<td>02:00</td>
</tr>
-<tr align="center">
+<tr>
<td rowspan="2">&minus;9:30</td>
<td>+1:00</td>
<td>HWT</td>
@@ -633,38 +656,38 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
<td>1945-08-14</td>
<td>13:30&sup2;</td>
</tr>
-<tr align="center">
+<tr>
<td>0</td>
<td>HPT</td>
<td>Hawaii peace time</td>
<td>1945-09-30</td>
<td rowspan="2">02:00</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;10:30</td>
<td>&minus;1:00</td>
<td rowspan="2">HST</td>
<td rowspan="2">Hawaii standard time</td>
<td>1947-06-08</td>
</tr>
-<tr align="center">
+<tr>
<td>&minus;10:00&sup3;</td>
<td>+0:30&sup3;</td>
<td colspan="2">&mdash;</td>
</tr>
<tr>
- <td colspan="6">
+ <td colspan="6" class="footnote">
&sup1;Switching to US rules&hellip;most recent transition (in 1919) was to standard time
</td>
</tr>
<tr>
- <td colspan="6">
+ <td colspan="6" class="footnote">
&sup2;23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>
+ (&minus;9:30) = 13:30 local
</td>
</tr>
<tr>
- <td colspan="6">
+ <td colspan="6" class="footnote">
&sup3;Since <a href="https://en.wikipedia.org/wiki/ISO_8601">1947&ndash;06&ndash;08T12:30Z</a>,
the civil time in Hawaii has been
<a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>/<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>
diff --git a/tz/tz-link.html b/tz/tz-link.html
index 1f893f6..10c40b5 100644
--- a/tz/tz-link.html
+++ b/tz/tz-link.html
@@ -215,13 +215,18 @@ generated <a href="https://github.com/timparenti/tzdata-meta">automatically</a>.
If your government plans to change its time zone boundaries or
daylight saving rules, inform <code>tz@iana.org</code> well in
advance, as this will coordinate updates to many cell phones,
-computers, and other devices around the world. With
-less than a year's notice there is a good chance that some
-computer-based clocks will operate incorrectly after the change, due
+computers, and other devices around the world.
+The change should be officially announced at least a year before it affects
+how clocks operate; otherwise, there is a good chance that some
+clocks will operate incorrectly after the change, due
to delays in propagating updates to software and data. The shorter
the notice, the more likely clock problems will arise; see "<a
href="https://codeofmatt.com/2016/04/23/on-the-timing-of-time-zone-changes/">On
the Timing of Time Zone Changes</a>" for examples.
+The <code><abbr>tz</abbr></code> data can represent planned changes
+far into the future, and a long-planned change can easily be reverted
+or otherwise altered with a year's notice before the change would have
+affected clocks.
</p>
<p>
Changes to the <code><abbr>tz</abbr></code> code and data are often
@@ -240,13 +245,12 @@ href="https://play.google.com/store/apps/details?id=com.google.android.timezone.
<a
href="http://userguide.icu-project.org/datetime/timezone"><abbr
title="International Components for Unicode">ICU</abbr></a>,
-<a href="https://developer.ibm.com/javasdk/support/dst/jtzu/"><abbr>IBM</abbr></a>
-and <a
-href="https://www.oracle.com/technetwork/java/javase/tzupdater-readme-136440.html">Oracle</a>
-Java, <a href="https://www.joda.org/joda-time/tz_update.html">Joda-Time</a>, <a
+<a href="https://developer.ibm.com/javasdk/support/dst/jtzu/"><abbr>IBM</abbr>
+JDK</a>,
+<a href="https://www.joda.org/joda-time/tz_update.html">Joda-Time</a>, <a
href="https://dev.mysql.com/doc/refman/en/time-zone-support.html">MySQL</a>,
-and <a
-href="https://nodatime.org/userguide/tzdb">Noda Time</a> (see below).
+<a href="https://nodatime.org/userguide/tzdb">Noda Time</a>, and <a
+href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html#usage">OpenJDK/Oracle JDK</a>.
</p>
<p>Sources for the <code><abbr>tz</abbr></code> database are
<a href="https://en.wikipedia.org/wiki/UTF-8"><abbr
@@ -307,6 +311,12 @@ time and zones.</li>
<a href="https://timezoneconverterapp.com">Time Zone Converter</a> and
<a href="https://www.worldclock.com">The World Clock</a>
are time zone converters.</li>
+<li><a href="https://timezonedb.com/download">TimeZoneDB Database</a>
+publishes <code><abbr>tzdb</abbr></code>-derived data in
+<a href="https://en.wikipedia.org/wiki/Comma-separated_values"><abbr
+title="comma-separated values">CSV</abbr></a> and
+in <a href="https://en.wikipedia.org/wiki/SQL"><abbr
+title="Structured Query Language">SQL</abbr></a> form.</li>
<li><a
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>
@@ -339,6 +349,8 @@ href="https://tools.ietf.org/html/rfc7808">TZDIST</a>
along with <a href="https://tools.ietf.org/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> discussed the Internet draft <a
id="TZDIST-Geolocate"
@@ -423,9 +435,13 @@ freely available under the <abbr>MIT</abbr> license.</li>
<li>Java-based compilers and libraries include:
<ul>
<li>The <a
-href="https://www.oracle.com/technetwork/java/javase/tzupdater-readme-136440.html">TZUpdater
+href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html">TZUpdater
tool</a> compiles <code><abbr>tz</abbr></code> source into the format used by
-Oracle Java.</li>
+<a href="https://openjdk.java.net/">OpenJDK</a> and
+<a href="https://jdk.java.net/">Oracle JDK</a>.
+Although its source code is proprietary, its executable is available under the
+<a href="https://www.oracle.com/a/tech/docs/tzupdater-lic.html">Java SE
+Timezone Updater License Agreement</a>.</li>
<li>The <a
href="https://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html">Java
SE 8 Date and Time</a> <abbr>API</abbr> can be supplemented by <a
@@ -438,11 +454,10 @@ and time <abbr>API</abbr></a> contains a class
Java 8 <code>java.time</code>, which its users should migrate to once
they can assume Java 8 or later. It is available under the <a
href="https://www.apache.org/licenses/LICENSE-2.0">Apache License</a>.</li>
-<li><a href="https://bell-sw.com/pages/iana-updater/">IANA Updater</a>,
-<a href="https://github.com/akashche/tzdbgen">tzdbgen</a>, and <a
+<li><a href="https://bell-sw.com/pages/iana-updater/">IANA Updater</a> and <a
href="https://www.azul.com/products/open-source-tools/ziupdater-time-zone-tool/">ZIUpdater</a>
-are other alternatives to TZUpdater. IANA Updater's license is unclear;
-the others are licensed under the <abbr>GPL</abbr>.</li>
+are alternatives to TZUpdater. IANA Updater's license is unclear;
+ZIUpdater is licensed under the <abbr>GPL</abbr>.</li>
<li><a href="https://github.com/MenoData/Time4A">Time4A: Advanced date and
time library for Android</a> and
<a href="https://github.com/MenoData/Time4J/">Time4J: Advanced date,
@@ -460,9 +475,16 @@ Java-based libraries.</li>
time <abbr>API</abbr> for .NET</a>
is like Joda-Time and Time4J, but for the .NET framework instead of Java.
It is freely available under the Apache License.</li>
-<li><a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>-based
-compilers and libraries include:
+<li>Many modern
+<a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>
+runtimes support <code><abbr>tz</abbr></code> natively via the
+<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>.
+On other runtimes, you can use one of the following.
<ul>
+<li>The <a
+href="https://github.com/formatjs/date-time-format-timezone"><samp>Intl.DateTimeFormat</samp>
+timezone polyfill</a>
+is freely available under a <abbr>BSD</abbr>-style license.</li>
<li><a
href="https://github.com/kshetline/compact-time-zone-generator">CompactTimeZoneGenerator</a>
compiles time zone data into a compact form designed for
@@ -472,6 +494,9 @@ the <abbr>MIT</abbr> license and the Apache License.</li>
plugin for the <a href="https://momentjs.com">Moment.js</a> date
manipulation library. It is freely available under the <abbr>MIT</abbr>
license.</li>
+<li><a href="https://github.com/bigeasy/timezone">Timezone</a> is a
+JavaScript library that supports date arithmetic that is time zone
+aware. It is freely available under the <abbr>MIT</abbr> license.</li>
<li><a href="https://github.com/mde/timezone-js">TimezoneJS.Date</a>'s
<abbr>API</abbr> is upward compatible with standard JavaScript
Dates. It is freely available under the Apache License.</li>
@@ -492,7 +517,10 @@ It is freely available under a <abbr>BSD</abbr>-style license.</li>
<li><a href="http://pytz.sourceforge.net">pytz &ndash; World Timezone
Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
<a href="https://www.python.org">Python</a>.
-It is freely available under a <abbr>BSD</abbr>-style license.</li>
+It is freely available under a <abbr>BSD</abbr>-style license.
+In code that can assume Python 3.9 or later it is superseded by
+<a href="#python-zoneinfo"><code>zoneinfo.ZoneInfo</code></a>
+and the <a href="#pypi-tzdata"><code>tzdata</code> Python package</a>.</li>
<li><a href="https://tzinfo.github.io">TZInfo &ndash;
Ruby Timezone Library</a>
compiles <code><abbr>tz</abbr></code> source into
@@ -549,9 +577,6 @@ title="PHP: Hypertext Preprocessor">PHP</abbr></a>,
<a href="https://hhvm.com"><abbr title="HipHop Virtual Machine">HHVM</abbr></a>,
and <a href="https://www.mongodb.com">MongoDB</a>.
It is freely available under the <abbr>MIT</abbr> license.</li>
-<li><a href="https://github.com/bigeasy/timezone">Timezone</a> is a
-JavaScript library that supports date arithmetic that is time zone
-aware. It is freely available under the <abbr>MIT</abbr> license.</li>
<li>Tcl, mentioned <a href="#Tcl">above</a>, also contains a
<abbr>TZif</abbr> file reader.</li>
<li><a href="https://metacpan.org/pod/DateTime::TimeZone::Tzfile">
@@ -559,6 +584,17 @@ DateTime::TimeZone::Tzfile</a>
is a <abbr>TZif</abbr> file reader written in Perl.
It is freely available under the same terms as Perl
(dual <abbr>GPL</abbr> and Artistic license).</li>
+<li>Python has a <a id="python-zoneinfo"
+href="https://docs.python.org/3.9/library/zoneinfo.html"><code>zoneinfo.ZoneInfo</code>
+class</a> that reads <abbr>TZif</abbr> data and creates objects
+that represent <code><abbr>tzdb</abbr></code> timezones.
+Python is freely available under the
+<a href="https://docs.python.org/3.9/license.html">Python Software Foundation
+License</a>.
+A companion <a id="pypi-tzdata" href="https://pypi.org/">PyPI</a> module
+<a href="https://pypi.org/project/tzdata/"><code>tzdata</code></a>
+supplies TZif data if the underlying system data cannot be found;
+it is freely available under the Apache License.</li>
<li>The
public-domain <a href="https://github.com/dbaron/tz.js">tz.js</a>
library contains a Python tool that
@@ -740,7 +776,7 @@ href="https://www.geonames.org/export/web-services.html#timezone">GeoNames
Timezone web service</a>, the <a
href="https://developers.google.com/maps/documentation/timezone/intro">Google
Maps Time Zone API</a>, and
-the <a href="https://timezonedb.com">Time Zone Database &amp; API</a>.
+the <a href="https://timezonedb.com/api">TimeZoneDB API</a>.
Commercial network API access is provided
by <a href="https://askgeo.com">AskGeo</a>
and <a href="https://www.geogarage.com/blog/news-1/post/geogarage-time-zone-api-31">GeoGarage</a>.
@@ -892,7 +928,8 @@ href="http://sohma.armada.mil.uy/index.php/servicios/datos-astronomicos" hreflan
<h2 id="costs">Costs and benefits of time shifts</h2>
<p>Various sources argue for and against daylight saving time and time
zone shifts, and many scientific studies have been conducted. This
-section summarizes reviews of scientific literature in the area.</p>
+section summarizes reviews and position statements based on
+scientific literature in the area.</p>
<ul>
<li>Carey RN, Sarma KM.
<a href="https://bmjopen.bmj.com/content/7/6/e014319.long">Impact of
@@ -910,6 +947,13 @@ doi:<a href="https://doi.org/10.5547/01956574.39.2.thav">10.5547/01956574.39.2.t
This analyzes research literature and concludes, "Electricity savings
are larger for countries farther away from the equator, while
subtropical regions consume more electricity because of DST."</li>
+<li>Rishi MA, Ahmed O, Barrantes Perez JH <em>et al</em>.
+<a href="https://jcsm.aasm.org/doi/10.5664/jcsm.8780">Daylight saving time:
+an American Academy of Sleep Medicine position statement</a>.
+<em>J Clin Sleep Med.</em>
+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
+DST transitions and permanent DST.</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 &ndash; a battle between
diff --git a/tz/tzfile.5 b/tz/tzfile.5
index 3f13563..2642978 100644
--- a/tz/tzfile.5
+++ b/tz/tzfile.5
@@ -40,25 +40,25 @@ Fifteen bytes containing zeros reserved for future use.
Six four-byte integer values, in the following order:
.RS
.TP
-.I tzh_ttisutcnt
+.B tzh_ttisutcnt
The number of UT/local indicators stored in the file.
(UT is Universal Time.)
.TP
-.I tzh_ttisstdcnt
+.B tzh_ttisstdcnt
The number of standard/wall indicators stored in the file.
.TP
-.I tzh_leapcnt
+.B tzh_leapcnt
The number of leap seconds for which data entries are stored in the file.
.TP
-.I tzh_timecnt
+.B tzh_timecnt
The number of transition times for which data entries are stored
in the file.
.TP
-.I tzh_typecnt
+.B tzh_typecnt
The number of local time types for which data entries are stored
in the file (must not be zero).
.TP
-.I tzh_charcnt
+.B tzh_charcnt
The number of bytes of time zone abbreviation strings
stored in the file.
.RE
@@ -66,14 +66,14 @@ stored in the file.
The above header is followed by the following fields, whose lengths
depend on the contents of the header:
.IP * 2
-.I tzh_timecnt
+.B tzh_timecnt
four-byte signed integer values sorted in ascending order.
These values are written in network byte order.
Each is used as a transition time (as returned by
.BR time (2))
at which the rules for computing local time change.
.IP *
-.I tzh_timecnt
+.B tzh_timecnt
one-byte unsigned integer values;
each one but the last tells which of the different types of local time types
described in the file is associated with the time period
@@ -83,8 +83,8 @@ and continuing up to but not including the next transition time.
POSIX-style TZ string described below.)
These values serve as indices into the next field.
.IP *
-.I tzh_typecnt
-.I ttinfo
+.B tzh_typecnt
+.B ttinfo
entries, each defined as follows:
.in +.5i
.sp
@@ -99,36 +99,36 @@ struct ttinfo {
.fi
.sp
Each structure is written as a four-byte signed integer value for
-.IR tt_utoff ,
+.BR tt_utoff ,
in network byte order, followed by a one-byte boolean for
-.I tt_isdst
+.B tt_isdst
and a one-byte value for
-.IR tt_desigidx .
+.BR tt_desigidx .
In each structure,
-.I tt_utoff
+.B tt_utoff
gives the number of seconds to be added to UT,
-.I tt_isdst
+.B tt_isdst
tells whether
-.I tm_isdst
+.B tm_isdst
should be set by
.BR localtime (3)
and
-.I tt_desigidx
+.B tt_desigidx
serves as an index into the array of time zone abbreviation bytes
that follow the
-.I ttinfo
+.B ttinfo
structure(s) in the file.
The
-.I tt_utoff
+.B tt_utoff
value is never equal to \-2**31, to let 32-bit clients negate it without
overflow.
Also, in realistic applications
-.I tt_utoff
+.B tt_utoff
is in the range [\-89999, 93599] (i.e., more than \-25 hours and less
than 26 hours); this allows easy support by implementations that
already support the POSIX-required range [\-24:59:59, 25:59:59].
.IP *
-.I tzh_leapcnt
+.B tzh_leapcnt
pairs of four-byte values, written in network byte order;
the first value of each pair gives the nonnegative time
(as returned by
@@ -142,12 +142,12 @@ The pairs of values are sorted in ascending order by time.
Each transition is for one leap second, either positive or negative;
transitions always separated by at least 28 days minus 1 second.
.IP *
-.I tzh_ttisstdcnt
+.B tzh_ttisstdcnt
standard/wall indicators, each stored as a one-byte boolean;
they tell whether the transition times associated with local time types
were specified as standard time or local (wall clock) time.
.IP *
-.I tzh_ttisutcnt
+.B tzh_ttisutcnt
UT/local indicators, each stored as a one-byte boolean;
they tell whether the transition times associated with local time types
were specified as UT or local time.
@@ -173,10 +173,10 @@ The
.BR localtime (3)
function
normally uses the first
-.I ttinfo
+.B ttinfo
structure in the file
if either
-.I tzh_timecnt
+.B tzh_timecnt
is zero or the time argument is less than the first transition time recorded
in the file.
.SS Version 2 format
@@ -235,7 +235,7 @@ This guideline helps obsolescent version 1 readers
agree with current readers about timestamps within the
contiguous subsequence. It also lets writers not
supporting obsolescent readers use a
-.I tzh_timecnt
+.B tzh_timecnt
of zero
in the version 1 data block to save space.
.PP
diff --git a/tz/tzselect.8 b/tz/tzselect.8
index 51f751c..a1ec8d0 100644
--- a/tz/tzselect.8
+++ b/tz/tzselect.8
@@ -82,7 +82,7 @@ Output version information and exit.
.TP
\f3AWK\fP
Name of a Posix-compliant
-.I awk
+.B awk
program (default:
.BR awk ).
.TP
diff --git a/tz/yearistype.sh b/tz/yearistype.sh
deleted file mode 100644
index d674175..0000000
--- a/tz/yearistype.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-: 'Determine whether year is of appropriate type (this file is obsolete).'
-
-: 'This file is in the public domain, so clarified as of'
-: '2006-07-17 by Arthur David Olson.'
-
-case $#-$1 in
- 2-|2-0*|2-*[!0-9]*)
- echo "$0: wild year: $1" >&2
- exit 1 ;;
-esac
-
-case $#-$2 in
- 2-even)
- case $1 in
- *[24680]) exit 0 ;;
- *) exit 1 ;;
- esac ;;
- 2-nonpres|2-nonuspres)
- case $1 in
- *[02468][048]|*[13579][26]) exit 1 ;;
- *) exit 0 ;;
- esac ;;
- 2-odd)
- case $1 in
- *[13579]) exit 0 ;;
- *) exit 1 ;;
- esac ;;
- 2-uspres)
- case $1 in
- *[02468][048]|*[13579][26]) exit 0 ;;
- *) exit 1 ;;
- esac ;;
- 2-*)
- echo "$0: wild type: $2" >&2 ;;
-esac
-
-echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
-exit 1
diff --git a/tz/zdump.8 b/tz/zdump.8
index 98109ad..f3e4e4e 100644
--- a/tz/zdump.8
+++ b/tz/zdump.8
@@ -212,7 +212,7 @@ and
output,
.q "UT"
denotes the value returned by
-.IR gmtime (3),
+.BR gmtime (3),
which uses UTC for modern timestamps and some other UT flavor for
timestamps that predate the introduction of UTC.
No attempt is currently made to have the output use
diff --git a/tz/zic.8 b/tz/zic.8
index b57cd2b..dcd2fa3 100644
--- a/tz/zic.8
+++ b/tz/zic.8
@@ -61,15 +61,13 @@ is
.BR slim ,
keep the output files small; this can help check for the bugs
and incompatibilities.
-Although the default is currently
-.BR fat ,
-this is intended to change in future
-.B zic
-versions, as software that mishandles the 64-bit data typically
+The default is
+.BR slim ,
+as software that mishandles 64-bit data typically
mishandles timestamps after the year 2038 anyway.
Also see the
.B \*-r
-option for another way to shrink output size.
+option for another way to alter output size.
.TP
.BI "\*-d " directory
Create time conversion information files in the named directory rather than
@@ -85,6 +83,12 @@ will act as if the input contained a link line of the form
.ti +.5i
.ta \w'Link\0\0'u +\w'\fItimezone\fP\0\0'u
Link \fItimezone\fP localtime
+.sp
+If
+.I timezone
+is
+.BR \*- ,
+any already-existing link is removed.
.TP
.BI "\*-L " leapsecondfilename
Read leap second information from the file with the given name.
@@ -109,6 +113,12 @@ and it should not be combined with
if
.IR timezone 's
transitions are at standard time or Universal Time (UT) instead of local time.
+.sp
+If
+.I timezone
+is
+.BR \*- ,
+any already-existing link is removed.
.TP
.BR "\*-r " "[\fB@\fP\fIlo\fP][\fB/@\fP\fIhi\fP]"
Reduce the size of output files by limiting their applicability
@@ -224,7 +234,7 @@ or that starts with
.RE
.SH FILES
Input files use the format described in this section; output files use
-.IR tzfile (5)
+.BR tzfile (5)
format.
.PP
Input files should be text files, that is, they should be a series of
@@ -268,9 +278,9 @@ abbreviation must be unambiguous in context.
A rule line has the form
.nf
.ti +.5i
-.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00w\0\0'u +\w'1:00d\0\0'u
+.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'\*-\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00w\0\0'u +\w'1:00d\0\0'u
.sp
-Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule NAME FROM TO \*- IN ON AT SAVE LETTER/S
.sp
For example:
.ti +.5i
@@ -319,12 +329,17 @@ may be used to repeat the value of the
.B FROM
field.
.TP
-.B TYPE
-should be
+.B \*-
+Is a reserved field and should always contain
.q \*-
-and is present for compatibility with older versions of
-.B zic
-in which it could contain year types.
+for compatibility with older versions of
+.BR zic .
+It was previously known as the
+.B TYPE
+field, which could contain values to allow a
+separate script to further restrict in which
+.q types
+of years the rule would apply.
.TP
.B IN
Names the month in which the rule takes effect.
@@ -695,9 +710,9 @@ and for its predecessor organization, the European Communities.
.ne 22
.nf
.in +2m
-.ta \w'# Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u
+.ta \w'# Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'\*-\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00\0\0'u +\w'SAVE\0\0'u
.sp
-# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+# Rule NAME FROM TO \*- IN ON AT SAVE LETTER/S
Rule Swiss 1941 1942 \*- May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 \*- Oct Mon>=1 2:00 0 \*-
.sp .5
diff --git a/tz/zic.c b/tz/zic.c
index 2875b55..a902b34 100644
--- a/tz/zic.c
+++ b/tz/zic.c
@@ -81,7 +81,6 @@ struct rule {
zic_t r_loyear; /* for example, 1986 */
zic_t r_hiyear; /* for example, 1986 */
- const char * r_yrtype;
bool r_lowasnum;
bool r_hiwasnum;
@@ -133,22 +132,22 @@ struct zone {
#if !HAVE_POSIX_DECLS
extern int getopt(int argc, char * const argv[],
const char * options);
-extern int link(const char * fromname, const char * toname);
+extern int link(const char * target, const char * linkname);
extern char * optarg;
extern int optind;
#endif
#if ! HAVE_LINK
-# define link(from, to) (errno = ENOTSUP, -1)
+# define link(target, linkname) (errno = ENOTSUP, -1)
#endif
#if ! HAVE_SYMLINK
# define readlink(file, buf, size) (errno = ENOTSUP, -1)
-# define symlink(from, to) (errno = ENOTSUP, -1)
+# define symlink(target, linkname) (errno = ENOTSUP, -1)
# define S_ISLNK(m) 0
#endif
#ifndef AT_SYMLINK_FOLLOW
-# define linkat(fromdir, from, todir, to, flag) \
- (itssymlink(from) ? (errno = ENOTSUP, -1) : link(from, to))
+# define linkat(targetdir, target, linknamedir, linkname, flag) \
+ (itssymlink(target) ? (errno = ENOTSUP, -1) : link(target, linkname))
#endif
static void addtt(zic_t starttime, int type);
@@ -182,7 +181,6 @@ static void rulesub(struct rule * rp,
const char * typep, const char * monthp,
const char * dayp, const char * timep);
static zic_t tadd(zic_t t1, zic_t t2);
-static bool yearistype(zic_t year, const char * type);
/* Bound on length of what %z can expand to. */
enum { PERCENT_Z_LEN_BOUND = sizeof "+995959" - 1 };
@@ -275,8 +273,8 @@ static int typecnt;
** Which fields are which on a Link line.
*/
-#define LF_FROM 1
-#define LF_TO 2
+#define LF_TARGET 1
+#define LF_LINKNAME 2
#define LINK_FIELDS 3
/*
@@ -313,8 +311,8 @@ static ptrdiff_t nzones_alloc;
struct link {
const char * l_filename;
lineno l_linenum;
- const char * l_from;
- const char * l_to;
+ const char * l_target;
+ const char * l_linkname;
};
static struct link * links;
@@ -658,11 +656,10 @@ static const char * lcltime;
static const char * directory;
static const char * leapsec;
static const char * tzdefault;
-static const char * yitcommand;
/* -1 if the TZif output file should be slim, 0 if default, 1 if the
- output should be fat for backward compatibility. Currently the
- default is fat, although this may change. */
+ output should be fat for backward compatibility. ZIC_BLOAT_DEFAULT
+ determines the default. */
static int bloat;
static bool
@@ -672,7 +669,7 @@ want_bloat(void)
}
#ifndef ZIC_BLOAT_DEFAULT
-# define ZIC_BLOAT_DEFAULT "fat"
+# define ZIC_BLOAT_DEFAULT "slim"
#endif
int
@@ -763,15 +760,7 @@ _("%s: More than one -p option specified\n"),
tzdefault = optarg;
break;
case 'y':
- if (yitcommand == NULL) {
- warning(_("-y is obsolescent"));
- yitcommand = optarg;
- } else {
- fprintf(stderr,
-_("%s: More than one -y option specified\n"),
- progname);
- return EXIT_FAILURE;
- }
+ warning(_("-y ignored"));
break;
case 'L':
if (leapsec == NULL)
@@ -807,14 +796,19 @@ _("%s: invalid time range: %s\n"),
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
usage(stderr, EXIT_FAILURE); /* usage message by request */
- if (bloat == 0)
- bloat = strcmp(ZIC_BLOAT_DEFAULT, "slim") == 0 ? -1 : 1;
+ if (bloat == 0) {
+ static char const bloat_default[] = ZIC_BLOAT_DEFAULT;
+ if (strcmp(bloat_default, "slim") == 0)
+ bloat = -1;
+ else if (strcmp(bloat_default, "fat") == 0)
+ bloat = 1;
+ else
+ abort(); /* Configuration error. */
+ }
if (directory == NULL)
directory = TZDIR;
if (tzdefault == NULL)
tzdefault = TZDEFAULT;
- if (yitcommand == NULL)
- yitcommand = "yearistype";
if (optind < argc && leapsec != NULL) {
infile(leapsec);
@@ -840,11 +834,11 @@ _("%s: invalid time range: %s\n"),
*/
for (i = 0; i < nlinks; ++i) {
eat(links[i].l_filename, links[i].l_linenum);
- dolink(links[i].l_from, links[i].l_to, false);
+ dolink(links[i].l_target, links[i].l_linkname, false);
if (noise)
for (j = 0; j < nlinks; ++j)
- if (strcmp(links[i].l_to,
- links[j].l_from) == 0)
+ if (strcmp(links[i].l_linkname,
+ links[j].l_target) == 0)
warning(_("link to link"));
}
if (lcltime != NULL) {
@@ -936,27 +930,27 @@ namecheck(const char *name)
is relative to the global variable DIRECTORY. TO can be either
relative or absolute. */
static char *
-relname(char const *from, char const *to)
+relname(char const *target, char const *linkname)
{
size_t i, taillen, dotdotetcsize;
size_t dir_len = 0, dotdots = 0, linksize = SIZE_MAX;
- char const *f = from;
+ char const *f = target;
char *result = NULL;
- if (*to == '/') {
+ if (*linkname == '/') {
/* Make F absolute too. */
size_t len = strlen(directory);
bool needslash = len && directory[len - 1] != '/';
- linksize = len + needslash + strlen(from) + 1;
+ linksize = len + needslash + strlen(target) + 1;
f = result = emalloc(linksize);
strcpy(result, directory);
result[len] = '/';
- strcpy(result + len + needslash, from);
+ strcpy(result + len + needslash, target);
}
- for (i = 0; f[i] && f[i] == to[i]; i++)
+ for (i = 0; f[i] && f[i] == linkname[i]; i++)
if (f[i] == '/')
dir_len = i + 1;
- for (; to[i]; i++)
- dotdots += to[i] == '/' && to[i - 1] != '/';
+ for (; linkname[i]; i++)
+ dotdots += linkname[i] == '/' && linkname[i - 1] != '/';
taillen = strlen(f + dir_len);
dotdotetcsize = 3 * dotdots + taillen + 1;
if (dotdotetcsize <= linksize) {
@@ -972,53 +966,56 @@ relname(char const *from, char const *to)
/* Hard link FROM to TO, following any symbolic links.
Return 0 if successful, an error number otherwise. */
static int
-hardlinkerr(char const *from, char const *to)
+hardlinkerr(char const *target, char const *linkname)
{
- int r = linkat(AT_FDCWD, from, AT_FDCWD, to, AT_SYMLINK_FOLLOW);
+ int r = linkat(AT_FDCWD, target, AT_FDCWD, linkname, AT_SYMLINK_FOLLOW);
return r == 0 ? 0 : errno;
}
static void
-dolink(char const *fromfield, char const *tofield, bool staysymlink)
+dolink(char const *target, char const *linkname, bool staysymlink)
{
- bool todirs_made = false;
+ bool remove_only = strcmp(target, "-") == 0;
+ bool linkdirs_made = false;
int link_errno;
/*
** We get to be careful here since
** there's a fair chance of root running us.
*/
- if (itsdir(fromfield)) {
- fprintf(stderr, _("%s: link from %s/%s failed: %s\n"),
- progname, directory, fromfield, strerror(EPERM));
+ if (!remove_only && itsdir(target)) {
+ fprintf(stderr, _("%s: linking target %s/%s failed: %s\n"),
+ progname, directory, target, strerror(EPERM));
exit(EXIT_FAILURE);
}
if (staysymlink)
- staysymlink = itssymlink(tofield);
- if (remove(tofield) == 0)
- todirs_made = true;
+ staysymlink = itssymlink(linkname);
+ if (remove(linkname) == 0)
+ linkdirs_made = true;
else if (errno != ENOENT) {
char const *e = strerror(errno);
fprintf(stderr, _("%s: Can't remove %s/%s: %s\n"),
- progname, directory, tofield, e);
+ progname, directory, linkname, e);
exit(EXIT_FAILURE);
}
- link_errno = staysymlink ? ENOTSUP : hardlinkerr(fromfield, tofield);
- if (link_errno == ENOENT && !todirs_made) {
- mkdirs(tofield, true);
- todirs_made = true;
- link_errno = hardlinkerr(fromfield, tofield);
+ if (remove_only)
+ return;
+ link_errno = staysymlink ? ENOTSUP : hardlinkerr(target, linkname);
+ if (link_errno == ENOENT && !linkdirs_made) {
+ mkdirs(linkname, true);
+ linkdirs_made = true;
+ link_errno = hardlinkerr(target, linkname);
}
if (link_errno != 0) {
- bool absolute = *fromfield == '/';
- char *linkalloc = absolute ? NULL : relname(fromfield, tofield);
- char const *contents = absolute ? fromfield : linkalloc;
- int symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno;
- if (!todirs_made
+ bool absolute = *target == '/';
+ char *linkalloc = absolute ? NULL : relname(target, linkname);
+ char const *contents = absolute ? target : linkalloc;
+ int symlink_errno = symlink(contents, linkname) == 0 ? 0 : errno;
+ if (!linkdirs_made
&& (symlink_errno == ENOENT || symlink_errno == ENOTSUP)) {
- mkdirs(tofield, true);
+ mkdirs(linkname, true);
if (symlink_errno == ENOENT)
- symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno;
+ symlink_errno = symlink(contents, linkname) == 0 ? 0 : errno;
}
free(linkalloc);
if (symlink_errno == 0) {
@@ -1028,24 +1025,24 @@ dolink(char const *fromfield, char const *tofield, bool staysymlink)
} else {
FILE *fp, *tp;
int c;
- fp = fopen(fromfield, "rb");
+ fp = fopen(target, "rb");
if (!fp) {
char const *e = strerror(errno);
fprintf(stderr, _("%s: Can't read %s/%s: %s\n"),
- progname, directory, fromfield, e);
+ progname, directory, target, e);
exit(EXIT_FAILURE);
}
- tp = fopen(tofield, "wb");
+ tp = fopen(linkname, "wb");
if (!tp) {
char const *e = strerror(errno);
fprintf(stderr, _("%s: Can't create %s/%s: %s\n"),
- progname, directory, tofield, e);
+ progname, directory, linkname, e);
exit(EXIT_FAILURE);
}
while ((c = getc(fp)) != EOF)
putc(c, tp);
- close_file(fp, directory, fromfield);
- close_file(tp, directory, tofield);
+ close_file(fp, directory, target);
+ close_file(tp, directory, linkname);
if (link_errno != ENOTSUP)
warning(_("copy used because hard link failed: %s"),
strerror(link_errno));
@@ -1624,16 +1621,16 @@ inlink(char **fields, int nfields)
error(_("wrong number of fields on Link line"));
return;
}
- if (*fields[LF_FROM] == '\0') {
- error(_("blank FROM field on Link line"));
+ if (*fields[LF_TARGET] == '\0') {
+ error(_("blank TARGET field on Link line"));
return;
}
- if (! namecheck(fields[LF_TO]))
+ if (! namecheck(fields[LF_LINKNAME]))
return;
l.l_filename = filename;
l.l_linenum = linenum;
- l.l_from = ecpyalloc(fields[LF_FROM]);
- l.l_to = ecpyalloc(fields[LF_TO]);
+ l.l_target = ecpyalloc(fields[LF_TARGET]);
+ l.l_linkname = ecpyalloc(fields[LF_LINKNAME]);
links = growalloc(links, sizeof *links, nlinks, &nlinks_alloc);
links[nlinks++] = l;
}
@@ -1729,16 +1726,10 @@ rulesub(struct rule *rp, const char *loyearp, const char *hiyearp,
error(_("starting year greater than ending year"));
return;
}
- if (*typep == '\0')
- rp->r_yrtype = NULL;
- else {
- if (rp->r_loyear == rp->r_hiyear) {
- error(_("typed single year"));
- return;
- }
- warning(_("year type \"%s\" is obsolete; use \"-\" instead"),
+ if (*typep != '\0') {
+ error(_("year type \"%s\" is unsupported; use \"-\" instead"),
typep);
- rp->r_yrtype = ecpyalloc(typep);
+ return;
}
/*
** Day work.
@@ -2500,8 +2491,6 @@ stringzone(char *result, struct zone const *zpfirst, ptrdiff_t zonecount)
rp = &zp->z_rules[i];
if (rp->r_hiwasnum || rp->r_hiyear != ZIC_MAX)
continue;
- if (rp->r_yrtype != NULL)
- continue;
if (!rp->r_isdst) {
if (stdrp == NULL)
stdrp = rp;
@@ -2756,14 +2745,14 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
/*
** Mark which rules to do in the current year.
** For those to do, calculate rpytime(rp, year);
+ ** The former TYPE field was also considered here.
*/
for (j = 0; j < zp->z_nrules; ++j) {
rp = &zp->z_rules[j];
eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum);
rp->r_todo = year >= rp->r_loyear &&
- year <= rp->r_hiyear &&
- yearistype(year, rp->r_yrtype);
+ year <= rp->r_hiyear;
if (rp->r_todo) {
rp->r_temp = rpytime(rp, year);
rp->r_todo
@@ -3054,50 +3043,6 @@ adjleap(void)
}
}
-static char *
-shellquote(char *b, char const *s)
-{
- *b++ = '\'';
- while (*s) {
- if (*s == '\'')
- *b++ = '\'', *b++ = '\\', *b++ = '\'';
- *b++ = *s++;
- }
- *b++ = '\'';
- return b;
-}
-
-static bool
-yearistype(zic_t year, const char *type)
-{
- char *buf;
- char *b;
- int result;
-
- if (type == NULL || *type == '\0')
- return true;
- buf = emalloc(1 + 4 * strlen(yitcommand) + 2
- + INT_STRLEN_MAXIMUM(zic_t) + 2 + 4 * strlen(type) + 2);
- b = shellquote(buf, yitcommand);
- *b++ = ' ';
- b += sprintf(b, "%"PRIdZIC, year);
- *b++ = ' ';
- b = shellquote(b, type);
- *b = '\0';
- result = system(buf);
- if (WIFEXITED(result)) {
- int status = WEXITSTATUS(result);
- if (status <= 1) {
- free(buf);
- return status == 0;
- }
- }
- error(_("Wild result from command execution"));
- fprintf(stderr, _("%s: command was '%s', result was %d\n"),
- progname, buf, result);
- exit(EXIT_FAILURE);
-}
-
/* Is A a space character in the C locale? */
static bool
is_space(char a)
diff --git a/tz/ziguard.awk b/tz/ziguard.awk
index e8ef49e..e27e799 100644
--- a/tz/ziguard.awk
+++ b/tz/ziguard.awk
@@ -3,6 +3,13 @@
# Contributed by Paul Eggert. This file is in the public domain.
# This is not a general-purpose converter; it is designed for current tzdata.
+# It just converts from current source to main, vanguard, and rearguard forms.
+# Although it might be nice for it to be idempotent, or to be useful
+# for converting back and forth between vanguard and rearguard formats,
+# it does not do these nonessential tasks now.
+#
+# Although main and vanguard forms are currently equivalent,
+# this need not always be the case.
#
# When converting to vanguard form, the output can use negative SAVE
# values.
@@ -28,7 +35,7 @@ DATAFORM != "main" {
in_comment = /^#/
uncomment = comment_out = 0
- # If the line should differ due to Czechoslovakia using negative SAVE values,
+ # 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" && /1947 Feb 23/) {
if (($(in_comment + 2) != "-") == vanguard) {
diff --git a/tz/zishrink.awk b/tz/zishrink.awk
index 4e187ac..1947c7c 100644
--- a/tz/zishrink.awk
+++ b/tz/zishrink.awk
@@ -166,9 +166,6 @@ function process_input_line(line, \
ruleline = sub(/^Rule /, "R ", line)
zoneline = sub(/^Zone /, "Z ", line)
- # SystemV rules are not needed.
- if (line ~ /^R SystemV /) return
-
# Replace FooAsia rules with the same rules without "Asia", as they
# are duplicates.
if (match(line, /[^ ]Asia /)) {
@@ -275,7 +272,6 @@ BEGIN {
default_dep["factory"] = 1
default_dep["northamerica"] = 1
default_dep["southamerica"] = 1
- default_dep["systemv"] = 1
default_dep["ziguard.awk"] = 1
default_dep["zishrink.awk"] = 1
diff --git a/tz/zoneinfo2tdf.pl b/tz/zoneinfo2tdf.pl
index e07b00c..176fce9 100755
--- a/tz/zoneinfo2tdf.pl
+++ b/tz/zoneinfo2tdf.pl
@@ -38,7 +38,7 @@ while (<>) {
}
$contZone = $fields[1] if @fields > 5;
} elsif ($type eq 'rule') {
- # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+ # 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