From: DongHun Kwak
Date: Tue, 8 Nov 2016 04:00:02 +0000 (+0900)
Subject: Imported Upstream version 2016g
X-Git-Tag: upstream/2016g^0
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F96135%2F1;p=platform%2Fupstream%2Ftzdata.git
Imported Upstream version 2016g
Change-Id: I2ed58b1d0d5448130185c3c476b25ec3e7eeb750
Signed-off-by: DongHun Kwak
---
diff --git a/LICENSE b/LICENSE
index a9b60d8..148eb23 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
With a few exceptions, all files in the tz code and data (including
-this one) are in the public domain. The exceptions are tzcode's
-date.c, newstrftime.3, and strftime.c, which contain material derived
-from BSD and which use the BSD 3-clause license.
+this one) are in the public domain. The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.
diff --git a/Makefile b/Makefile
index bbe1ba8..79b4cdb 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@
# Package name for the code distribution.
PACKAGE= tzcode
-# Version numbers of the code and data distributions.
-VERSION= 2016f
+# Version number for the distribution, overridden in the 'tarballs' rule below.
+VERSION= unknown
# Email address for bug reports.
BUGEMAIL= tz@iana.org
@@ -240,7 +240,7 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
CFLAGS=
# Linker flags. Default to $(LFLAGS) for backwards compatibility
-# to tzcode2012h and earlier.
+# to release 2012h and earlier.
LDFLAGS= $(LFLAGS)
@@ -256,7 +256,7 @@ ZIC= $(zic) $(ZFLAGS)
ZFLAGS=
-# How to use zic to install tzdata binary files.
+# How to use zic to install tz binary files.
ZIC_INSTALL= $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
@@ -272,16 +272,16 @@ AWK= awk
KSHELL= /bin/bash
# The path where SGML DTDs are kept and the catalog file(s) to use when
-# validating. The default is appropriate for Ubuntu 13.10.
+# validating. 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/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 your web pages.
-# See for a validator, and
-# for a validation library.
+# See for a validator, and
+# for a validation library.
VALIDATE = nsgmls
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
VALIDATE_ENV = \
@@ -326,7 +326,7 @@ OK_LINE= '^'$(OK_CHAR)'*$$'
# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
-GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w
+GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
then echo $(GNUTARFLAGS); \
else :; \
@@ -356,7 +356,7 @@ HEADERS= tzfile.h private.h
NONLIBSRCS= zic.c zdump.c
NEWUCBSRCS= date.c strftime.c
SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
- tzselect.ksh workman.sh
+ tzselect.ksh version workman.sh
MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
tzfile.5 tzselect.8 zic.8 zdump.8
MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
@@ -378,7 +378,32 @@ DATA= $(YDATA) $(NDATA) backzone $(TABDATA) \
leap-seconds.list yearistype.sh
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
-ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
+TZS_YEAR= 2050
+TZS= to$(TZS_YEAR).tzs
+TZS_NEW= to$(TZS_YEAR)new.tzs
+TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \
+ private.h tzfile.h zdump.c zic.c
+ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS)
+
+# Consult these files when deciding whether to rebuild the 'version' file.
+# This list is not the same as the output of 'git ls-files', since
+# .gitignore is not distributed.
+VERSION_DEPS= \
+ CONTRIBUTING LICENSE Makefile NEWS README Theory \
+ africa antarctica asctime.c asia australasia \
+ backward backzone \
+ checklinks.awk checktab.awk \
+ date.1 date.c difftime.c \
+ 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 \
+ time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \
+ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
+ workman.sh yearistype.sh \
+ zdump.8 zdump.c zic.8 zic.c \
+ zone.tab zone1970.tab zoneinfo2tdf.pl
# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .
@@ -408,9 +433,16 @@ INSTALL: ALL install date.1
cp date $(DESTDIR)$(BINDIR)/.
cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
-version.h:
+version: $(VERSION_DEPS)
+ { V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
+ --abbrev=7 --dirty) || \
+ V=$(VERSION); } && \
+ printf '%s\n' "$$V" >$@
+
+version.h: version
(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
- echo 'static char const TZVERSION[]="$(VERSION)";' && \
+ printf 'static char const TZVERSION[]="%s";\n' \
+ "$$(cat version)" && \
echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@
zdump: $(TZDOBJS)
@@ -477,6 +509,27 @@ posix_packrat:
zones: $(REDO)
+$(TZS_NEW): $(TDATA) zdump zic
+ mkdir -p tzs.dir
+ $(zic) -d tzs.dir $(TDATA)
+ $(AWK) '/^Link/{print $$1 "\t" $$2 "\t" $$3}' \
+ $(TDATA) | LC_ALL=C sort >$@.out
+ zones=$$($(AWK) -v wd="$$(pwd)" \
+ '/^Zone/{print wd "/tzs.dir/" $$2}' $(TDATA) \
+ | LC_ALL=C sort) && \
+ ./zdump -i -c $(TZS_YEAR) $$zones >>$@.out
+ sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@
+ rm -fr tzs.dir $@.out
+
+# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
+# If it exists but 'make check_tzs' fails, a maintainer should inspect the
+# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
+$(TZS):
+ $(MAKE) force_tzs
+
+force_tzs: $(TZS_NEW)
+ cp $(TZS_NEW) $(TZS)
+
libtz.a: $(LIBOBJS)
$(AR) ru $@ $(LIBOBJS)
$(RANLIB) $@
@@ -484,19 +537,19 @@ libtz.a: $(LIBOBJS)
date: $(DATEOBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
-tzselect: tzselect.ksh
+tzselect: tzselect.ksh version
sed \
-e 's|#!/bin/bash|#!$(KSHELL)|g' \
-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
- -e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
- <$? >$@
+ -e 's|\(TZVERSION\)=.*|\1='"$$(cat version)"'|' \
+ <$@.ksh >$@
chmod +x $@
check: check_character_set check_white_space check_links check_sorted \
- check_tables check_web
+ check_tables check_tzs check_web
check_character_set: $(ENCHILADA)
LC_ALL=en_US.utf8 && export LC_ALL && \
@@ -532,6 +585,9 @@ check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
|| exit; \
done
+check_tzs: $(TZS) $(TZS_NEW)
+ diff -u $(TZS) $(TZS_NEW)
+
check_web: $(WEB_PAGES)
$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
@@ -539,12 +595,12 @@ clean_misc:
rm -f core *.o *.out \
date tzselect version.h zdump zic yearistype libtz.a
clean: clean_misc
- rm -fr tzpublic
+ rm -fr *.dir tzdb-*/ $(TZS_NEW)
maintainer-clean: clean
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
- rm -f leapseconds $(MANTXTS) *.asc *.tar.gz
+ rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
names:
@echo $(ENCHILADA)
@@ -591,6 +647,8 @@ set-timestamps.out: $(ENCHILADA)
touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
exit; \
done
+ touch -cmr $$(ls -t $(TZS_DEPS) | sed 1q) $(TZS)
+ touch -cmr $$(ls -t $(VERSION_DEPS) | sed 1q) version
touch $@
# The zics below ensure that each data file can stand on its own.
@@ -599,12 +657,12 @@ set-timestamps.out: $(ENCHILADA)
check_public:
$(MAKE) maintainer-clean
$(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
- mkdir tzpublic
+ mkdir -p public.dir
for i in $(TDATA) ; do \
- $(zic) -v -d tzpublic $$i 2>&1 || exit; \
+ $(zic) -v -d public.dir $$i 2>&1 || exit; \
done
- $(zic) -v -d tzpublic $(TDATA)
- rm -fr tzpublic
+ $(zic) -v -d public.dir $(TDATA)
+ rm -fr public.dir
# Check that the code works under various alternative
# implementations of time_t.
@@ -616,15 +674,15 @@ check_time_t_alternatives:
fi && \
zones=`$(AWK) '/^[^#]/ { print $$3 }' tzpublic/int64_t.out && \
- tzpublic/$$type/etc/zdump -V -t $$range $$zones \
- >tzpublic/$$type.out && \
- diff -u tzpublic/int64_t.out tzpublic/$$type.out \
+ time_t.dir/int64_t/etc/zdump -V -t $$range $$zones \
+ >time_t.dir/int64_t.out && \
+ time_t.dir/$$type/etc/zdump -V -t $$range $$zones \
+ >time_t.dir/$$type.out && \
+ diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
|| exit; \
done
- rm -fr tzpublic
+ rm -fr time_t.dir
+
+tarballs signatures: version
+ $(MAKE) VERSION="$$(cat version)" $@_version
-tarballs: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
+tarballs_version: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz \
+ tzdb-$(VERSION).tar.lz
tzcode$(VERSION).tar.gz: set-timestamps.out
LC_ALL=C && export LC_ALL && \
@@ -655,7 +717,16 @@ tzdata$(VERSION).tar.gz: set-timestamps.out
tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
gzip $(GZIPFLAGS) > $@
-signatures: tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc
+tzdb-$(VERSION).tar.lz: set-timestamps.out
+ rm -fr tzdb-$(VERSION)
+ mkdir tzdb-$(VERSION)
+ ln $(ENCHILADA) tzdb-$(VERSION)
+ touch -cmr $$(ls -t tzdb-$(VERSION)/* | sed 1q) tzdb-$(VERSION)
+ LC_ALL=C && export LC_ALL && \
+ tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 > $@
+
+signatures_version: tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \
+ tzdb-$(VERSION).tar.lz.asc
tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
gpg --armor --detach-sign $?
@@ -663,6 +734,9 @@ tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
gpg --armor --detach-sign $?
+tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
+ gpg --armor --detach-sign $?
+
typecheck:
$(MAKE) clean
for i in "long long" unsigned; \
@@ -688,8 +762,10 @@ zic.o: private.h tzfile.h version.h
.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_links
.PHONY: check_public check_sorted check_tables
-.PHONY: check_time_t_alternatives check_web check_white_space clean clean_misc
+.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
+.PHONY: clean clean_misc force_tzs
.PHONY: install install_data maintainer-clean names
.PHONY: posix_only posix_packrat posix_right
-.PHONY: public right_only right_posix signatures tarballs typecheck
+.PHONY: public right_only right_posix signatures signatures_version
+.PHONY: tarballs tarballs_version typecheck
.PHONY: zonenames zones
diff --git a/NEWS b/NEWS
index f59583f..c88dff2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,128 @@
News for the tz database
+Release 2016g - 2016-09-13 08:56:38 -0700
+
+ Changes to future time stamps
+
+ Turkey switched from EET/EEST (+02/+03) to permanent +03,
+ effective 2016-09-07. (Thanks to Burak AYDIN.) Use "+03" rather
+ than an invented abbreviation for the new time.
+
+ New leap second 2016-12-31 23:59:60 UTC as per IERS Bulletin C 52.
+ (Thanks to Tim Parenti.)
+
+ Changes to past time stamps
+
+ For America/Los_Angeles, spring-forward transition times have been
+ corrected from 02:00 to 02:01 in 1948, and from 02:00 to 01:00 in
+ 1950-1966.
+
+ For zones using Soviet time on 1919-07-01, transitions to UT-based
+ time were at 00:00 UT, not at 02:00 local time. The affected
+ zones are Europe/Kirov, Europe/Moscow, Europe/Samara, and
+ Europe/Ulyanovsk. (Thanks to Alexander Belopolsky.)
+
+ Changes to past and future time zone abbreviations
+
+ The Factory zone now uses the time zone abbreviation -00 instead
+ of a long English-language string, as -00 is now the normal way to
+ represent an undefined time zone.
+
+ Several zones in Antarctica and the former Soviet Union, along
+ with zones intended for ships at sea that cannot use POSIX TZ
+ strings, now use numeric time zone abbreviations instead of
+ invented or obsolete alphanumeric abbreviations. The affected
+ zones are Antarctica/Casey, Antarctica/Davis,
+ Antarctica/DumontDUrville, Antarctica/Mawson, Antarctica/Rothera,
+ Antarctica/Syowa, Antarctica/Troll, Antarctica/Vostok,
+ Asia/Anadyr, Asia/Ashgabat, Asia/Baku, Asia/Bishkek, Asia/Chita,
+ Asia/Dushanbe, Asia/Irkutsk, Asia/Kamchatka, Asia/Khandyga,
+ Asia/Krasnoyarsk, Asia/Magadan, Asia/Omsk, Asia/Sakhalin,
+ Asia/Samarkand, Asia/Srednekolymsk, Asia/Tashkent, Asia/Tbilisi,
+ Asia/Ust-Nera, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg,
+ Asia/Yerevan, Etc/GMT-14, Etc/GMT-13, Etc/GMT-12, Etc/GMT-11,
+ Etc/GMT-10, Etc/GMT-9, Etc/GMT-8, Etc/GMT-7, Etc/GMT-6, Etc/GMT-5,
+ Etc/GMT-4, Etc/GMT-3, Etc/GMT-2, Etc/GMT-1, Etc/GMT+1, Etc/GMT+2,
+ Etc/GMT+3, Etc/GMT+4, Etc/GMT+5, Etc/GMT+6, Etc/GMT+7, Etc/GMT+8,
+ Etc/GMT+9, Etc/GMT+10, Etc/GMT+11, Etc/GMT+12, Europe/Kaliningrad,
+ Europe/Minsk, Europe/Samara, Europe/Volgograd, and
+ Indian/Kerguelen. For Europe/Moscow the invented abbreviation MSM
+ was replaced by +05, whereas MSK and MSD were kept as they are not
+ our invention and are widely used.
+
+ Changes to zone names
+
+ Rename Asia/Rangoon to Asia/Yangon, with a backward compatibility link.
+ (Thanks to David Massoud.)
+
+ Changes to code
+
+ zic no longer generates binary files containing POSIX TZ-like
+ strings that disagree with the local time type after the last
+ explicit transition in the data. This fixes a bug with
+ Africa/Casablanca and Africa/El_Aaiun in some year-2037 time
+ stamps on the reference platform. (Thanks to Alexander Belopolsky
+ for reporting the bug and suggesting a way forward.)
+
+ If the installed localtime and/or posixrules files are symbolic
+ links, zic now keeps them symbolic links when updating them, for
+ compatibility with platforms like OpenSUSE where other programs
+ configure these files as symlinks.
+
+ zic now avoids hard linking to symbolic links, avoids some
+ unnecessary mkdir and stat system calls, and uses shorter file
+ names internally.
+
+ zdump has a new -i option to generate transitions in a
+ more-compact but still human-readable format. This option is
+ experimental, and the output format may change in future versions.
+ (Thanks to Jon Skeet for suggesting that an option was needed,
+ and thanks to Tim Parenti and Chris Rovick for further comments.)
+
+ Changes to build procedure
+
+ An experimental distribution format is available, in addition
+ to the traditional format which will continue to be distributed.
+ The new format is a tarball tzdb-VERSION.tar.lz with signature
+ file tzdb-VERSION.tar.lz.asc. It unpacks to a top-level directory
+ tzdb-VERSION containing the code and data of the traditional
+ two-tarball format, along with extra data that may be useful.
+ (Thanks to Antonio Diaz Diaz, Oscar van Vlijmen, and many others
+ for comments about the experimental format.)
+
+ The release version number is now more accurate in the usual case
+ where releases are built from a Git repository. For example, if
+ 23 commits and some working-file changes have been made since
+ release 2016g, the version number is now something like
+ '2016g-23-g50556e3-dirty' instead of the misleading '2016g'.
+ Official releases uses the same version number format as before,
+ e.g., '2016g'. To support the more-accurate version number, its
+ specification has moved from a line in the Makefile to a new
+ source file 'version'.
+
+ The experimental distribution contains a file to2050.tzs that
+ contains what should be the output of 'zdump -i -c 2050' on
+ primary zones. If this file is available, 'make check' now checks
+ that zdump generates this output.
+
+ 'make check_web' now works on Fedora-like distributions.
+
+ Changes to documentation and commentary
+
+ tzfile.5 now documents the new restriction on POSIX TZ-like
+ strings that is now implemented by zic.
+
+ Comments now cite URLs for some 1917-1921 Russian DST decrees.
+ (Thanks to Alexander Belopolsky.)
+
+ tz-link.htm mentions JuliaTime (thanks to Curtis Vogt) and Time4J
+ (thanks to Meno Hochschild) and ThreeTen-Extra, and its
+ description of Java 8 has been brought up to date (thanks to
+ Stephen Colebourne). Its description of local time on Mars has
+ been updated to match current practice, and URLs have been updated
+ and some obsolete ones removed.
+
+
Release 2016f - 2016-07-05 16:26:51 +0200
Changes affecting future time stamps
@@ -393,7 +516,7 @@ Release 2015d - 2015-04-24 08:09:46 -0700
Changes affecting past time stamps
- America/Whitehorse switched from UTC-9 to UTC-8 on 1967-05-28, not
+ America/Whitehorse switched from UT -09 to -08 on 1967-05-28, not
1966-07-01. Also, Yukon's time zone history is documented better.
(Thanks to Brian Inglis and Dennis Ferguson.)
@@ -427,12 +550,12 @@ Release 2015c - 2015-04-11 08:55:55 -0700
The 1918 transition was September 10, not September 1.
- The UTC-4 time observed from 1932 to 1942 is now considered to be
- standard time, not year-round DST.
+ The UT -04 time observed from 1932 to 1942 is now considered to
+ be standard time, not year-round DST.
- Santiago observed DST (UTC-3) from 1946-07-15 through 1946-08-31,
- then reverted to standard time, then switched its time zone to
- UTC-5 on 1947-04-01.
+ Santiago observed DST (UT -03) from 1946-07-15 through
+ 1946-08-31, then reverted to standard time, then switched to -05
+ on 1947-04-01.
Assume transitions before 1968 were at 00:00, since we have no data
saying otherwise.
@@ -561,7 +684,7 @@ Release 2014j - 2014-11-10 17:37:11 -0800
Changes affecting current and future time stamps
- Turks & Caicos' switch from US eastern time to UTC-4 year-round
+ Turks & Caicos' switch from US eastern time to UT -04 year-round
did not occur on 2014-11-02 at 02:00. It's currently scheduled
for 2015-11-01 at 02:00. (Thanks to Chris Walton.)
@@ -597,7 +720,7 @@ Release 2014i - 2014-10-21 22:04:57 -0700
years will use a similar pattern.
A new Zone Pacific/Bougainville, for the part of Papua New Guinea
- that plans to switch from UTC+10 to UTC+11 on 2014-12-28 at 02:00.
+ that plans to switch from UT +10 to +11 on 2014-12-28 at 02:00.
(Thanks to Kiley Walbom for the heads-up.)
Changes affecting time zone abbreviations
@@ -607,8 +730,8 @@ Release 2014i - 2014-10-21 22:04:57 -0700
to its more-traditional value MSK on 2014-10-26 at 01:00.
(Thanks to Alexander Bokovoy for the heads-up about Belarus.)
- The new abbreviation IDT stands for the pre-1976 use of UT+8 in
- Indochina, to distinguish it better from ICT (UT+7).
+ The new abbreviation IDT stands for the pre-1976 use of UT +08 in
+ Indochina, to distinguish it better from ICT (+07).
Changes affecting past time stamps
@@ -686,7 +809,7 @@ Release 2014h - 2014-09-25 18:59:03 -0700
zdump -c no longer mishandles transitions near year boundaries.
(Thanks to Tim Parenti for reporting the problem.)
- An access to uninitalized data has been fixed.
+ An access to uninitialized data has been fixed.
(Thanks to Jörg Richter for reporting the problem.)
When THREAD_SAFE is defined, the code ports to the C11 memory model.
@@ -719,8 +842,8 @@ Release 2014g - 2014-08-28 12:31:23 -0700
Changes affecting future time stamps
- Turks & Caicos is switching from US eastern time to UTC-4 year-round,
- modeled as a switch from EST/EDT to AST on 2014-11-02 at 02:00.
+ Turks & Caicos is switching from US eastern time to UT -04
+ year-round, modeled as a switch on 2014-11-02 at 02:00.
[As noted in 2014j, this switch was later delayed.]
Changes affecting past time stamps
@@ -903,7 +1026,7 @@ Release 2014f - 2014-08-05 17:42:36 -0700
This change does not affect UTC offsets, only time zone abbreviations.
(Thanks to Rich Tibbett and many others.)
- Asia/Novokuznetsk shifts from NOVT to KRAT (remaining on UTC+7)
+ Asia/Novokuznetsk shifts from NOVT to KRAT (remaining on UT +07)
effective 2014-10-26 at 02:00 local time.
The time zone abbreviation for Xinjiang Time (observed in Ãrümqi)
@@ -932,8 +1055,8 @@ Release 2014f - 2014-08-05 17:42:36 -0700
zones Asia/Harbin, Asia/Chongqing, and Asia/Kashgar have been
removed; backwards-compatibility links still work, albeit with
different behaviors for time stamps before May 1980. Asia/Urumqi's
- 1980 transition to UTC+8 has been removed, so that it is now at
- UTC+6 and not UTC+8. (Thanks to Luther Ma and to Alois Treindl;
+ 1980 transition to UT +08 has been removed, so that it is now at
+ +06 and not +08. (Thanks to Luther Ma and to Alois Treindl;
Treindl sent helpful translations of two papers by Guo Qingsheng.)
Some zones have been turned into links, when they differed from existing
@@ -963,8 +1086,8 @@ Release 2014f - 2014-08-05 17:42:36 -0700
Europe/Helsinki's 1942 fall-back transition was 10-04 at 01:00, not
10-03 at 00:00. (Thanks to Konstantin Hyppönen.)
- Pacific/Pago_Pago has been changed from UTC-11:30 to UTC-11 for the period
- from 1911 to 1950.
+ Pacific/Pago_Pago has been changed from UT -11:30 to -11 for the
+ period from 1911 to 1950.
Pacific/Chatham has been changed to New Zealand standard time plus
45 minutes for the period before 1957, reflecting a 1956 remark in
@@ -1291,15 +1414,15 @@ Release 2013h - 2013-10-25 15:32:32 -0700
Changes affecting current and future time stamps:
- Libya has switched its time zone back to UTC+2 without DST,
- instead of UTC+1 with DST. (Thanks to Even Scharning.)
+ Libya has switched its UT offset back to +02 without DST, instead
+ of +01 with DST. (Thanks to Even Scharning.)
Western Sahara (Africa/El_Aaiun) uses Morocco's DST rules.
(Thanks to Gwillim Law.)
Changes affecting future time stamps:
- Acre and (we guess) western Amazonas will switch from UTC-4 to UTC-5
+ Acre and (we guess) western Amazonas will switch from UT -04 to -05
on 2013-11-10. This affects America/Rio_Branco and America/Eirunepe.
(Thanks to Steffen Thorsen.)
@@ -1386,7 +1509,7 @@ Release 2013f - 2013-09-24 23:37:36 -0700
Tocantins will very likely not observe DST starting this spring.
(Thanks to Steffen Thorsen.)
- Jordan will likely stay at UTC+3 indefinitely, and will not fall
+ Jordan will likely stay at UT +03 indefinitely, and will not fall
back this fall.
Palestine will fall back at 00:00, not 01:00. (Thanks to Steffen Thorsen.)
@@ -1443,7 +1566,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700
Benny Lin.) This affects Asia/Dili, Asia/Jakarta, Asia/Jayapura,
Asia/Makassar, and Asia/Pontianak.
- Use ART (UTC-3, standard time), rather than WARST (also UTC-3, but
+ Use ART (UT -03, standard time), rather than WARST (also -03, but
daylight saving time) for San Luis, Argentina since 2009.
Changes affecting Godthåb time stamps after 2037 if version mismatch
@@ -1900,7 +2023,7 @@ Release 2012f - 2012-09-12 23:17:03 -0700
Release 2012e - 2012-08-02 20:44:55 -0700
- * australasia (Pacific/Fakaofo): Tokelau is UTC+13, not UTC+14.
+ * australasia (Pacific/Fakaofo): Tokelau is UT +13, not +14.
(Thanks to Steffen Thorsen.)
* Use a single version number for both code and data.
@@ -3519,14 +3642,15 @@ This file contains copies of the part of each release announcement
that talks about the changes in that release. The text has been
adapted and reformatted for the purposes of this file.
-Typically a release R consists of a pair of tarball files,
+Traditionally a release R consists of a pair of tarball files,
tzcodeR.tar.gz and tzdataR.tar.gz. However, some releases (e.g.,
code2010a, data2012c) consist of just one or the other tarball, and a
few (e.g., code2012c-data2012d) have tarballs with mixed version
-numbers.
+numbers. Recent releases also come in an experimental format
+consisting of a single tarball tzdb-R.tar.lz with extra data.
Release time stamps are taken from the release's commit (for newer,
-git releases), from the newest file in the tarball (for older
+Git-based releases), from the newest file in the tarball (for older
releases, where this info is available) or from the email announcing
the release (if all else fails; these are marked with a time zone of
-0000 and an "is missing!" comment).
diff --git a/README b/README
index 8deaf16..8a09aa2 100644
--- a/README
+++ b/README
@@ -13,12 +13,20 @@ and daylight-saving rules.
Here is a recipe for acquiring, building, installing, and testing the
tz distribution on a GNU/Linux or similar host.
+To acquire the distribution, run the following shell commands:
+
mkdir tz
cd tz
wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz'
gzip -dc tzcode-latest.tar.gz | tar -xf -
gzip -dc tzdata-latest.tar.gz | tar -xf -
+Alternatively, the following shell commands acquire the same
+distribution, with extra data useful for regression testing:
+
+ wget --retr-symlinks 'ftp://ftp.iana.org/tz/tzdb-latest.tar.lz'
+ lzip -dc tzdb-latest.tar.lz | tar -xf -
+
Be sure to read the comments in "Makefile" and make any changes needed
to make things right for your system, especially if you are using some
platform other than GNU/Linux. Then run the following commands,
diff --git a/Theory b/Theory
index 60678fe..6d7342c 100644
--- a/Theory
+++ b/Theory
@@ -323,7 +323,7 @@ Errors in the tz database arise from many sources:
* Sometimes historical timekeeping was specified more precisely
than what the tz database can handle. For example, from 1909 to
- 1937 Netherlands clocks were legally UT+00:19:32.13, but the tz
+ 1937 Netherlands clocks were legally UT +00:19:32.13, but the tz
database cannot represent the fractional second.
* Even when all the timestamp transitions recorded by the tz database
diff --git a/africa b/africa
index 50f29d5..d35aaa5 100644
--- a/africa
+++ b/africa
@@ -464,7 +464,7 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
#
# From Paul Eggert (2013-10-25):
-# For now, assume they're reverting to the pre-2012 rules of permanent UTC+2.
+# 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 Libya 1951 only - Oct 14 2:00 1:00 S
diff --git a/antarctica b/antarctica
index a537832..0995835 100644
--- a/antarctica
+++ b/antarctica
@@ -10,9 +10,7 @@
# http://www.spri.cam.ac.uk/bob/periant.htm
# for information.
# Unless otherwise specified, we have no time zone information.
-#
-# Except for the French entries,
-# I made up all time zone abbreviations mentioned here; corrections welcome!
+
# FORMAT is '-00' and GMTOFF is 0 for locations while uninhabited.
# Argentina - year-round bases
@@ -29,7 +27,7 @@
# previously sealers and scientific personnel wintered
# Margaret Turner reports
# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
-# (1999-09-30) that they're UTC+5, with no DST;
+# (1999-09-30) that they're UT +05, with no DST;
# presumably this is when they have visitors.
#
# year-round bases
@@ -68,23 +66,22 @@
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Casey 0 - -00 1969
- 8:00 - AWST 2009 Oct 18 2:00
- # Australian Western Std Time
- 11:00 - CAST 2010 Mar 5 2:00 # Casey Time
- 8:00 - AWST 2011 Oct 28 2:00
- 11:00 - CAST 2012 Feb 21 17:00u
- 8:00 - AWST
+ 8:00 - +08 2009 Oct 18 2:00
+ 11:00 - +11 2010 Mar 5 2:00
+ 8:00 - +08 2011 Oct 28 2:00
+ 11:00 - +11 2012 Feb 21 17:00u
+ 8:00 - +08
Zone Antarctica/Davis 0 - -00 1957 Jan 13
- 7:00 - DAVT 1964 Nov # Davis Time
+ 7:00 - +07 1964 Nov
0 - -00 1969 Feb
- 7:00 - DAVT 2009 Oct 18 2:00
- 5:00 - DAVT 2010 Mar 10 20:00u
- 7:00 - DAVT 2011 Oct 28 2:00
- 5:00 - DAVT 2012 Feb 21 20:00u
- 7:00 - DAVT
+ 7:00 - +07 2009 Oct 18 2:00
+ 5:00 - +05 2010 Mar 10 20:00u
+ 7:00 - +07 2011 Oct 28 2:00
+ 5:00 - +05 2012 Feb 21 20:00u
+ 7:00 - +07
Zone Antarctica/Mawson 0 - -00 1954 Feb 13
- 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time
- 5:00 - MAWT
+ 6:00 - +06 2009 Oct 18 2:00
+ 5:00 - +05
# References:
# Casey Weather (1998-02-26)
# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html
@@ -138,7 +135,7 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
- 5:00 - TFT # ISO code TF Time
+ 5:00 - +05
#
# year-round base in the main continent
# Dumont d'Urville, Ãle des Pétrels, -6640+14001, since 1956-11
@@ -149,9 +146,9 @@ Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/DumontDUrville 0 - -00 1947
- 10:00 - PMT 1952 Jan 14 # Port-Martin Time
+ 10:00 - +10 1952 Jan 14
0 - -00 1956 Nov
- 10:00 - DDUT # Dumont-d'Urville Time
+ 10:00 - +10
# France & Italy - year-round base
# Concordia, -750600+1232000, since 2005
@@ -177,7 +174,7 @@ Zone Antarctica/DumontDUrville 0 - -00 1947
# station of Japan, it's appropriate for the principal location.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Syowa 0 - -00 1957 Jan 29
- 3:00 - SYOT # Syowa Time
+ 3:00 - +03
# See:
# NIPR Antarctic Research Activities (1999-08-17)
# http://www.nipr.ac.jp/english/ara01.html
@@ -214,17 +211,17 @@ Zone Antarctica/Syowa 0 - -00 1957 Jan 29
# correct, but they should be quite close to the actual dates.
#
# From Paul Eggert (2014-03-21):
-# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# The CET-switching Troll rules require zic from tz 2014b or later, so as
# 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 Troll 2005 max - Mar 1 1:00u 1:00 CET
-Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST
-#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET
-#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC
+#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
+#Rule Troll 2004 max - Nov 7 1:00u 0:00 +00
# Remove the following line when uncommenting the above '#Rule' lines.
-Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC
+Rule Troll 2004 max - Oct lastSun 1:00u 0:00 +00
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Troll 0 - -00 2005 Feb 12
0:00 Troll %s
@@ -265,10 +262,10 @@ Zone Antarctica/Troll 0 - -00 2005 Feb 12
# changes during the year and does not necessarily correspond to mean
# solar noon. So the Vostok time might have been whatever the clocks
# happened to be during their visit. So we still don't really know what time
-# it is at Vostok. But we'll guess UTC+6.
+# it is at Vostok. But we'll guess +06.
#
Zone Antarctica/Vostok 0 - -00 1957 Dec 16
- 6:00 - VOST # Vostok time
+ 6:00 - +06
# S Africa - year-round bases
# Marion Island, -4653+03752
@@ -301,7 +298,7 @@ Zone Antarctica/Vostok 0 - -00 1957 Dec 16
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Rothera 0 - -00 1976 Dec 1
- -3:00 - ROTT # Rothera time
+ -3:00 - -03
# Uruguay - year round base
# Artigas, King George Island, -621104-0585107
diff --git a/asia b/asia
index 533e218..71ef878 100644
--- a/asia
+++ b/asia
@@ -116,13 +116,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890
# http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
- 3:00 - YERT 1957 Mar # Yerevan Time
- 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s
- 3:00 1:00 YERST 1991 Sep 23 # independence
- 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s
- 4:00 - AMT 1997
- 4:00 RussiaAsia AM%sT 2012 Feb 9
- 4:00 - AMT
+ 3:00 - +03 1957 Mar
+ 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
+ 3:00 RussiaAsia +03/+04 1995 Sep 24 2:00s
+ 4:00 - +04 1997
+ 4:00 RussiaAsia +04/+05
# Azerbaijan
@@ -143,13 +141,12 @@ Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 S
Rule Azer 1997 2015 - Oct lastSun 5:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Baku 3:19:24 - LMT 1924 May 2
- 3:00 - BAKT 1957 Mar # Baku Time
- 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s
- 3:00 1:00 BAKST 1991 Aug 30 # independence
- 3:00 RussiaAsia AZ%sT 1992 Sep lastSun 2:00s
- 4:00 - AZT 1996 # Azerbaijan Time
- 4:00 EUAsia AZ%sT 1997
- 4:00 Azer AZ%sT
+ 3:00 - +03 1957 Mar
+ 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
+ 3:00 RussiaAsia +03/+04 1992 Sep lastSun 2:00s
+ 4:00 - +04 1996
+ 4:00 EUAsia +04/+05 1997
+ 4:00 Azer +04/+05
# Bahrain
# See Asia/Qatar.
@@ -268,7 +265,7 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
+Zone Asia/Yangon 6:24:40 - LMT 1880 # or Rangoon
6:24:40 - RMT 1920 # Rangoon Mean Time?
6:30 - BURT 1942 May # Burma Time
9:00 - JST 1945 May 3
@@ -383,7 +380,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# Lewiston (ME) Daily Sun (1939-05-29), p 17, said "Even the time is
# different - the occupied districts going by Tokyo time, an hour
# ahead of that prevailing in the rest of Shanghai." Guess that the
-# Xujiahui Observatory was under French control and stuck with UT+8.
+# Xujiahui Observatory was under French control and stuck with UT +08.
#
# In earlier versions of this file, China had many separate Zone entries, but
# this was based on what were apparently incorrect data in Shanks & Pottenger.
@@ -392,26 +389,26 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# Proposed in 1918 and theoretically in effect until 1949 (although in practice
# mainly observed in coastal areas), the five zones were:
#
-# Changbai Time ("Long-white Time", Long-white = Heilongjiang area) UT+8.5
+# Changbai Time ("Long-white Time", Long-white = Heilongjiang area) UT +08:30
# Asia/Harbin (currently a link to Asia/Shanghai)
# Heilongjiang (except Mohe county), Jilin
#
-# Zhongyuan Time ("Central plain Time") UT+8
+# Zhongyuan Time ("Central plain Time") UT +08
# Asia/Shanghai
# most of China
# This currently represents most other zones as well,
# as apparently these regions have been the same since 1970.
# Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
-# Guo says Shanghai switched to UT+8 "from the end of the 19th century".
+# Guo says Shanghai switched to UT +08 "from the end of the 19th century".
#
-# Long-shu Time (probably due to Long and Shu being two names of that area) UT+7
+# Long-shu Time (probably due to Long and Shu being two names of the area) UT +07
# Asia/Chongqing (currently a link to Asia/Shanghai)
# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
# Yangchun, Yangjiang, Yu'nan, and Yunfu.
#
-# Xin-zang Time ("Xinjiang-Tibet Time") UT+6
+# Xin-zang Time ("Xinjiang-Tibet Time") UT +06
# Asia/Urumqi
# This currently represents Kunlun Time as well,
# as apparently the two regions have been the same since 1970.
@@ -424,7 +421,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
#
-# Kunlun Time UT+5.5
+# Kunlun Time UT +05:30
# Asia/Kashgar (currently a link to Asia/Urumqi)
# West Tibet, including Pulan, Aheqi, Shufu, Shule;
# West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
@@ -440,7 +437,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
#
# On the other hand, ethnic Uyghurs, who make up about half the
# population of Xinjiang, typically use "Xinjiang time" which is two
-# hours behind Beijing time, or UTC +0600. The government of the Xinjiang
+# hours behind Beijing time, or UT +06. The government of the Xinjiang
# Uyghur Autonomous Region, (XAUR, or just Xinjiang for short) as well as
# local governments such as the Ãrümqi city government use both times in
# publications, referring to what is popularly called Xinjiang time as
@@ -496,8 +493,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# having the same time as Beijing.
# From Paul Eggert (2014-06-30):
-# In the early days of the PRC, Tibet was given its own time zone (UT+6) but
-# this was withdrawn in 1959 and never reinstated; see Tubten Khétsun,
+# In the early days of the PRC, Tibet was given its own time zone (UT +06)
+# but this was withdrawn in 1959 and never reinstated; see Tubten Khétsun,
# Memories of life in Lhasa under Chinese Rule, Columbia U Press, ISBN
# 978-0231142861 (2008), translator's introduction by Matthew Akester, p x.
# As this is before our 1970 cutoff, Tibet doesn't need a separate zone.
@@ -511,12 +508,12 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# Republics, the Soviet Union, the Kuomintang, and the People's Republic of
# China, and tracking down all these organizations' timekeeping rules would be
# quite a trick. Approximate this lost history by a transition from LMT to
-# XJT at the start of 1928, the year of accession of the warlord Jin Shuren,
+# UT +06 at the start of 1928, the year of accession of the warlord Jin Shuren,
# which happens to be the date given by Shanks & Pottenger (no doubt as a
-# guess) as the transition from LMT. Ignore the usage of UT+8 before
-# 1986-02-01 under the theory that the transition date to UT+8 is unknown and
+# guess) as the transition from LMT. Ignore the usage of +08 before
+# 1986-02-01 under the theory that the transition date to +08 is unknown and
# that the sort of users who prefer Asia/Urumqi now typically ignored the
-# UT+8 mandate back then.
+# +08 mandate back then.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
# Beijing time, used throughout China; represented by Shanghai.
@@ -721,7 +718,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
# be found from historical government announcement database.
# From Paul Eggert (2014-07-03):
-# As per Yu-Cheng Chuang, say that Taiwan was at UT+9 from 1937-10-01
+# As per Yu-Cheng Chuang, say that Taiwan was at UT +09 from 1937-10-01
# until 1945-09-21 at 01:00, overriding Shanks & Pottenger.
# Likewise, use Yu-Cheng Chuang's data for DST in Taiwan.
@@ -835,16 +832,15 @@ Link Asia/Nicosia Europe/Nicosia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Tbilisi 2:59:11 - LMT 1880
2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time
- 3:00 - TBIT 1957 Mar # Tbilisi Time
- 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s
- 3:00 1:00 TBIST 1991 Apr 9 # independence
- 3:00 RussiaAsia GE%sT 1992 # Georgia Time
- 3:00 E-EurAsia GE%sT 1994 Sep lastSun
- 4:00 E-EurAsia GE%sT 1996 Oct lastSun
- 4:00 1:00 GEST 1997 Mar lastSun
- 4:00 E-EurAsia GE%sT 2004 Jun 27
- 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00
- 4:00 - GET
+ 3:00 - +03 1957 Mar
+ 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
+ 3:00 RussiaAsia +03/+04 1992
+ 3:00 E-EurAsia +03/+04 1994 Sep lastSun
+ 4:00 E-EurAsia +04/+05 1996 Oct lastSun
+ 4:00 1:00 +05 1997 Mar lastSun
+ 4:00 E-EurAsia +04/+05 2004 Jun 27
+ 3:00 RussiaAsia +03/+04 2005 Mar lastSun 2:00
+ 4:00 - +04
# East Timor
@@ -921,7 +917,7 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
# These would be the earliest possible times for a change.
# Régimes horaires pour le monde entier, by Henri Le Corre, (Ãditions
# Traditionnelles, 1987, Paris) says that Java and Madura switched
-# from JST to UTC+07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
+# from UT +09 to +07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
# (Hollandia). For now, assume all Indonesian locations other than Jayapura
# switched on 1945-09-23.
#
@@ -932,11 +928,11 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
# summary published by the Time and Frequency Laboratory of the
# Research Center for Calibration, Instrumentation and Metrology,
# Indonesia, (2006-09-29).
-# The abbreviations are:
+# The time zone abbreviations and UT offsets are:
#
-# WIB - UTC+7 - Waktu Indonesia Barat (Indonesia western time)
-# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time)
-# WIT - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time)
+# WIB - +07 - Waktu Indonesia Barat (Indonesia western time)
+# WITA - +08 - Waktu Indonesia Tengah (Indonesia central time)
+# WIT - +09 - Waktu Indonesia Timur (Indonesia eastern time)
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
# Java, Sumatra
@@ -1825,11 +1821,11 @@ Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 S
Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
- 5:00 - FRUT 1930 Jun 21 # Frunze Time
- 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s
- 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence
- 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time
- 6:00 - KGT
+ 5:00 - +05 1930 Jun 21
+ 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
+ 5:00 RussiaAsia +05/+06 1991 Aug 31 2:00
+ 5:00 Kyrgyz +05/+06 2005 Aug 12
+ 6:00 - +06
###############################################################################
@@ -1868,25 +1864,24 @@ Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
-# From Paul Eggert (2014-10-30):
+# From Paul Eggert (2016-08-23):
# The Korean Wikipedia entry gives the following sources for UT offsets:
#
-# 1908: Official Journal Article No. 3994 (Edict No. 5)
+# 1908: Official Journal Article No. 3994 (decree No. 5)
# 1912: Governor-General of Korea Official Gazette Issue No. 367
# (Announcement No. 338)
# 1954: Presidential Decree No. 876 (1954-03-17)
# 1961: Law No. 676 (1961-08-07)
-# 1987: Law No. 3919 (1986-12-31)
#
-# The Wikipedia entry also has confusing information about a change
-# to UT+9 in April 1910, but then what would be the point of the later change
-# to UT+9 on 1912-01-01? Omit the 1910 change for now.
+# (Another source "1987: Law No. 3919 (1986-12-31)" was in the 2014-10-30
+# edition of the Korean Wikipedia entry.)
#
# I guessed that time zone abbreviations through 1945 followed the same
# rules as discussed under Taiwan, with nominal switches from JST to KST
# when the respective cities were taken over by the Allies after WWII.
#
-# For Pyongyang we have no information; guess no changes since World War II.
+# For Pyongyang, guess no changes from World War II until 2015, as we
+# have no information otherwise.
# From Steffen Thorsen (2015-08-07):
# According to many news sources, North Korea is going to change to
@@ -2046,7 +2041,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Male
# Bill Bonnet (2005-05-19) reports that the US Embassy in Ulaanbaatar says
# there is only one time zone and that DST is observed, citing Microsoft
# Windows XP as the source. Risto Nykänen (2005-05-16) reports that
-# travelmongolia.org says there are two time zones (UTC+7, UTC+8) with no DST.
+# travelmongolia.org says there are two time zones (UT +07, +08) with no DST.
# Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in
# Washington, DC says there are two time zones, with DST observed.
# He also found
@@ -2682,7 +2677,7 @@ Link Asia/Qatar Asia/Bahrain
# earlier date.
#
# Shanks & Pottenger also state that until 1968-05-01 Saudi Arabia had two
-# time zones; the other zone, at UTC+4, was in the far eastern part of
+# time zones; the other zone, at UT +04, was in the far eastern part of
# the country. Ignore this, as it's before our 1970 cutoff.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -2951,10 +2946,10 @@ Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq
# From Shanks & Pottenger.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
- 5:00 - DUST 1930 Jun 21 # Dushanbe Time
- 6:00 RussiaAsia DUS%sT 1991 Mar 31 2:00s
- 5:00 1:00 DUSST 1991 Sep 9 2:00s
- 5:00 - TJT # Tajikistan Time
+ 5:00 - +05 1930 Jun 21
+ 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
+ 5:00 1:00 +05/+06 1991 Sep 9 2:00s
+ 5:00 - +05
# Thailand
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -2968,11 +2963,10 @@ Link Asia/Bangkok Asia/Vientiane # Laos
# From Shanks & Pottenger.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
- 4:00 - ASHT 1930 Jun 21 # Ashkhabad Time
- 5:00 RussiaAsia ASH%sT 1991 Mar 31 2:00
- 4:00 RussiaAsia ASH%sT 1991 Oct 27 # independence
- 4:00 RussiaAsia TM%sT 1992 Jan 19 2:00
- 5:00 - TMT
+ 4:00 - +04 1930 Jun 21
+ 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00
+ 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00
+ 5:00 - +05
# United Arab Emirates
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -2984,20 +2978,18 @@ Link Asia/Dubai Asia/Muscat # Oman
# Byalokoz 1919 says Uzbekistan was 4:27:53.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Samarkand 4:27:53 - LMT 1924 May 2
- 4:00 - SAMT 1930 Jun 21 # Samarkand Time
- 5:00 - SAMT 1981 Apr 1
- 5:00 1:00 SAMST 1981 Oct 1
- 6:00 - TAST 1982 Apr 1 # Tashkent Time
- 5:00 RussiaAsia SAM%sT 1991 Sep 1 # independence
- 5:00 RussiaAsia UZ%sT 1992
- 5:00 - UZT
+ 4:00 - +04 1930 Jun 21
+ 5:00 - +05 1981 Apr 1
+ 5:00 1:00 +06 1981 Oct 1
+ 6:00 - +06 1982 Apr 1
+ 5:00 RussiaAsia +05/+06 1992
+ 5:00 - +05
# Milne says Tashkent was 4:37:10.8; round to nearest.
Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
- 5:00 - TAST 1930 Jun 21 # Tashkent Time
- 6:00 RussiaAsia TAS%sT 1991 Mar 31 2:00
- 5:00 RussiaAsia TAS%sT 1991 Sep 1 # independence
- 5:00 RussiaAsia UZ%sT 1992
- 5:00 - UZT
+ 5:00 - +05 1930 Jun 21
+ 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00
+ 5:00 RussiaAsia +05/+06 1992
+ 5:00 - +05
# Vietnam
diff --git a/australasia b/australasia
index 0b33f67..f49df1d 100644
--- a/australasia
+++ b/australasia
@@ -545,7 +545,7 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
# the most people even though it was devastated in the Bougainville Civil War.
#
-# Although Shanks gives 1942-03-15 / 1943-11-01 for JST, these dates
+# Although Shanks gives 1942-03-15 / 1943-11-01 for UT +09, these dates
# are apparently rough guesswork from the starts of military campaigns.
# The World War II entries below are instead based on Arawa-Kieta.
# The Japanese occupied Kieta in July 1942,
@@ -553,8 +553,8 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
# and seem to have controlled it until their 1945-08-21 surrender.
#
-# The Autonomous Region of Bougainville plans to switch from UTC+10 to UTC+11
-# on 2014-12-28 at 02:00. They call UTC+11 "Bougainville Standard Time";
+# The Autonomous Region of Bougainville switched from UT +10 to +11
+# on 2014-12-28 at 02:00. They call +11 "Bougainville Standard Time";
# abbreviate this as BST. See:
# http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
#
@@ -620,7 +620,7 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
# From Paul Eggert (2014-06-27):
# The International Date Line Act 2011
# http://www.parliament.gov.ws/images/ACTS/International_Date_Line_Act__2011_-_Eng.pdf
-# changed Samoa from UTC-11 to UTC+13, effective "12 o'clock midnight, on
+# changed Samoa from UT -11 to +13, effective "12 o'clock midnight, on
# Thursday 29th December 2011". The International Date Line was adjusted
# accordingly.
@@ -715,7 +715,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
# 1886-1891; Baker was similar but exact dates are not known.
# Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
# uninhabited thereafter.
-# Howland observed Hawaii Standard Time (UT-10:30) in 1937;
+# Howland observed Hawaii Standard Time (UT -10:30) in 1937;
# see page 206 of Elgen M. Long and Marie K. Long,
# Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
# So most likely Howland and Baker observed Hawaii Time from 1935
@@ -1473,7 +1473,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Zealand time. I understand that is the time they keep locally, anyhow."
# For now, assume this practice goes back to the introduction of standard time
# in New Zealand, as this would make Chatham Islands time almost exactly match
-# LMT back when New Zealand was at UTC+11:30; also, assume Chatham Islands did
+# LMT back when New Zealand was at UT +11:30; also, assume Chatham Islands did
# not observe New Zealand's prewar DST.
###############################################################################
@@ -1529,7 +1529,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# For now, we assume the Ladrones switched at the same time as the Philippines;
# see Asia/Manila.
-# US Public Law 106-564 (2000-12-23) made UTC+10 the official standard time,
+# US Public Law 106-564 (2000-12-23) made UT +10 the official standard time,
# under the name "Chamorro Standard Time". There is no official abbreviation,
# but Congressman Robert A. Underwood, author of the bill that became law,
# wrote in a press release (2000-12-27) that he will seek the use of "ChST".
@@ -1541,15 +1541,15 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# "I am certain, having lived there for the past decade, that 'Truk'
# (now properly known as Chuuk) ... is in the time zone GMT+10."
#
-# Shanks & Pottenger write that Truk switched from UTC+10 to UTC+11
+# Shanks & Pottenger write that Truk switched from UT +10 to +11
# on 1978-10-01; ignore this for now.
# From Paul Eggert (1999-10-29):
# The Federated States of Micronesia Visitors Board writes in
# The Federated States of Micronesia - Visitor Information (1999-01-26)
# http://www.fsmgov.org/info/clocks.html
-# that Truk and Yap are UTC+10, and Ponape and Kosrae are UTC+11.
-# We don't know when Kosrae switched from UTC+12; assume January 1 for now.
+# that Truk and Yap are UT +10, and Ponape and Kosrae are +11.
+# We don't know when Kosrae switched from +12; assume January 1 for now.
# Midway
@@ -1615,11 +1615,11 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# ordaining - by a masterpiece of diplomatic flattery - that
# the Fourth of July should be celebrated twice in that year."
-# Although Shanks & Pottenger says they both switched to UTC-11:30
-# in 1911, and to UTC-11 in 1950. many earlier sources give UTC-11
+# Although Shanks & Pottenger says they both switched to UT -11:30
+# in 1911, and to -11 in 1950. many earlier sources give -11
# for American Samoa, e.g., the US National Bureau of Standards
# circular "Standard Time Throughout the World", 1932.
-# Assume American Samoa switched to UTC-11 in 1911, not 1950,
+# Assume American Samoa switched to -11 in 1911, not 1950,
# and that after 1950 they agreed until (western) Samoa skipped a
# day in 2011. Assume also that the Samoas follow the US and New
# Zealand's "ST"/"DT" style of daylight-saving abbreviations.
diff --git a/backward b/backward
index aab237a..aa23dd8 100644
--- a/backward
+++ b/backward
@@ -36,6 +36,7 @@ Link Asia/Shanghai Asia/Harbin
Link Asia/Urumqi Asia/Kashgar
Link Asia/Kathmandu Asia/Katmandu
Link Asia/Macau Asia/Macao
+Link Asia/Yangon Asia/Rangoon
Link Asia/Ho_Chi_Minh Asia/Saigon
Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Thimphu Asia/Thimbu
diff --git a/backzone b/backzone
index 13dc8d4..4a5085f 100644
--- a/backzone
+++ b/backzone
@@ -194,9 +194,9 @@ Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar
# Equatorial Guinea
#
-# Although Shanks says that Malabo switched from UTC to UTC+1 on 1963-12-15,
+# Although Shanks says that Malabo switched from UT +00 to +01 on 1963-12-15,
# a Google Books search says that London Calling, Issues 432-465 (1948), p 19,
-# says that Spanish Guinea was at GMT+1 back then. The Shanks data entries
+# says that Spanish Guinea was at +01 back then. The Shanks data entries
# are most likely wrong, but we have nothing better; use them here for now.
#
Zone Africa/Malabo 0:35:08 - LMT 1912
@@ -479,14 +479,14 @@ Zone Asia/Muscat 3:54:24 - LMT 1920
# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
# According to a Portuguese decree (1911-05-26)
# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
-# Portuguese India switched to GMT+5 on 1912-01-01.
+# Portuguese India switched to UT +05 on 1912-01-01.
#Zone Asia/Panaji [not enough info to complete]
# Cambodia
# From Paul Eggert (2014-10-11):
# See Asia/Ho_Chi_Minh for the source for most of this data. Also, guess
-# (1) Cambodia reverted to UT+7 on 1945-09-02, when Vietnam did, and
-# (2) they also reverted to UT+7 on 1953-11-09, the date of independence.
+# (1) Cambodia reverted to UT +07 on 1945-09-02, when Vietnam did, and
+# (2) they also reverted to +07 on 1953-11-09, the date of independence.
# These guesses are probably wrong but they're better than guessing no
# transitions there.
Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jul 1
@@ -506,8 +506,8 @@ Zone Asia/Tel_Aviv 2:19:04 - LMT 1880
# Laos
# From Paul Eggert (2014-10-11):
# See Asia/Ho_Chi_Minh for the source for most of this data.
-# Trần's book says that Laos reverted to UT+7 on 1955-04-15.
-# Also, guess that Laos reverted to UT+7 on 1945-09-02, when Vietnam did;
+# Trần's book says that Laos reverted to UT +07 on 1955-04-15.
+# Also, guess that Laos reverted to +07 on 1945-09-02, when Vietnam did;
# this is probably wrong but it's better than guessing no transition.
Zone Asia/Vientiane 6:50:24 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1
diff --git a/date.c b/date.c
index 4c11f61..512d1ef 100644
--- a/date.c
+++ b/date.c
@@ -42,8 +42,9 @@
#define SECSPERMIN 60
#endif /* !defined SECSPERMIN */
-#if !HAVE_POSIX_DECLS
extern char ** environ;
+
+#if !HAVE_POSIX_DECLS
extern char * optarg;
extern int optind;
extern char * tzname[];
diff --git a/etcetera b/etcetera
index c2e2532..f5fa4c9 100644
--- a/etcetera
+++ b/etcetera
@@ -8,6 +8,13 @@
# need now for the entries that are not on UTC are for ships at sea
# that cannot use POSIX TZ settings.
+# Starting with POSIX 1003.1-2001, the entries below are all
+# unnecessary as settings for the TZ environment variable. E.g.,
+# instead of TZ='Etc/GMT+4' one can use the POSIX setting TZ='<-04>+4'.
+#
+# Do not use a POSIX TZ setting like TZ='GMT+4', which is four hours
+# behind GMT but uses the completely misleading abbreviation "GMT".
+
Zone Etc/GMT 0 - GMT
Zone Etc/UTC 0 - UTC
Zone Etc/UCT 0 - UCT
@@ -26,23 +33,13 @@ Link Etc/GMT Etc/GMT-0
Link Etc/GMT Etc/GMT+0
Link Etc/GMT Etc/GMT0
-# We use POSIX-style signs in the Zone names and the output abbreviations,
+# Be consistent with POSIX TZ settings in the Zone names,
# even though this is the opposite of what many people expect.
# POSIX has positive signs west of Greenwich, but many people expect
# positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses
-# the abbreviation "GMT+4" and corresponds to 4 hours behind UT
+# the abbreviation "-04" and corresponds to 4 hours behind UT
# (i.e. west of Greenwich) even though many people would expect it to
# mean 4 hours ahead of UT (i.e. east of Greenwich).
-#
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
-# TZ='+4'; if you want time zone abbreviations conforming to
-# ISO 8601 you can use TZ='<-0400>+4'. Thus the commonly-expected
-# offset is kept within the angle bracket (and is used for display)
-# while the POSIX sign is kept outside the angle bracket (and is used
-# for calculation).
-#
-# Do not use a TZ setting like TZ='GMT+4', which is four hours behind
-# GMT but uses the completely misleading abbreviation "GMT".
# Earlier incarnations of this package were not POSIX-compliant,
# and had lines such as
@@ -51,30 +48,31 @@ Link Etc/GMT Etc/GMT0
# way does a
# zic -l GMT-12
# so we moved the names into the Etc subdirectory.
+# Also, the time zone abbreviations are now compatible with %z.
-Zone Etc/GMT-14 14 - GMT-14 # 14 hours ahead of GMT
-Zone Etc/GMT-13 13 - GMT-13
-Zone Etc/GMT-12 12 - GMT-12
-Zone Etc/GMT-11 11 - GMT-11
-Zone Etc/GMT-10 10 - GMT-10
-Zone Etc/GMT-9 9 - GMT-9
-Zone Etc/GMT-8 8 - GMT-8
-Zone Etc/GMT-7 7 - GMT-7
-Zone Etc/GMT-6 6 - GMT-6
-Zone Etc/GMT-5 5 - GMT-5
-Zone Etc/GMT-4 4 - GMT-4
-Zone Etc/GMT-3 3 - GMT-3
-Zone Etc/GMT-2 2 - GMT-2
-Zone Etc/GMT-1 1 - GMT-1
-Zone Etc/GMT+1 -1 - GMT+1
-Zone Etc/GMT+2 -2 - GMT+2
-Zone Etc/GMT+3 -3 - GMT+3
-Zone Etc/GMT+4 -4 - GMT+4
-Zone Etc/GMT+5 -5 - GMT+5
-Zone Etc/GMT+6 -6 - GMT+6
-Zone Etc/GMT+7 -7 - GMT+7
-Zone Etc/GMT+8 -8 - GMT+8
-Zone Etc/GMT+9 -9 - GMT+9
-Zone Etc/GMT+10 -10 - GMT+10
-Zone Etc/GMT+11 -11 - GMT+11
-Zone Etc/GMT+12 -12 - GMT+12
+Zone Etc/GMT-14 14 - +14
+Zone Etc/GMT-13 13 - +13
+Zone Etc/GMT-12 12 - +12
+Zone Etc/GMT-11 11 - +11
+Zone Etc/GMT-10 10 - +10
+Zone Etc/GMT-9 9 - +09
+Zone Etc/GMT-8 8 - +08
+Zone Etc/GMT-7 7 - +07
+Zone Etc/GMT-6 6 - +06
+Zone Etc/GMT-5 5 - +05
+Zone Etc/GMT-4 4 - +04
+Zone Etc/GMT-3 3 - +03
+Zone Etc/GMT-2 2 - +02
+Zone Etc/GMT-1 1 - +01
+Zone Etc/GMT+1 -1 - -01
+Zone Etc/GMT+2 -2 - -02
+Zone Etc/GMT+3 -3 - -03
+Zone Etc/GMT+4 -4 - -04
+Zone Etc/GMT+5 -5 - -05
+Zone Etc/GMT+6 -6 - -06
+Zone Etc/GMT+7 -7 - -07
+Zone Etc/GMT+8 -8 - -08
+Zone Etc/GMT+9 -9 - -09
+Zone Etc/GMT+10 -10 - -10
+Zone Etc/GMT+11 -11 - -11
+Zone Etc/GMT+12 -12 - -12
diff --git a/europe b/europe
index cd3a088..6020059 100644
--- a/europe
+++ b/europe
@@ -75,8 +75,7 @@
# 1:00 CET CEST CEMT Central Europe
# 1:00:14 SET Swedish (1879-1899)*
# 2:00 EET EEST Eastern Europe
-# 3:00 FET Further-eastern Europe (2011-2014)*
-# 3:00 MSK MSD MSM* Minsk, Moscow
+# 3:00 MSK MSD Moscow
# From Peter Ilieve (1994-12-04),
# The original six [EU members]: Belgium, France, (West) Germany, Italy,
@@ -583,16 +582,33 @@ Rule E-Eur 1979 1995 - Sep lastSun 0:00 0 -
Rule E-Eur 1981 max - Mar lastSun 0:00 1:00 S
Rule E-Eur 1996 max - Oct lastSun 0:00 0 -
+
+# Daylight saving time for Russia and the Soviet Union
+#
+# The 1917-1921 decree URLs are from Alexander Belopolsky (2016-08-23).
+
# Rule NAME FROM TO TYPE 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
Rule Russia 1917 only - Dec 28 0:00 0 MMT # Moscow Mean Time
+#
+# Decree No. 497 (1918-05-30) http://istmat.info/node/30001
Rule Russia 1918 only - May 31 22:00 2:00 MDST # Moscow Double Summer Time
Rule Russia 1918 only - Sep 16 1:00 1:00 MST
+#
+# Decree No. 258 (1919-05-29) http://istmat.info/node/37949
Rule Russia 1919 only - May 31 23:00 2:00 MDST
-Rule Russia 1919 only - Jul 1 2:00 1:00 MSD
+#
+Rule Russia 1919 only - Jul 1 0:00u 1:00 MSD
Rule Russia 1919 only - Aug 16 0:00 0 MSK
+#
+# Decree No. 63 (1921-02-03) http://istmat.info/node/45840
Rule Russia 1921 only - Feb 14 23:00 1:00 MSD
-Rule Russia 1921 only - Mar 20 23:00 2:00 MSM # Midsummer
+#
+# Decree No. 121 (1921-03-07) http://istmat.info/node/45949
+Rule Russia 1921 only - Mar 20 23:00 2:00 +05
+#
Rule Russia 1921 only - Sep 1 0:00 1:00 MSD
Rule Russia 1921 only - Oct 1 0:00 0 -
# Act No. 925 of the Council of Ministers of the USSR (1980-10-24):
@@ -775,8 +791,6 @@ Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
# From Alexander Bokovoy (2014-10-09):
# Belarussian government decided against changing to winter time....
# http://eng.belta.by/all_news/society/Belarus-decides-against-adjusting-time-in-Russias-wake_i_76335.html
-# From Paul Eggert (2014-10-08):
-# Hence Belarus can share time zone abbreviations with Moscow again.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Minsk 1:50:16 - LMT 1880
@@ -787,8 +801,7 @@ Zone Europe/Minsk 1:50:16 - LMT 1880
3:00 Russia MSK/MSD 1990
3:00 - MSK 1991 Mar 31 2:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
- 3:00 - FET 2014 Oct 26 1:00s
- 3:00 - MSK
+ 3:00 - +03
# Belgium
#
@@ -1296,7 +1309,7 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
# http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf
# says that Bersarin issued an order to use Moscow time on May 20.
# However, Moscow did not observe daylight saving in 1945, so
-# this was equivalent to CEMT (GMT+3), not GMT+4.
+# this was equivalent to UT +03, not +04.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -2260,7 +2273,6 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
# From Paul Eggert (2006-03-22):
-# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
# are from Andrey A. Chernov. The rest is from Shanks & Pottenger,
# except we follow Chernov's report that 1992 DST transitions were Sat
@@ -2336,7 +2348,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
2:00 Poland CE%sT 1946
3:00 Russia MSK/MSD 1989 Mar 26 2:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
- 3:00 - FET 2014 Oct 26 2:00s
+ 3:00 - +03 2014 Oct 26 2:00s
2:00 - EET
@@ -2389,6 +2401,16 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
# 78 RU-SPE Saint Petersburg
# 83 RU-NEN Nenets Autonomous Okrug
+# From Paul Eggert (2016-08-23):
+# The Soviets switched to UT-based time in 1919. Decree No. 59
+# (1919-02-08) http://istmat.info/node/35567 established UT-based time
+# zones, and Decree No. 147 (1919-03-29) http://istmat.info/node/35854
+# specified a transition date of 1919-07-01, apparently at 00:00 UT.
+# No doubt only the Soviet-controlled regions switched on that date;
+# later transitions to UT-based time in other parts of Russia are
+# taken from what appear to be guesses by Shanks.
+# (Thanks to Alexander Belopolsky for pointers to the decrees.)
+
# From Stepan Golosunov (2016-03-07):
# 11. Regions-violators, 1981-1982.
# Wikipedia refers to
@@ -2430,7 +2452,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
# attributes the 1982 changes to the Act of the Council of Ministers
# of the USSR No. 126 from 18.02.1982. 1980-925.txt also adds
# Udmurtia to the list of affected territories and lists Khatangsky
-# district separately from Taymyr Autonomous Okurg. Probably erroneously.
+# district separately from Taymyr Autonomous Okrug. Probably erroneously.
#
# The affected territories are currently listed under Europe/Moscow,
# Asia/Yekaterinburg and Asia/Krasnoyarsk.
@@ -2490,7 +2512,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
Zone Europe/Moscow 2:30:17 - LMT 1880
2:30:17 - MMT 1916 Jul 3 # Moscow Mean Time
- 2:31:19 Russia %s 1919 Jul 1 2:00
+ 2:31:19 Russia %s 1919 Jul 1 0:00u
3:00 Russia %s 1921 Oct
3:00 Russia MSK/MSD 1922 Oct
2:00 - EET 1930 Jun 21
@@ -2573,22 +2595,21 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May
# The 1988 transition is from USSR act No. 5 (1988-01-04).
Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
- 3:00 - TSAT 1925 Apr 6 # Tsaritsyn Time
- 3:00 - STAT 1930 Jun 21 # Stalingrad Time
- 4:00 - STAT 1961 Nov 11
- 4:00 Russia VOL%sT 1988 Mar 27 2:00s # Volgograd T
- 3:00 Russia VOL%sT 1991 Mar 31 2:00s
- 4:00 - VOLT 1992 Mar 29 2:00s
- 3:00 Russia MSK/MSD 2011 Mar 27 2:00s
- 4:00 - MSK 2014 Oct 26 2:00s
- 3:00 - MSK
+ 3:00 - +03 1930 Jun 21
+ 4:00 - +04 1961 Nov 11
+ 4:00 Russia +04/+05 1988 Mar 27 2:00s
+ 3:00 Russia +03/+04 1991 Mar 31 2:00s
+ 4:00 - +04 1992 Mar 29 2:00s
+ 3:00 Russia +03/+04 2011 Mar 27 2:00s
+ 4:00 - +04 2014 Oct 26 2:00s
+ 3:00 - +03
# From Paul Eggert (2016-03-18):
# Europe/Kirov covers:
# 43 RU-KIR Kirov Oblast
# The 1989 transition is from USSR act No. 227 (1989-03-14).
#
-Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 2:00
+Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 0:00u
3:00 - +03 1930 Jun 21
4:00 Russia +04/+05 1989 Mar 26 2:00s
3:00 Russia +03/+04 1991 Mar 31 2:00s
@@ -2606,16 +2627,16 @@ Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 2:00
# Byalokoz 1919 says Samara was 3:20:20.
# The 1989 transition is from USSR act No. 227 (1989-03-14).
-Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 2:00
- 3:00 - SAMT 1930 Jun 21 # Samara Time
- 4:00 - SAMT 1935 Jan 27
- 4:00 Russia KUY%sT 1989 Mar 26 2:00s # Kuybyshev
- 3:00 Russia MSK/MSD 1991 Mar 31 2:00s
- 2:00 Russia EE%sT 1991 Sep 29 2:00s
- 3:00 - SAMT 1991 Oct 20 3:00
- 4:00 Russia SAM%sT 2010 Mar 28 2:00s
- 3:00 Russia SAM%sT 2011 Mar 27 2:00s
- 4:00 - SAMT
+Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 0:00u
+ 3:00 - +03 1930 Jun 21
+ 4:00 - +04 1935 Jan 27
+ 4:00 Russia +04/+05 1989 Mar 26 2:00s
+ 3:00 Russia +03/+04 1991 Mar 31 2:00s
+ 2:00 Russia +02/+03 1991 Sep 29 2:00s
+ 3:00 - +03 1991 Oct 20 3:00
+ 4:00 Russia +04/+05 2010 Mar 28 2:00s
+ 3:00 Russia +03/+04 2011 Mar 27 2:00s
+ 4:00 - +04
# From Paul Eggert (2016-03-18):
# Europe/Ulyanovsk covers:
@@ -2630,7 +2651,7 @@ Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 2:00
# From Matt Johnson (2016-03-09):
# http://publication.pravo.gov.ru/Document/View/0001201603090051
-Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 2:00
+Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 0:00u
3:00 - +03 1930 Jun 21
4:00 Russia +04/+05 1989 Mar 26 2:00s
3:00 Russia +03/+04 1991 Mar 31 2:00s
@@ -2662,12 +2683,12 @@ Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 2:00
Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
3:45:05 - PMT 1919 Jul 15 4:00
- 4:00 - SVET 1930 Jun 21 # Sverdlovsk Time
- 5:00 Russia SVE%sT 1991 Mar 31 2:00s
- 4:00 Russia SVE%sT 1992 Jan 19 2:00s
- 5:00 Russia YEK%sT 2011 Mar 27 2:00s
- 6:00 - YEKT 2014 Oct 26 2:00s
- 5:00 - YEKT
+ 4:00 - +04 1930 Jun 21
+ 5:00 Russia +05/+06 1991 Mar 31 2:00s
+ 4:00 Russia +04/+05 1992 Jan 19 2:00s
+ 5:00 Russia +05/+06 2011 Mar 27 2:00s
+ 6:00 - +06 2014 Oct 26 2:00s
+ 5:00 - +05
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -2677,12 +2698,12 @@ Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
# Byalokoz 1919 says Omsk was 4:53:30.
Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14
- 5:00 - OMST 1930 Jun 21 # Omsk Time
- 6:00 Russia OMS%sT 1991 Mar 31 2:00s
- 5:00 Russia OMS%sT 1992 Jan 19 2:00s
- 6:00 Russia OMS%sT 2011 Mar 27 2:00s
- 7:00 - OMST 2014 Oct 26 2:00s
- 6:00 - OMST
+ 5:00 - +05 1930 Jun 21
+ 6:00 Russia +06/+07 1991 Mar 31 2:00s
+ 5:00 Russia +05/+06 1992 Jan 19 2:00s
+ 6:00 Russia +06/+07 2011 Mar 27 2:00s
+ 7:00 - +07 2014 Oct 26 2:00s
+ 6:00 - +06
# From Paul Eggert (2016-02-22):
# Asia/Barnaul covers:
@@ -2762,7 +2783,7 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
# Note that time belts (numbered from 2 (Moscow) to 12 according to their
# GMT/UTC offset and having too many exceptions like regions formally
# belonging to one belt but using time from another) were replaced
-# with time zones in 2011 with different numberings (there was a
+# with time zones in 2011 with different numbering (there was a
# 2-hour gap between second and third zones in 2011-2014).
# From Stepan Golosunov (2016-04-12):
@@ -2845,12 +2866,12 @@ Zone Asia/Novokuznetsk 5:48:48 - LMT 1924 May 1
# Byalokoz 1919 says Krasnoyarsk was 6:11:26.
Zone Asia/Krasnoyarsk 6:11:26 - LMT 1920 Jan 6
- 6:00 - KRAT 1930 Jun 21 # Krasnoyarsk Time
- 7:00 Russia KRA%sT 1991 Mar 31 2:00s
- 6:00 Russia KRA%sT 1992 Jan 19 2:00s
- 7:00 Russia KRA%sT 2011 Mar 27 2:00s
- 8:00 - KRAT 2014 Oct 26 2:00s
- 7:00 - KRAT
+ 6:00 - +06 1930 Jun 21
+ 7:00 Russia +07/+08 1991 Mar 31 2:00s
+ 6:00 Russia +06/+07 1992 Jan 19 2:00s
+ 7:00 Russia +07/+08 2011 Mar 27 2:00s
+ 8:00 - +08 2014 Oct 26 2:00s
+ 7:00 - +07
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -2867,12 +2888,12 @@ Zone Asia/Krasnoyarsk 6:11:26 - LMT 1920 Jan 6
Zone Asia/Irkutsk 6:57:05 - LMT 1880
6:57:05 - IMT 1920 Jan 25 # Irkutsk Mean Time
- 7:00 - IRKT 1930 Jun 21 # Irkutsk Time
- 8:00 Russia IRK%sT 1991 Mar 31 2:00s
- 7:00 Russia IRK%sT 1992 Jan 19 2:00s
- 8:00 Russia IRK%sT 2011 Mar 27 2:00s
- 9:00 - IRKT 2014 Oct 26 2:00s
- 8:00 - IRKT
+ 7:00 - +07 1930 Jun 21
+ 8:00 Russia +08/+09 1991 Mar 31 2:00s
+ 7:00 Russia +07/+08 1992 Jan 19 2:00s
+ 8:00 Russia +08/+09 2011 Mar 27 2:00s
+ 9:00 - +09 2014 Oct 26 2:00s
+ 8:00 - +08
# From Tim Parenti (2014-07-06):
@@ -2889,13 +2910,13 @@ Zone Asia/Irkutsk 6:57:05 - LMT 1880
# http://publication.pravo.gov.ru/Document/View/0001201512300107
Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15
- 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
- 9:00 Russia YAK%sT 1991 Mar 31 2:00s
- 8:00 Russia YAK%sT 1992 Jan 19 2:00s
- 9:00 Russia YAK%sT 2011 Mar 27 2:00s
- 10:00 - YAKT 2014 Oct 26 2:00s
- 8:00 - IRKT 2016 Mar 27 2:00
- 9:00 - YAKT
+ 8:00 - +08 1930 Jun 21
+ 9:00 Russia +09/+10 1991 Mar 31 2:00s
+ 8:00 Russia +08/+09 1992 Jan 19 2:00s
+ 9:00 Russia +09/+10 2011 Mar 27 2:00s
+ 10:00 - +10 2014 Oct 26 2:00s
+ 8:00 - +08 2016 Mar 27 2:00
+ 9:00 - +09
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -2935,12 +2956,12 @@ Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15
# Byalokoz 1919 says Yakutsk was 8:38:58.
Zone Asia/Yakutsk 8:38:58 - LMT 1919 Dec 15
- 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
- 9:00 Russia YAK%sT 1991 Mar 31 2:00s
- 8:00 Russia YAK%sT 1992 Jan 19 2:00s
- 9:00 Russia YAK%sT 2011 Mar 27 2:00s
- 10:00 - YAKT 2014 Oct 26 2:00s
- 9:00 - YAKT
+ 8:00 - +08 1930 Jun 21
+ 9:00 Russia +09/+10 1991 Mar 31 2:00s
+ 8:00 Russia +08/+09 1992 Jan 19 2:00s
+ 9:00 Russia +09/+10 2011 Mar 27 2:00s
+ 10:00 - +10 2014 Oct 26 2:00s
+ 9:00 - +09
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -2958,12 +2979,12 @@ Zone Asia/Yakutsk 8:38:58 - LMT 1919 Dec 15
# Go with Byalokoz.
Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15
- 9:00 - VLAT 1930 Jun 21 # Vladivostok Time
- 10:00 Russia VLA%sT 1991 Mar 31 2:00s
- 9:00 Russia VLA%sT 1992 Jan 19 2:00s
- 10:00 Russia VLA%sT 2011 Mar 27 2:00s
- 11:00 - VLAT 2014 Oct 26 2:00s
- 10:00 - VLAT
+ 9:00 - +09 1930 Jun 21
+ 10:00 Russia +10/+11 1991 Mar 31 2:00s
+ 9:00 Russia +09/+10 1992 Jan 19 2:00s
+ 10:00 Russia +10/+11 2011 Mar 27 2:00s
+ 11:00 - +11 2014 Oct 26 2:00s
+ 10:00 - +10
# From Tim Parenti (2014-07-03):
@@ -2981,14 +3002,14 @@ Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15
# This transition is no doubt wrong, but we have no better info.
Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
- 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
- 9:00 Russia YAK%sT 1991 Mar 31 2:00s
- 8:00 Russia YAK%sT 1992 Jan 19 2:00s
- 9:00 Russia YAK%sT 2004
- 10:00 Russia VLA%sT 2011 Mar 27 2:00s
- 11:00 - VLAT 2011 Sep 13 0:00s # Decree 725?
- 10:00 - YAKT 2014 Oct 26 2:00s
- 9:00 - YAKT
+ 8:00 - +08 1930 Jun 21
+ 9:00 Russia +09/+10 1991 Mar 31 2:00s
+ 8:00 Russia +08/+09 1992 Jan 19 2:00s
+ 9:00 Russia +09/+10 2004
+ 10:00 Russia +10/+11 2011 Mar 27 2:00s
+ 11:00 - +11 2011 Sep 13 0:00s # Decree 725?
+ 10:00 - +10 2014 Oct 26 2:00s
+ 9:00 - +09
# From Tim Parenti (2014-07-03):
@@ -3004,15 +3025,14 @@ Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
# The Zone name should be Asia/Yuzhno-Sakhalinsk, but that's too long.
Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
- 9:00 - JCST 1937 Oct 1
- 9:00 - JST 1945 Aug 25
- 11:00 Russia SAK%sT 1991 Mar 31 2:00s # Sakhalin T
- 10:00 Russia SAK%sT 1992 Jan 19 2:00s
- 11:00 Russia SAK%sT 1997 Mar lastSun 2:00s
- 10:00 Russia SAK%sT 2011 Mar 27 2:00s
- 11:00 - SAKT 2014 Oct 26 2:00s
- 10:00 - SAKT 2016 Mar 27 2:00s
- 11:00 - SAKT
+ 9:00 - +09 1945 Aug 25
+ 11:00 Russia +11/+12 1991 Mar 31 2:00s # Sakhalin T
+ 10:00 Russia +10/+11 1992 Jan 19 2:00s
+ 11:00 Russia +11/+12 1997 Mar lastSun 2:00s
+ 10:00 Russia +10/+11 2011 Mar 27 2:00s
+ 11:00 - +11 2014 Oct 26 2:00s
+ 10:00 - +10 2016 Mar 27 2:00s
+ 11:00 - +11
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -3035,13 +3055,13 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# http://publication.pravo.gov.ru/Document/View/0001201604050038
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
- 10:00 - MAGT 1930 Jun 21 # Magadan Time
- 11:00 Russia MAG%sT 1991 Mar 31 2:00s
- 10:00 Russia MAG%sT 1992 Jan 19 2:00s
- 11:00 Russia MAG%sT 2011 Mar 27 2:00s
- 12:00 - MAGT 2014 Oct 26 2:00s
- 10:00 - MAGT 2016 Apr 24 2:00s
- 11:00 - MAGT
+ 10:00 - +10 1930 Jun 21 # Magadan Time
+ 11:00 Russia +11/+12 1991 Mar 31 2:00s
+ 10:00 Russia +10/+11 1992 Jan 19 2:00s
+ 11:00 Russia +11/+12 2011 Mar 27 2:00s
+ 12:00 - +12 2014 Oct 26 2:00s
+ 10:00 - +10 2016 Apr 24 2:00s
+ 11:00 - +11
# From Tim Parenti (2014-07-06):
@@ -3084,17 +3104,14 @@ Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
# in Russian.) In addition, Srednekolymsk appears to be a much older
# settlement and the population of Zyryanka seems to be declining.
# Go with Srednekolymsk.
-#
-# Since Magadan Oblast moves to UTC+10 on 2014-10-26, we cannot keep using MAGT
-# as the abbreviation. Use SRET instead.
Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2
- 10:00 - MAGT 1930 Jun 21 # Magadan Time
- 11:00 Russia MAG%sT 1991 Mar 31 2:00s
- 10:00 Russia MAG%sT 1992 Jan 19 2:00s
- 11:00 Russia MAG%sT 2011 Mar 27 2:00s
- 12:00 - MAGT 2014 Oct 26 2:00s
- 11:00 - SRET # Srednekolymsk Time
+ 10:00 - +10 1930 Jun 21
+ 11:00 Russia +11/+12 1991 Mar 31 2:00s
+ 10:00 Russia +10/+11 1992 Jan 19 2:00s
+ 11:00 Russia +11/+12 2011 Mar 27 2:00s
+ 12:00 - +12 2014 Oct 26 2:00s
+ 11:00 - +11
# From Tim Parenti (2014-07-03):
@@ -3112,14 +3129,14 @@ Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2
# UTC+12 since at least then, too.
Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
- 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
- 9:00 Russia YAKT 1981 Apr 1
- 11:00 Russia MAG%sT 1991 Mar 31 2:00s
- 10:00 Russia MAG%sT 1992 Jan 19 2:00s
- 11:00 Russia MAG%sT 2011 Mar 27 2:00s
- 12:00 - MAGT 2011 Sep 13 0:00s # Decree 725?
- 11:00 - VLAT 2014 Oct 26 2:00s
- 10:00 - VLAT
+ 8:00 - +08 1930 Jun 21
+ 9:00 Russia +09/+10 1981 Apr 1
+ 11:00 Russia +11/+12 1991 Mar 31 2:00s
+ 10:00 Russia +10/+11 1992 Jan 19 2:00s
+ 11:00 Russia +11/+12 2011 Mar 27 2:00s
+ 12:00 - +12 2011 Sep 13 0:00s # Decree 725?
+ 11:00 - +11 2014 Oct 26 2:00s
+ 10:00 - +10
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -3132,12 +3149,12 @@ Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
# The Zone name should be Asia/Petropavlovsk-Kamchatski or perhaps
# Asia/Petropavlovsk-Kamchatsky, but these are too long.
Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10
- 11:00 - PETT 1930 Jun 21 # P-K Time
- 12:00 Russia PET%sT 1991 Mar 31 2:00s
- 11:00 Russia PET%sT 1992 Jan 19 2:00s
- 12:00 Russia PET%sT 2010 Mar 28 2:00s
- 11:00 Russia PET%sT 2011 Mar 27 2:00s
- 12:00 - PETT
+ 11:00 - +11 1930 Jun 21
+ 12:00 Russia +12/+13 1991 Mar 31 2:00s
+ 11:00 Russia +11/+12 1992 Jan 19 2:00s
+ 12:00 Russia +12/+13 2010 Mar 28 2:00s
+ 11:00 Russia +11/+12 2011 Mar 27 2:00s
+ 12:00 - +12
# From Tim Parenti (2014-07-03):
@@ -3145,13 +3162,13 @@ Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10
# 87 RU-CHU Chukotka Autonomous Okrug
Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2
- 12:00 - ANAT 1930 Jun 21 # Anadyr Time
- 13:00 Russia ANA%sT 1982 Apr 1 0:00s
- 12:00 Russia ANA%sT 1991 Mar 31 2:00s
- 11:00 Russia ANA%sT 1992 Jan 19 2:00s
- 12:00 Russia ANA%sT 2010 Mar 28 2:00s
- 11:00 Russia ANA%sT 2011 Mar 27 2:00s
- 12:00 - ANAT
+ 12:00 - +12 1930 Jun 21
+ 13:00 Russia +13/+14 1982 Apr 1 0:00s
+ 12:00 Russia +12/+13 1991 Mar 31 2:00s
+ 11:00 Russia +11/+12 1992 Jan 19 2:00s
+ 12:00 Russia +12/+13 2010 Mar 28 2:00s
+ 11:00 Russia +11/+12 2011 Mar 27 2:00s
+ 12:00 - +12
# San Marino
@@ -3472,6 +3489,14 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
# Engineered Standard Time," said Twitter user @aysekarahasan.
# http://www.bbc.com/news/world-europe-34631326
+# From Burak AYDIN (2016-09-08):
+# Turkey will stay in Daylight Saving Time even in winter....
+# http://www.resmigazete.gov.tr/eskiler/2016/09/20160908-2.pdf
+#
+# From Paul Eggert (2016-09-07):
+# The change is permanent, so this is the new standard time in Turkey.
+# It takes effect today, which is not much notice.
+
# Rule NAME FROM TO TYPE 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 -
@@ -3535,7 +3560,7 @@ Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 -
Zone Europe/Istanbul 1:55:52 - LMT 1880
1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
2:00 Turkey EE%sT 1978 Oct 15
- 3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
+ 3:00 Turkey +03/+04 1985 Apr 20
2:00 Turkey EE%sT 2007
2:00 EU EE%sT 2011 Mar 27 1:00u
2:00 - EET 2011 Mar 28 1:00u
@@ -3543,7 +3568,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
2:00 - EET 2014 Mar 31 1:00u
2:00 EU EE%sT 2015 Oct 25 1:00u
2:00 1:00 EEST 2015 Nov 8 1:00u
- 2:00 EU EE%sT
+ 2:00 EU EE%sT 2016 Sep 7
+ 3:00 - +03
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine
diff --git a/factory b/factory
index 4304f7c..75fa4a1 100644
--- a/factory
+++ b/factory
@@ -1,9 +1,10 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
-# For companies who don't want to put time zone specification in
-# their installation procedures. When users run date, they'll get the message.
-# Also useful for the "comp.sources" version.
+# For distributors who don't want to put time zone specification in
+# their installation procedures. Users that run 'date' will get the
+# time zone abbreviation "-00", indicating that the actual time zone
+# is unknown.
# Zone NAME GMTOFF RULES FORMAT
-Zone Factory 0 - "Local time zone must be set--see zic manual page"
+Zone Factory 0 - -00
diff --git a/leap-seconds.list b/leap-seconds.list
index 7552796..22fa785 100644
--- a/leap-seconds.list
+++ b/leap-seconds.list
@@ -143,7 +143,7 @@
# Boulder, Colorado
# Judah.Levine@nist.gov
#
-# Last Update of leap second values: 5 January 2015
+# Last Update of leap second values: 8 July 2016
#
# The following line shows this last update date in NTP timestamp
# format. This is the date on which the most recent change to
@@ -151,7 +151,7 @@
# be identified by the unique pair of characters in the first two
# columns as shown below.
#
-#$ 3629404800
+#$ 3676924800
#
# The NTP timestamps are in units of seconds since the NTP epoch,
# which is 1 January 1900, 00:00:00. The Modified Julian Day number
@@ -199,10 +199,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
-# Updated through IERS Bulletin C51
-# File expires on: 28 December 2016
+# Updated through IERS Bulletin C52
+# File expires on: 28 June 2017
#
-#@ 3691872000
+#@ 3707596800
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -231,6 +231,7 @@
3439756800 34 # 1 Jan 2009
3550089600 35 # 1 Jul 2012
3644697600 36 # 1 Jul 2015
+3692217600 37 # 1 Jan 2017
#
# the following special comment contains the
# hash value of the data in this file computed
@@ -246,4 +247,4 @@
# the hash line is also ignored in the
# computation.
#
-#h afc03691 8ff53838 42080ba1 cdd22f1 48192c10
+#h dacf2c42 2c4765d6 3c797af8 2cf630eb 699c8c67
diff --git a/leapseconds b/leapseconds
index 73befed..b4411f9 100644
--- a/leapseconds
+++ b/leapseconds
@@ -56,6 +56,7 @@ Leap 2005 Dec 31 23:59:60 + S
Leap 2008 Dec 31 23:59:60 + S
Leap 2012 Jun 30 23:59:60 + S
Leap 2015 Jun 30 23:59:60 + S
+Leap 2016 Dec 31 23:59:60 + S
-# Updated through IERS Bulletin C51
-# File expires on: 28 December 2016
+# Updated through IERS Bulletin C52
+# File expires on: 28 June 2017
diff --git a/localtime.c b/localtime.c
index 276ce34..6c00c45 100644
--- a/localtime.c
+++ b/localtime.c
@@ -1510,7 +1510,7 @@ gmtsub(struct state const *sp, time_t const *timep, int_fast32_t offset,
#ifdef TM_ZONE
/*
** Could get fancy here and deliver something such as
- ** "UT+xxxx" or "UT-xxxx" if offset is non-zero,
+ ** "+xx" or "-xx" if offset is non-zero,
** but this is no time for a treasure hunt.
*/
tmp->TM_ZONE = ((char *)
diff --git a/newtzset.3 b/newtzset.3
index 62277f7..c3e22dc 100644
--- a/newtzset.3
+++ b/newtzset.3
@@ -128,6 +128,13 @@ ASCII minus
ASCII plus
.RB ( + ),
and NUL bytes are allowed.
+Alternatively, a designation can be surrounded by angle brackets
+.B <
+and
+.BR > ;
+in this case, the designation can contain any characters other than
+.B >
+and NUL.
.TP
.I offset
Indicates the value one must add to the local time to arrive at
diff --git a/newtzset.3.txt b/newtzset.3.txt
index 4df0e4a..791bfb7 100644
--- a/newtzset.3.txt
+++ b/newtzset.3.txt
@@ -65,6 +65,10 @@ DESCRIPTION
allowed. Any characters except a leading colon
(:), digits, comma (,), ASCII minus (-), ASCII
plus (+), and NUL bytes are allowed.
+ Alternatively, a designation can be surrounded by
+ angle brackets < and >; in this case, the
+ designation can contain any characters other than
+ > and NUL.
offset Indicates the value one must add to the local
time to arrive at Coordinated Universal Time.
diff --git a/northamerica b/northamerica
index 6256f97..0bafb00 100644
--- a/northamerica
+++ b/northamerica
@@ -413,11 +413,42 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# north of the Salmon River, and the towns of Burgdorf and Warren),
# Nevada (except West Wendover), Oregon (except the northern 3/4 of
# Malheur county), and Washington
+
+# From Paul Eggert (2016-08-20):
+# In early February 1948, in response to California's electricity shortage,
+# PG&E changed power frequency from 60 to 59.5 Hz during daylight hours,
+# causing electric clocks to lose six minutes per day. (This did not change
+# legal time, and is not part of the data here.) See:
+# Ross SA. An energy crisis from the past: Northern California in 1948.
+# Working Paper No. 8, Institute of Governmental Studies, UC Berkeley,
+# 1973-11. http://escholarship.org/uc/item/8x22k30c
+#
+# In another measure to save electricity, DST was instituted from 1948-03-14
+# at 02:01 to 1949-01-16 at 02:00, with the governor having the option to move
+# the fallback transition earlier. See pages 3-4 of:
+# http://clerk.assembly.ca.gov/sites/clerk.assembly.ca.gov/files/archive/Statutes/1948/48Vol1_Chapters.pdf
+#
+# In response:
+#
+# Governor Warren received a torrent of objecting mail, and it is not too much
+# to speculate that the objections to Daylight Saving Time were one important
+# factor in the defeat of the Dewey-Warren Presidential ticket in California.
+# -- Ross, p 25
+#
+# On December 8 the governor exercised the option, setting the date to January 1
+# (LA Times 1948-12-09). The transition time was 02:00 (LA Times 1949-01-01).
+#
+# Despite the controversy, in 1949 California voters approved Proposition 12,
+# which established DST from April's last Sunday at 01:00 until September's
+# last Sunday at 02:00. This was amended by 1962's Proposition 6, which changed
+# the fall-back date to October's last Sunday. See:
+# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
+# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
-Rule CA 1948 only - Mar 14 2:00 1:00 D
+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 2:00 1:00 D
+Rule CA 1950 1966 - Apr lastSun 1:00 1:00 D
Rule CA 1950 1961 - Sep lastSun 2:00 0 S
Rule CA 1962 1966 - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -3281,7 +3312,7 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# indicating that the normal ET rules are followed.
#
# From Paul Eggert (2014-08-19):
-# The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See:
+# The 2014-08-13 Cabinet meeting decided to stay on UT -04 year-round. See:
# http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm
# Model this as a switch from EST/EDT to AST ...
# From Chris Walton (2014-11-04):
diff --git a/private.h b/private.h
index 941e91b..daad297 100644
--- a/private.h
+++ b/private.h
@@ -15,6 +15,7 @@
** Thank you!
*/
+/* This string was in the Factory zone through version 2016f. */
#define GRANDPARENTED "Local time zone must be set--see zic manual page"
/*
diff --git a/southamerica b/southamerica
index 1c38f63..5321451 100644
--- a/southamerica
+++ b/southamerica
@@ -410,9 +410,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# stuck on Summer daylight savings time even though the summer is over.
# From Paul Eggert (2013-09-05):
-# Perhaps San Luis operates on the legal fiction that it is at UTC-4
+# Perhaps San Luis operates on the legal fiction that it is at -04
# with perpetual summer time, but ordinary usage typically seems to
-# just say it's at UTC-3; see, for example,
+# just say it's at -03; see, for example,
# http://es.wikipedia.org/wiki/Hora_oficial_argentina
# We've documented similar situations as being plain changes to
# standard time, so let's do that here too. This does not change UTC
diff --git a/strftime.c b/strftime.c
index f75f9fd..151b2e9 100644
--- a/strftime.c
+++ b/strftime.c
@@ -137,14 +137,11 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
tzset();
warn = IN_NONE;
- p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn);
+ p = _fmt(format, t, s, s + maxsize, &warn);
#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) {
fprintf(stderr, "\n");
- if (format == NULL)
- fprintf(stderr, "NULL strftime format ");
- else fprintf(stderr, "strftime format \"%s\" ",
- format);
+ fprintf(stderr, "strftime format \"%s\" ", format);
fprintf(stderr, "yields only two digits of years in ");
if (warn == IN_SOME)
fprintf(stderr, "some locales");
diff --git a/tz-art.htm b/tz-art.htm
index c06d805..0a2b427 100644
--- a/tz-art.htm
+++ b/tz-art.htm
@@ -24,6 +24,184 @@ into problems that programmers have with timekeeping.
Bell Science extravaganza, with Frank Baxter, Richard Deacon, and Les Tremayne.
(IMDb entry.)
+Movies
+
+-
+In the 1946 movie A Matter of Life and Death
+(U.S. title Stairway to Heaven)
+there is a reference to British Double Summer Time.
+The time does not play a large part in the plot;
+it's just a passing reference to the time when one of the
+characters was supposed to have died (but didn't).
+The IMDb page is at
+
+http://us.imdb.com/title/tt0038733/
+. (Dave Cantor)
+
-
+The 1953 railway comedy movie The Titfield Thunderbolt includes a
+play on words on British Double Summer Time. Valentine's wife wants
+him to leave the pub and asks him, "Do you know what time it is?"
+And he, happy where he is, replies: "Yes, my love. Summer double time."
+IMDb page:
+
+http://us.imdb.com/title/tt0046436/
+. (Mark Brader, 2009-10-02)
+
+-
+The premise of the 1999 caper movie Entrapment involves computers
+in an international banking network being shut down briefly at
+midnight in each time zone to avoid any problems at the transition
+from the year 1999 to 2000 in that zone. (Hmmmm.) If this shutdown
+is extended by 10 seconds, it will create a one-time opportunity for
+a gigantic computerized theft. To achieve this, at one location the
+crooks interfere with the microwave system supplying time signals to
+the computer, advancing the time by 0.1 second each minute over the
+last hour of 1999. (So this movie teaches us that 0.1 × 60 = 10.)
+IMDb page:
+
+http://us.imdb.com/title/tt0137494/
+. (Mark Brader, 2009-10-02)
+
+-
+One mustn't forget the
+trailer
+(2014; 2:23) for the movie Daylight Saving.
+
+
+TV episodes
+
+-
+An episode of The Adventures of Superman entitled "The Mysterious
+Cube," first aired 1958-02-24, had Superman convincing the controllers
+of the Arlington Time Signal to broadcast ahead of actual time;
+doing so got a crook trying to be declared dead to
+emerge a bit too early from the titular enclosure.
+
+-
+The 1960s ITC television series The Prisoner included an episode
+entitled "The Chimes of Big Ben" in which our protagonist tumbled to
+the fraudulent nature of a Poland-to-England escape upon hearing "Big
+Ben" chiming on Polish local time.
+
+-
+The series Seinfeld included an episode entitled "The Susie," first
+broadcast 1997-02-13, in which Kramer decides that daylight saving time
+isn't coming fast enough, so he sets his watch ahead an hour.
+
+-
+The "20 Hours in America" episode of The West Wing,
+first aired 2002-09-25, contained a scene that
+saw White House staffers stranded in Indiana; they thought they had time to
+catch Air Force One but were done in by intra-Indiana local time changes.
+
+-
+"In what time zone would you find New York City?" was a $200 question on
+the 1999-11-13 United States airing of Who Wants to Be a Millionaire?,
+and "In 1883, what industry led the movement to divide the U.S. into four time
+zones?" was a $32,000 question on the 2001-05-23 United States airing of
+the same show. At this rate, the million-dollar time-zone
+question should have been asked 2002-06-04.
+
+-
+A private jet's mid-flight change of time zones distorts Alison Dubois'
+premonition in the "We Had a Dream" episode of Medium
+(originally aired 2007-02-28).
+
+-
+In the 30 Rock episode "Anna Howard Shaw Day"
+(first broadcast 2010-02-11),
+Jack Donaghy's date realizes that a Geneva-to-New-York business phone call
+received in the evening must be fake given the difference in local times.
+
+-
+In the "Run by the Monkeys" episode of Da Vinci's Inquest
+(first broadcast 2002-11-17),
+a witness in a five-year-old fire case realizes they may not have set
+their clock back when daylight saving ended on the day of the fire,
+introducing the possibility of an hour when arson might have occurred.
+
+-
+In "The Todd Couple" episode of Outsourced (first aired 2011-02-10),
+Manmeet sets up Valentine's Day teledates for 6:00 and 9:00pm;
+since one is with a New Yorker and the other with a San Franciscan,
+hilarity ensues.
+(Never mind that this should be 7:30am in Mumbai, yet for some reason the show
+proceeds as though it's also mid-evening there.)
+
+-
+In the "14 Days to Go"/"T Minus..." episode of
+You, Me and the Apocalypse
+(first aired 2015-11-11 in the UK, 2016-03-10 in the US),
+the success of a mission to deal with a comet
+hinges on whether or not Russia observes daylight saving time.
+(In the US, the episode first aired in the week before the switch to DST.)
+
+-
+"The Lost Hour", Eerie, Indiana, episode 10, NBC, 1991-12-01.
+Despite Indiana's then-lack of DST, Marshall changes his clock with
+unusual consequences.
+
+-
+"Time Tunnel", The Adventures of Pete & Pete, season 2, episode 5,
+Nickelodeon, 1994-10-23.
+The two Petes travel back in time an hour on the day that DST ends.
+
+-
+"King-Size Homer", The Simpsons, episode 135, Fox, 1995-11-05.
+Homer, working from home, remarks "8:58, first
+time I've ever been early for work. Except for all those daylight
+savings days. Lousy farmers."
+
+-
+"Tracks", The Good Wife, season 7, episode 12,
+CBS, 2016-01-17.
+The applicability of a contract hinges on the
+time zone associated with a video time stamp.
+
+
+Books, plays, and magazines
+
+-
+Jules Verne, Around the World in Eighty Days
+(Le tour du monde en quatre-vingts jours).
+Wall-clock time plays a central role in the plot.
+European readers of the 1870s clearly held the U.S. press in
+deep contempt; the protagonists cross the U.S. without once
+reading a paper.
+Available versions include
+an English
+translation, and
+the original French
+"with illustrations from the original 1873 French-language edition".
+
+-
+Nick Enright, Daylight Saving, 1989.
+A fast-paced comedy about love and loneliness as the clocks turn back.
+
+-
+Umberto Eco, The Island of the Day Before
+(L'isola del giorno prima), 1994.
+"...the story of a 17th century Italian nobleman trapped near an island
+on the International Date Line. Time and time zones play an integral
+part in the novel." (Paul Eggert, 2006-04-22)
+
+-
+John Dunning, Two
+O'Clock, Eastern Wartime, 2001.
+Mystery, history, daylight saving time, and old-time radio.
+
+-
+Surrealist artist Guy Billout's work "Date Line" appeared on page 103
+of the 1999-11 Atlantic Monthly.
+
+-
+"Gloom, Gloom, Go Away" by Walter Kirn appeared on page 106 of Time
+magazine's 2002-11-11 issue; among other things, it proposed
+year-round DST as a way of lessening wintertime despair.
+
+
Music
Data on recordings of "Save That Time," Russ Long, Serrob Publishing, BMI:
@@ -254,215 +432,6 @@ Supernaw.
Notes | Includes the piece "What Time Is It"
("He knew what time it was everywhere...that counted"). |
-
-TV episodes
-
-
--
-An episode of The Adventures of Superman entitled "The Mysterious
-Cube," first aired 1958-02-24, had Superman convincing the controllers
-of the Arlington Time Signal to broadcast ahead of actual time;
-doing so got a crook trying to be declared dead to
-emerge a bit too early from the titular enclosure.
-
--
-The 1960s ITC television series The Prisoner included an episode
-entitled "The Chimes of Big Ben" in which our protagonist tumbled to
-the fraudulent nature of a Poland-to-England escape upon hearing "Big
-Ben" chiming on Polish local time.
-
--
-The series Seinfeld included an episode entitled "The Susie," first
-broadcast 1997-02-13, in which Kramer decides that daylight saving time
-isn't coming fast enough, so he sets his watch ahead an hour.
-
--
-The "20 Hours in America" episode of The West Wing,
-first aired 2002-09-25,
-saw White House staffers stranded in Indiana; they thought they had time to
-catch Air Force One but were done in by intra-Indiana local time changes.
-
--
-"In what time zone would you find New York City?" was a $200 question on
-the 1999-11-13 United States airing of Who Wants to Be a Millionaire?,
-and "In 1883, what industry led the movement to divide the U.S. into four time
-zones?" was a $32,000 question on the 2001-05-23 United States airing of
-the same show. At this rate, the million-dollar time-zone
-question should have been asked 2002-06-04.
-
--
-A private jet's mid-flight change of time zones distorts Alison Dubois'
-premonition in the "We Had a Dream" episode of Medium
-(originally aired 2007-02-28).
-
--
-In the 30 Rock episode "Anna Howard Shaw Day"
-(first broadcast 2010-02-11),
-Jack Donaghy's date realizes that a Geneva-to-New-York business phone call
-received in the evening must be fake given the difference in local times.
-
--
-In the "Run by the Monkeys" episode of Da Vinci's Inquest
-(first broadcast 2002-11-17),
-a witness in a five-year-old fire case realizes they may not have set
-their clock back when daylight saving ended on the day of the fire,
-introducing the possibility of an hour when arson might have occurred.
-
--
-In "The Todd Couple" episode of Outsourced (first aired 2011-02-10),
-Manmeet sets up Valentine's Day teledates for 6:00 and 9:00pm;
-since one is with a New Yorker and the other with a San Franciscan,
-hilarity ensues.
-(Never mind that this should be 7:30am in Mumbai, yet for some reason the show
-proceeds as though it's also mid-evening there.)
-
--
-In the "14 Days to Go"/"T Minus..." episode of
-You, Me and the Apocalypse
-(first aired 2015-11-11 in the UK, 2016-03-10 in the US),
-the success of a mission to deal with a comet
-hinges on whether or not Russia observes daylight saving time.
-(In the US, the episode first aired in the week before the switch to DST.)
-
-
-
-
-TV episode title | The Lost Hour |
-
TV series | Eerie, Indiana |
-
TV episode number | 10 |
-
Network | NBC |
-
Air date | 1991-12-01 |
-
Notes | Despite Indiana's then-lack of DST, Marshall changes his clock with unusual consequences. |
- |
-
-TV episode title | Time Tunnel |
-
TV series | The Adventures of Pete & Pete |
-
TV episode number | 5, season 2 |
-
Network | Nickelodeon |
-
Air date | 1994-10-23 |
-
Notes | The two Petes travel back in time an hour on the day that DST ends. |
- |
-
-TV episode title | King-Size Homer |
-
TV series | The Simpsons |
-
TV episode number | 135 |
-
Network | Fox |
-
Air date | 1995-11-05 |
-
Notes | Homer, working from home, remarks "8:58, first
-time I've ever been early for work. Except for all those daylight
-savings days. Lousy farmers." |
- |
-
-TV episode title | Tracks |
-TV series | The Good Wife |
-TV episode number | 12, season 7 |
-Network | CBS |
-Air date | 2016-01-17 |
-Notes | The applicability of a contract hinges on the
-time zone associated with a video time stamp. |
-
-
-Books, plays, and magazines
-
-
-Artist | Jules Verne |
-Book | Around the World in Eighty Days
-(Le tour du monde en quatre-vingts jours) |
-Notes | Wall-clock time plays a central role in the plot.
-European readers of the 1870s clearly held the U.S. press in
-deep contempt; the protagonists cross the U.S. without once
-reading a paper.
-An on-line French-language version of the book
-"with illustrations from the original 1873 French-language edition"
-is available at
-http://fourmilab.ch/etexts/www/tdm80j
-An on-line English-language translation of the book is available at
-http://www.literature.org/Works/Jules-Verne/eighty |
-
- |
-Artist | Nick Enright |
-Play | Daylight Saving |
-Copyright Date | 1989 |
-Notes |
-A fast-paced comedy about love and loneliness as the clocks turn back.
- |
-
- |
-Artist | Umberto Eco |
-Book | The Island of the Day Before
-(L'isola del giorno prima) |
-Copyright Date | 1994 |
-Notes |
-"...the story of a 17th century Italian nobleman trapped near an island
-on the International Date Line. Time and time zones play an integral
-part in the novel." (Paul Eggert, 2006-04-22)
- |
- |
-Artist | John Dunning |
-Book | Two
-O'Clock, Eastern Wartime |
-Copyright Date | 2001 |
-Notes |
-Mystery, history, daylight saving time, and old-time radio.
- |
-
-
-
--
-Surrealist artist Guy Billout's work "Date Line" appeared on page 103
-of the 1999-11 Atlantic Monthly.
-
--
-"Gloom, Gloom, Go Away" by Walter Kirn appeared on page 106 of Time
-magazine's 2002-11-11 issue; among other things, it proposed
-year-round DST as a way of lessening wintertime despair.
-
-
-Movies
-
--
-In the 1946 movie A Matter of Life and Death
-(U.S. title Stairway to Heaven)
-there is a reference to British Double Summer Time.
-The time does not play a large part in the plot;
-it's just a passing reference to the time when one of the
-characters was supposed to have died (but didn't).
-The IMDb page is at
-
-http://us.imdb.com/title/tt0038733/
-. (Dave Cantor)
-
-
-The 1953 railway comedy movie The Titfield Thunderbolt includes a
-play on words on British Double Summer Time. Valentine's wife wants
-him to leave the pub and asks him, "Do you know what time it is?"
-And he, happy where he is, replies: "Yes, my love. Summer double time."
-IMDb page:
-
-http://us.imdb.com/title/tt0046436/
-. (Mark Brader, 2009-10-02)
-
--
-The premise of the 1999 caper movie Entrapment involves computers
-in an international banking network being shut down briefly at
-midnight in each time zone to avoid any problems at the transition
-from the year 1999 to 2000 in that zone. (Hmmmm.) If this shutdown
-is extended by 10 seconds, it will create a one-time opportunity for
-a gigantic computerized theft. To achieve this, at one location the
-crooks interfere with the microwave system supplying time signals to
-the computer, advancing the time by 0.1 second each minute over the
-last hour of 1999. (So this movie teaches us that 0.1 × 60 = 10.)
-IMDb page:
-
-http://us.imdb.com/title/tt0137494/
-. (Mark Brader, 2009-10-02)
-
--
-One mustn't forget the
-trailer
-(2014; 2:23) for the movie Daylight Saving.
-
-
Comics
-
diff --git a/tz-how-to.html b/tz-how-to.html
index a777a4e..a94759e 100644
--- a/tz-how-to.html
+++ b/tz-how-to.html
@@ -12,8 +12,7 @@ Database Source Files
times of day from the tz database
source files. It might be helpful, but not absolutely necessary,
for the reader to have already downloaded the
-latest
-release of the database and become familiar with the basic layout
+latest release of the database and become familiar with the basic layout
of the data files. The format is explained in the “man
page” for the zic compiler,
zic.8.txt
, in
the code
subdirectory.
@@ -251,7 +250,7 @@ local standard time (different from wall clock time when observing
daylight saving time); or it can be suffixed with ‘g’,
‘u’, or ‘z’, all three of which mean the
standard time at the
-prime meridan.
+prime meridian.
‘g’ stands for “GMT”;
‘u’ stands for “
-
+
zoneinfo or
tz
)
is used by several implementations,
including
-the
+the
GNU
C Library (used in
GNU/Linux),
@@ -65,13 +65,13 @@ title="Advanced Interactive eXecutive">AIX,
BlackBerry 10,
iOS,
-Microsoft Windows,
+macOS,
+Microsoft Windows,
OpenVMS,
-Oracle Database,
-Oracle Solaris, and
-OS
-X.
+Oracle Database, and
+Oracle Solaris.
Each location in the database represents a region where all
clocks keeping local time have agreed since 1970.
@@ -103,47 +103,51 @@ for time stamps after 1960 this is more precisely Coordinated
Universal Time (UTC).
The database also records when daylight saving time was in use,
-along with alphabetic time zone abbreviations such as EST
+along with some time zone abbreviations such as EST
for Eastern Standard Time in the US.
-In the tz
database's
+The following shell commands download
+the latest release's two
+tarballs
+to a GNU/Linux or similar host.
+mkdir tzdb
+cd tzdb
+wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz'
+gzip -dc tzcode-latest.tar.gz | tar -xf -
+gzip -dc tzdata-latest.tar.gz | tar -xf -
+
+Alternatively, the following shell commands download the same
+release in a single-tarball format containing extra data
+useful for regression testing:
+wget --retr-symlinks 'ftp://ftp.iana.org/tz/tzdb-latest.tar.lz'
+lzip -dc tzdb-latest.tar.lz | tar -xf -
+
+These commands use convenience links to the latest of the
FTP releases
-the code is in the file tzcodeC.tar.gz
,
-where C
is the code's version;
-similarly, the data entries are in tzdataD.tar.gz
,
-where D
is the data's version.
+of the tz
database.
+Older releases are in files named
+tzcodeV.tar.gz
,
+tzdataV.tar.gz
, and
+tzdb-V.tar.lz
,
+where V
is the version.
Since 1996, each version has been a four-digit year followed by
lower-case letter (a through z,
then za through zz, then zza
through zzz, and so on).
-Convenience links to
-the latest
-code and
-latest data revisions
-are also available.
-The following shell commands download
-these files to a GNU/Linux or similar host;
-see the downloaded
-README
file for what to do next.
-mkdir tz
-cd tz
-wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz'
-gzip -dc tzcode-latest.tar.gz | tar -xf -
-gzip -dc tzdata-latest.tar.gz | tar -xf -
-
-
-The code and data files can also be obtained from the
+The releases can also be obtained from the
Time Zone Database website
of the Internet Assigned Numbers
Authority (IANA).
An unofficial development
repository of the code and data is available
-in Git form
+in Git form
from GitHub; be careful, as this
repository is less well tested and probably contains more errors.
+After extracting a distribution's files, see its
+README
file for what to do next.
The code lets you compile the tz
source files into
machine-readable binary files, one for each location. It also lets
you read a tz
binary file and interpret time stamps for that
@@ -204,7 +208,7 @@ the Timing of Time Zone Changes gives examples of problems caused
by inadequate notice by governments of time zone and daylight saving
rule changes.
A
+href="https://blog.jonudell.net/2009/10/23/a-literary-appreciation-of-the-olsonzoneinfotz-database/">A
literary appreciation of the Olson/Zoneinfo/tz database comments on the
database's style.
@@ -240,15 +244,14 @@ names and shows location maps.
Network protocols for tz
data
Other tz
compilers
Noda Time – Date and
time API for .NET
and TZ4Net
-are similar to Joda Time, but for the .NET framework instead of
+are similar to Joda-Time and Time4J, but for the .NET framework instead of
Java. They are freely available under the
-Apache License
+Apache License
and a BSD-style license, respectively.
JavaScript-based
compilers and libraries include:
@@ -364,6 +364,10 @@ Dates. It is freely available under the Apache License.
translates UT to local time. It is freely available under
the MIT license.
+JuliaTime contains a
+compiler from tz
source into
+Julia. It is freely available
+under the MIT license.
pytz – World Timezone
Definitions for Python compiles tz
source into
Python.
@@ -389,16 +393,14 @@ license.
Other tz
binary file readers
- The GNU C
+href="https://www.gnu.org/software/libc/">GNU C
Library
has an independent, thread-safe implementation of
a
tz
binary file reader.
-This library is freely available under the
-
-GNU Lesser General Public License
-(LGPL),
+This library is freely available under the LGPL
and is widely used in GNU/Linux systems.
-- GNOME's Glib has
+
- GNOME's
+GLib has
a
tz
binary file reader written in C that
creates a GTimeZone
object representing sets
of UT offsets.
@@ -486,8 +488,8 @@ a WordPress plugin. It is freely
available under a BSD-style license.
- Time Zone
Master is a Microsoft Windows clock program that can automatically
-download, compile and use the
tzdataD.tar.gz
-files as they are released. The Basic version is free.
+download, compile and use tz
releases. The Basic version
+is free.
- VelaTerra is
an OS X program. Its developers
@@ -517,7 +519,8 @@ is another time zone database.
- World Time Zones
contains data from the Time Service Department of the
US Naval Observatory.
-- The Standard
+
- The Standard
Schedules Information Manual of the
International Air Transport Association
gives current time zone rules for airports served by commercial aviation.
@@ -588,7 +591,7 @@ common.
Civil time concepts and history
-- A
+
- A
Walk through Time
surveys the evolution of timekeeping.
- About Daylight
@@ -597,8 +600,6 @@ is an overall history of DST.
- Working with Time Zones
contains guidelines and best practices for software applications that
deal with civil time.
-- Saving Time,
-Saving Energy discusses a primary justification for DST.
- A Brief
History of Daylight Saving Time summarizes some of the contentious
history of DST.
@@ -656,7 +657,7 @@ hreflang="nl">Legal time in the Netherlands (in Dutch)
covers the history of local time in the Netherlands from ancient times.
- New Zealand
- The Department of Internal Affairs maintains a brief History of
+href="https://www.dia.govt.nz/Daylight-Saving-History">History of
Daylight Saving. The privately-maintained History of New Zealand
time has more details.
@@ -689,7 +690,8 @@ title="Network Time Protocol">NTP: The Network
Time Protocol
discusses how to synchronize clocks of
Internet hosts.
-- The Precision
+
- The Precision
Time Protocol (IEEE 1588)
can achieve submicrosecond clock accuracy on a local area network.
@@ -701,11 +703,6 @@ specifies a DHCP
option for a server to configure
a client's time zone and daylight saving settings automatically.
-- A Few Facts
-Concerning GMT, UT, and
-the RGO
-answers questions like "What is the
-difference between GMT and UTC?"
- Astronomical
Times explains more abstruse astronomical time scales like
@@ -714,7 +711,7 @@ Times explains more abstruse astronomical time scales like
TDB.
Time
Scales goes into more detail, particularly for historical variants.
-- The The IAU's SOFA
@@ -728,10 +725,8 @@ code for converting among time scales like
Space Flight – Reference Systems – Time Conventions
briefly explains interplanetary space flight timekeeping.
- Technical
-Notes on Mars Solar Time as Adopted by the Mars24 Sunclock briefly
-describes Mars Coordinated Time (MTC) and the
+href="http://www.giss.nasa.gov/tools/mars24/help/notes.html">Mars24 Sunclock
+– Time on Mars describes Airy Mean Time (AMT) and the
diverse local time
scales used by each landed mission on Mars.
- LeapSecond.com is
@@ -747,7 +742,7 @@ when leap seconds occur.
- The Leap
Second Discussion List covers McCarthy
+href="http://www2.unb.ca/gge/Resources/gpsworld.november99.pdf">McCarthy
and Klepczynski's proposal to discontinue leap seconds,
discussed further in
The
@@ -765,7 +760,7 @@ zone names, abbreviations, identifiers, and formats. For example, it
contains French translations for "Eastern European Summer Time",
"EEST", and
"Bucharest". Its
-by-type
+by-type
charts show these values for many locales. Data values are available in
both LDML
(an XML format) and JSON.
@@ -809,10 +804,10 @@ practice. For example, in English-speaking North America
but in China it denotes 8 hours ahead of UTC,
and French-speaking North Americans prefer
"HNC" to
-"CST". For POSIX the
tz
-database contains English abbreviations for all time stamps but in
-many cases these are merely inventions of the database
-maintainers.
+"CST". The tz
+database contains English abbreviations for many time stamps;
+unfortunately some of these abbreviations were merely the database maintainers'
+inventions, and are gradually being removed.
- Numeric time zone abbreviations typically count hours east of
UTC, e.g., +09 for Japan and
−10 for Hawaii. However, the POSIX
@@ -827,7 +822,7 @@ settings like
TZ="Asia/Tokyo"
and
confusion, handle old time stamps better, and insulate you better from
any future changes to the rules. One should never set
POSIX TZ
to a value like
-"GMT-9"
, though, since this would falsely claim that
+"GMT-9"
, though, since this would incorrectly imply that
local time is nine hours ahead of UTC and the time zone
is called "GMT".
diff --git a/tzfile.5 b/tzfile.5
index b7e6d45..0c907bc 100644
--- a/tzfile.5
+++ b/tzfile.5
@@ -2,6 +2,13 @@
.SH NAME
tzfile \- time zone information
.SH DESCRIPTION
+.ie '\(lq'' .ds lq \&"\"
+.el .ds lq \(lq\"
+.ie '\(rq'' .ds rq \&"\"
+.el .ds rq \(rq\"
+.de q
+\\$3\*(lq\\$1\*(rq\\$2
+..
The time zone information files used by
.IR tzset (3)
begin with the magic characters "TZif" to identify them as
@@ -138,6 +145,13 @@ POSIX-TZ-environment-variable-style string for use in handling instants
after the last transition time stored in the file
(with nothing between the newlines if there is no POSIX representation for
such instants).
+The POSIX-style string must must agree with the local time type after
+both data's last transition times; for example, given the string
+.q "WET0WEST,M3.5.0,M10.5.0/3"
+then if a last transition time is in July, the transition's local time
+type must specify a daylight-saving time abbreviated
+.q "WEST"
+that is one hour east of UT.
.PP
For version-3-format time zone files, the POSIX-TZ-style string may
use two minor extensions to the POSIX TZ format, as described in
diff --git a/tzfile.5.txt b/tzfile.5.txt
index fbc44e6..ca632ea 100644
--- a/tzfile.5.txt
+++ b/tzfile.5.txt
@@ -89,7 +89,12 @@ DESCRIPTION
After the second header and data comes a newline-enclosed, POSIX-TZ-
environment-variable-style string for use in handling instants after
the last transition time stored in the file (with nothing between the
- newlines if there is no POSIX representation for such instants).
+ newlines if there is no POSIX representation for such instants). The
+ POSIX-style string must must agree with the local time type after both
+ data's last transition times; for example, given the string
+ "WET0WEST,M3.5.0,M10.5.0/3" then if a last transition time is in July,
+ the transition's local time type must specify a daylight-saving time
+ abbreviated "WEST" that is one hour east of UT.
For version-3-format time zone files, the POSIX-TZ-style string may use
two minor extensions to the POSIX TZ format, as described in
diff --git a/version b/version
new file mode 100644
index 0000000..53d69d1
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+2016g
diff --git a/zdump.8 b/zdump.8
index db73f49..14ca60b 100644
--- a/zdump.8
+++ b/zdump.8
@@ -9,6 +9,13 @@ zdump \- time zone dumper
.I zonename
\&... ]
.SH DESCRIPTION
+.ie '\(lq'' .ds lq \&"\"
+.el .ds lq \(lq\"
+.ie '\(rq'' .ds rq \&"\"
+.el .ds rq \(rq\"
+.de q
+\\$3\*(lq\\$1\*(rq\\$2
+..
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.I Zdump
@@ -21,7 +28,17 @@ These options are available:
.BI "\*-\*-version"
Output version information and exit.
.TP
+.B \*-i
+.I "(This option is experimental: its behavior may change in future versions.)"
+Output a description of time intervals. For each
+.I zonename
+on the command line, output an interval-format description of the
+zone. See
+.q "INTERVAL FORMAT"
+below.
+.TP
.B \*-v
+Output a verbose description of time intervals.
For each
.I zonename
on the command line,
@@ -52,7 +69,7 @@ This generates output that is easier to compare to that of
implementations with different time representations.
.TP
.BI "\*-c " [loyear,]hiyear
-Cut off verbose output at the given year(s).
+Cut off interval output at the given year(s).
Cutoff times are computed using the proleptic Gregorian calendar with year 0
and with Universal Time (UT) ignoring leap seconds.
The lower bound is exclusive and the upper is inclusive; for example, a
@@ -64,7 +81,7 @@ The default cutoff is
.BR \*-500,2500 .
.TP
.BI "\*-t " [lotime,]hitime
-Cut off verbose output at the given time(s),
+Cut off interval output at the given time(s),
given in decimal seconds since 1970-01-01 00:00:00
Coordinated Universal Time (UTC).
The
@@ -73,19 +90,135 @@ determines whether the count includes leap seconds.
As with
.BR \*-c ,
the cutoff's lower bound is exclusive and its upper bound is inclusive.
+.SH "INTERVAL FORMAT"
+.I "This format is experimental: it may change in future versions."
+.PP
+The interval format is a compact text representation that is intended
+to be both human- and machine-readable. It consists of an empty line,
+then a line
+.q "TZ=\fIstring\fP"
+where
+.I string
+is a double-quoted string giving the zone name, a second line
+.q "\*- \*- \fIinterval\fP"
+describing the time interval before the first transition if any, and
+zero or more following lines
+.q "\fIdate time interval\fP",
+one line for each transition time and following interval. Fields are
+separated by single tabs.
+.PP
+Dates are in
+.IR yyyy - mm - dd
+format and times are in 24-hour
+.IR hh : mm : ss
+format where
+.IR hh <24.
+Times are in local time immediately after the transition. A
+time interval description consists of a UT offset in signed
+.RI \(+- hh : mm : ss
+format, a time zone abbreviation, and an isdst flag. An abbreviation
+that equals the UT offset is omitted; other abbreviations are
+double-quoted strings unless they consist of one or more alphabetic
+characters. An isdst flag is omitted for standard time, and otherwise
+is a decimal integer that is unsigned and positive (typically 1) for
+daylight saving time and negative for unknown.
+.PP
+In times and UT offsets, the seconds are omitted if they are zero, and
+the minutes are also omitted if they are also zero. Positive UT
+offsets are east of Greenwich. The UT offset \*-00 denotes a UT
+placeholder in areas where the actual offset is unspecified; by
+convention, this occurs when the UT offset is zero and the time zone
+abbreviation begins with
+.q "\*-"
+or is
+.q "zzz".
+.PP
+In double-quoted strings, escape sequences represent unusual
+characters. The escape sequences are \es for space, and \e", \e\e,
+\ef, \en, \er, \et, and \ev with their usual meaning in the C
+programming language. E.g., the double-quoted string
+\*(lq"CET\es\e"\e\e"\*(rq represents the character sequence \*(lqCET
+"\e\*(rq.\""
+.PP
+.ne 9
+Here is an example of the output, with the leading empty line omitted.
+(This example is shown with tab stops set far enough apart so that the
+tabbed columns line up.)
+.nf
+.sp
+.if \n(.g .ft CW
+.if t .in +.5i
+.if n .in +2
+.nr w \w'1896-01-13 'u
+.ta \nwu +\nwu +\nwu +\nwu
+TZ="Pacific/Honolulu"
+- - -10:31:26 LMT
+1896-01-13 12:01:26 -10:30 HST
+1933-04-30 03 -09:30 HDT 1
+1933-05-21 11 -10:30 HST
+1942-02-09 03 -09:30 HDT 1
+1945-09-30 01 -10:30 HST
+1947-06-08 02:30 -10 HST
+.in
+.if \n(.g .ft
+.sp
+.fi
+Here, local time begins 10 hours, 31 minutes and 26 seconds west of
+UT, and is a standard time abbreviated LMT. Immediately after the
+first transition, the date is 1896-01-13 and the time is 12:01:26, and
+the following time interval is 10.5 hours west of UT, a standard time
+abbreviated HST. Immediately after the second transition, the date is
+1933-04-30 and the time is 03:00:00 and the following time interval is
+9.5 hours west of UT, is abbreviated HDT, and is daylight saving time.
+Immediately after the last transition the date is 1947-06-08 and the
+time is 02:30:00, and the following time interval is 10 hours west of
+UT, a standard time abbreviated HST.
+.PP
+.ne 10
+Here are excerpts from another example:
+.nf
+.sp
+.if \n(.g .ft CW
+.if t .in +.5i
+.if n .in +2
+TZ="Europe/Astrakhan"
+- - +03:12:12 LMT
+1924-04-30 23:47:48 +03
+1930-06-21 01 +04
+1981-04-01 01 +05 1
+1981-09-30 23 +04
+\&...
+2014-10-26 01 +03
+2016-03-27 03 +04
+.in
+.if \n(.g .ft
+.sp
+.fi
+This time zone is east of UT, so its UT offsets are positive. Also,
+many of its time zone abbreviations are omitted since they duplicate
+the text of the UT offset.
.SH LIMITATIONS
Time discontinuities are found by sampling the results returned by localtime
at twelve-hour intervals.
This works in all real-world cases;
one can construct artificial time zones for which this fails.
.PP
-In the output, "UT" denotes the value returned by
+In the
+.B \*-v
+and
+.B \*-V
+output,
+.q "UT"
+denotes the value returned by
.IR gmtime (3),
which uses UTC for modern time stamps and some other UT flavor for
time stamps that predate the introduction of UTC.
-No attempt is currently made to have the output use "UTC" for newer
-and "UT" for older time stamps,
-partly because the exact date of the introduction of UTC is problematic.
+No attempt is currently made to have the output use
+.q "UTC"
+for newer and
+.q "UT"
+for older time stamps, partly because the exact date of the
+introduction of UTC is problematic.
.SH "SEE ALSO"
newctime(3), tzfile(5), zic(8)
.\" This file is in the public domain, so clarified as of
diff --git a/zdump.8.txt b/zdump.8.txt
index df8d1fd..bae93d8 100644
--- a/zdump.8.txt
+++ b/zdump.8.txt
@@ -15,24 +15,29 @@ DESCRIPTION
--version
Output version information and exit.
- -v For each zonename on the command line, print the time at the
- lowest possible time value, the time one day after the lowest
- possible time value, the times both one second before and
- exactly at each detected time discontinuity, the time at one day
- less than the highest possible time value, and the time at the
- highest possible time value. Each line is followed by isdst=D
- where D is positive, zero, or negative depending on whether the
- given time is daylight saving time, standard time, or an unknown
- time type, respectively. Each line is also followed by gmtoff=N
- if the given local time is known to be N seconds east of
- Greenwich.
+ -i (This option is experimental: its behavior may change in future
+ versions.) Output a description of time intervals. For each
+ zonename on the command line, output an interval-format
+ description of the zone. See "INTERVAL FORMAT" below.
+
+ -v Output a verbose description of time intervals. For each
+ zonename on the command line, print the time at the lowest
+ possible time value, the time one day after the lowest possible
+ time value, the times both one second before and exactly at each
+ detected time discontinuity, the time at one day less than the
+ highest possible time value, and the time at the highest
+ possible time value. Each line is followed by isdst=D where D
+ is positive, zero, or negative depending on whether the given
+ time is daylight saving time, standard time, or an unknown time
+ type, respectively. Each line is also followed by gmtoff=N if
+ the given local time is known to be N seconds east of Greenwich.
-V Like -v, except omit the times relative to the extreme time
values. This generates output that is easier to compare to that
of implementations with different time representations.
-c [loyear,]hiyear
- Cut off verbose output at the given year(s). Cutoff times are
+ Cut off interval output at the given year(s). Cutoff times are
computed using the proleptic Gregorian calendar with year 0 and
with Universal Time (UT) ignoring leap seconds. The lower bound
is exclusive and the upper is inclusive; for example, a loyear
@@ -41,22 +46,96 @@ DESCRIPTION
cutoff is -500,2500.
-t [lotime,]hitime
- Cut off verbose output at the given time(s), given in decimal
+ Cut off interval output at the given time(s), given in decimal
seconds since 1970-01-01 00:00:00 Coordinated Universal Time
(UTC). The zonename determines whether the count includes leap
seconds. As with -c, the cutoff's lower bound is exclusive and
its upper bound is inclusive.
+INTERVAL FORMAT
+ This format is experimental: it may change in future versions.
+
+ The interval format is a compact text representation that is intended
+ to be both human- and machine-readable. It consists of an empty line,
+ then a line "TZ=string" where string is a double-quoted string giving
+ the zone name, a second line "- - interval" describing the time
+ interval before the first transition if any, and zero or more following
+ lines "date time interval", one line for each transition time and
+ following interval. Fields are separated by single tabs.
+
+ Dates are in yyyy-mm-dd format and times are in 24-hour hh:mm:ss format
+ where hh<24. Times are in local time immediately after the transition.
+ A time interval description consists of a UT offset in signed
+ +-hh:mm:ss format, a time zone abbreviation, and an isdst flag. An
+ abbreviation that equals the UT offset is omitted; other abbreviations
+ are double-quoted strings unless they consist of one or more alphabetic
+ characters. An isdst flag is omitted for standard time, and otherwise
+ is a decimal integer that is unsigned and positive (typically 1) for
+ daylight saving time and negative for unknown.
+
+ In times and UT offsets, the seconds are omitted if they are zero, and
+ the minutes are also omitted if they are also zero. Positive UT
+ offsets are east of Greenwich. The UT offset -00 denotes a UT
+ placeholder in areas where the actual offset is unspecified; by
+ convention, this occurs when the UT offset is zero and the time zone
+ abbreviation begins with "-" or is "zzz".
+
+ In double-quoted strings, escape sequences represent unusual
+ characters. The escape sequences are \s for space, and \", \\, \f, \n,
+ \r, \t, and \v with their usual meaning in the C programming language.
+ E.g., the double-quoted string ""CET\s\"\\"" represents the character
+ sequence "CET "\".
+
+ Here is an example of the output, with the leading empty line omitted.
+ (This example is shown with tab stops set far enough apart so that the
+ tabbed columns line up.)
+
+ TZ="Pacific/Honolulu"
+ - - -10:31:26 LMT
+ 1896-01-13 12:01:26 -10:30 HST
+ 1933-04-30 03 -09:30 HDT 1
+ 1933-05-21 11 -10:30 HST
+ 1942-02-09 03 -09:30 HDT 1
+ 1945-09-30 01 -10:30 HST
+ 1947-06-08 02:30 -10 HST
+
+ Here, local time begins 10 hours, 31 minutes and 26 seconds west of UT,
+ and is a standard time abbreviated LMT. Immediately after the first
+ transition, the date is 1896-01-13 and the time is 12:01:26, and the
+ following time interval is 10.5 hours west of UT, a standard time
+ abbreviated HST. Immediately after the second transition, the date is
+ 1933-04-30 and the time is 03:00:00 and the following time interval is
+ 9.5 hours west of UT, is abbreviated HDT, and is daylight saving time.
+ Immediately after the last transition the date is 1947-06-08 and the
+ time is 02:30:00, and the following time interval is 10 hours west of
+ UT, a standard time abbreviated HST.
+
+ Here are excerpts from another example:
+
+ TZ="Europe/Astrakhan"
+ - - +03:12:12 LMT
+ 1924-04-30 23:47:48 +03
+ 1930-06-21 01 +04
+ 1981-04-01 01 +05 1
+ 1981-09-30 23 +04
+ ...
+ 2014-10-26 01 +03
+ 2016-03-27 03 +04
+
+ This time zone is east of UT, so its UT offsets are positive. Also,
+ many of its time zone abbreviations are omitted since they duplicate
+ the text of the UT offset.
+
LIMITATIONS
Time discontinuities are found by sampling the results returned by
localtime at twelve-hour intervals. This works in all real-world
cases; one can construct artificial time zones for which this fails.
- In the output, "UT" denotes the value returned by gmtime(3), which uses
- UTC for modern time stamps and some other UT flavor for time stamps
- that predate the introduction of UTC. No attempt is currently made to
- have the output use "UTC" for newer and "UT" for older time stamps,
- partly because the exact date of the introduction of UTC is
+ In the -v and -V output, "UT" denotes the value returned by gmtime(3),
+ which uses UTC for modern time stamps and some other UT flavor for time
+ stamps that predate the introduction of UTC. No attempt is currently
+ made to have the output use "UTC" for newer and "UT" for older time
+ stamps, partly because the exact date of the introduction of UTC is
problematic.
SEE ALSO
diff --git a/zdump.c b/zdump.c
index 64d90f6..f68ba3d 100644
--- a/zdump.c
+++ b/zdump.c
@@ -139,6 +139,26 @@ typedef long intmax_t;
# include
#endif
+#ifndef TYPE_BIT
+#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
+#endif /* !defined TYPE_BIT */
+
+#ifndef TYPE_SIGNED
+#define TYPE_SIGNED(type) (((type) -1) < 0)
+#endif /* !defined TYPE_SIGNED */
+
+#ifndef INT_STRLEN_MAXIMUM
+/*
+** 302 / 1000 is log10(2.0) rounded up.
+** Subtract one for the sign bit if the type is signed;
+** add one for integer division truncation;
+** add one more for a minus sign if the type is signed.
+*/
+#define INT_STRLEN_MAXIMUM(type) \
+ ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
+ 1 + TYPE_SIGNED(type))
+#endif /* !defined INT_STRLEN_MAXIMUM */
+
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */
@@ -238,8 +258,9 @@ enum { SECSPER400YEARS_FITS = SECSPERLYEAR <= INTMAX_MAX / 400 };
# define timezone_t char **
#endif
-#if !HAVE_POSIX_DECLS
extern char ** environ;
+
+#if !HAVE_POSIX_DECLS
extern int getopt(int argc, char * const argv[],
const char * options);
extern char * optarg;
@@ -268,6 +289,8 @@ static intmax_t delta(struct tm *, struct tm *) ATTRIBUTE_PURE;
static void dumptime(struct tm const *);
static time_t hunt(timezone_t, char *, time_t, time_t);
static void show(timezone_t, char *, time_t, bool);
+static void showtrans(char const *, struct tm const *, time_t, char const *,
+ char const *);
static const char *tformat(void);
static time_t yeartot(intmax_t) ATTRIBUTE_PURE;
@@ -305,6 +328,19 @@ sumsize(size_t a, size_t b)
return sum;
}
+/* Return a pointer to a newly allocated buffer of size SIZE, exiting
+ on failure. SIZE should be nonzero. */
+static void *
+xmalloc(size_t size)
+{
+ void *p = malloc(size);
+ if (!p) {
+ perror(progname);
+ exit(EXIT_FAILURE);
+ }
+ return p;
+}
+
#if ! HAVE_TZSET
# undef tzset
# define tzset zdump_tzset
@@ -392,21 +428,13 @@ tzalloc(char const *val)
while (*e++)
continue;
- env = malloc(sumsize(sizeof *environ,
- (e - environ) * sizeof *environ));
- if (! env) {
- perror(progname);
- exit(EXIT_FAILURE);
- }
+ env = xmalloc(sumsize(sizeof *environ,
+ (e - environ) * sizeof *environ));
to = 1;
for (e = environ; (env[to] = *e); e++)
to += strncmp(*e, "TZ=", 3) != 0;
}
- env0 = malloc(sumsize(sizeof "TZ=", strlen(val)));
- if (! env0) {
- perror(progname);
- exit(EXIT_FAILURE);
- }
+ env0 = xmalloc(sumsize(sizeof "TZ=", strlen(val)));
env[0] = strcat(strcpy(env0, "TZ="), val);
environ = fakeenv = env;
tzset();
@@ -527,11 +555,7 @@ saveabbr(char **buf, size_t *bufalloc, struct tm const *tmp)
to avoid O(N**2) behavior on repeated calls. */
*bufalloc = sumsize(*bufalloc, ablen + 1);
- *buf = malloc(*bufalloc);
- if (! *buf) {
- perror(progname);
- exit(EXIT_FAILURE);
- }
+ *buf = xmalloc(*bufalloc);
}
return strcpy(*buf, ab);
}
@@ -552,10 +576,18 @@ static void
usage(FILE * const stream, const int status)
{
fprintf(stream,
-_("%s: usage: %s [--version] [--help] [-{vV}] [-{ct} [lo,]hi] zonename ...\n"
+_("%s: usage: %s OPTIONS ZONENAME ...\n"
+ "Options include:\n"
+ " -c [L,]U Start at year L (default -500), end before year U (default 2500)\n"
+ " -t [L,]U Start at time L, end before time U (in seconds since 1970)\n"
+ " -i List transitions briefly (format is experimental)\n" \
+ " -v List transitions verbosely\n"
+ " -V List transitions a bit less verbosely\n"
+ " --help Output this help\n"
+ " --version Output version info\n"
"\n"
"Report bugs to %s.\n"),
- progname, progname, REPORT_BUGS_TO);
+ progname, progname, REPORT_BUGS_TO);
if (status == EXIT_SUCCESS)
close_file(stream);
exit(status);
@@ -567,7 +599,6 @@ main(int argc, char *argv[])
/* These are static so that they're initially zero. */
static char * abbrev;
static size_t abbrevsize;
- static struct tm newtm;
register int i;
register bool vflag;
@@ -577,11 +608,7 @@ main(int argc, char *argv[])
register time_t cutlotime;
register time_t cuthitime;
time_t now;
- time_t t;
- time_t newt;
- struct tm tm;
- register struct tm * tmp;
- register struct tm * newtmp;
+ bool iflag = false;
cutlotime = absolute_min_time;
cuthitime = absolute_max_time;
@@ -603,9 +630,10 @@ main(int argc, char *argv[])
vflag = Vflag = false;
cutarg = cuttimes = NULL;
for (;;)
- switch (getopt(argc, argv, "c:t:vV")) {
+ switch (getopt(argc, argv, "c:it:vV")) {
case 'c': cutarg = optarg; break;
case 't': cuttimes = optarg; break;
+ case 'i': iflag = true; break;
case 'v': vflag = true; break;
case 'V': Vflag = true; break;
case -1:
@@ -617,7 +645,7 @@ main(int argc, char *argv[])
}
arg_processing_done:;
- if (vflag | Vflag) {
+ if (iflag | vflag | Vflag) {
intmax_t lo;
intmax_t hi;
char *loend, *hiend;
@@ -674,7 +702,9 @@ main(int argc, char *argv[])
}
}
gmtzinit();
- now = time(NULL);
+ INITIALIZE (now);
+ if (! (iflag | vflag | Vflag))
+ now = time(NULL);
longest = 0;
for (i = optind; i < argc; i++) {
size_t arglen = strlen(argv[i]);
@@ -685,48 +715,66 @@ main(int argc, char *argv[])
for (i = optind; i < argc; ++i) {
timezone_t tz = tzalloc(argv[i]);
char const *ab;
+ time_t t;
+ struct tm tm, newtm;
+ bool tm_ok;
if (!tz) {
perror(argv[i]);
return EXIT_FAILURE;
}
- if (! (vflag | Vflag)) {
+ if (! (iflag | vflag | Vflag)) {
show(tz, argv[i], now, false);
tzfree(tz);
continue;
}
warned = false;
t = absolute_min_time;
- if (!Vflag) {
+ if (! (iflag | Vflag)) {
show(tz, argv[i], t, true);
t += SECSPERDAY;
show(tz, argv[i], t, true);
}
if (t < cutlotime)
t = cutlotime;
- tmp = my_localtime_rz(tz, &t, &tm);
- if (tmp)
+ tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
+ if (tm_ok) {
ab = saveabbr(&abbrev, &abbrevsize, &tm);
+ if (iflag) {
+ showtrans("\nTZ=%f", &tm, t, ab, argv[i]);
+ showtrans("-\t-\t%Q", &tm, t, ab, argv[i]);
+ }
+ }
while (t < cuthitime) {
- newt = ((t < absolute_max_time - SECSPERDAY / 2
- && t + SECSPERDAY / 2 < cuthitime)
- ? t + SECSPERDAY / 2
- : cuthitime);
- newtmp = localtime_rz(tz, &newt, &newtm);
- if ((tmp == NULL || newtmp == NULL) ? (tmp != newtmp) :
- (delta(&newtm, &tm) != (newt - t) ||
- newtm.tm_isdst != tm.tm_isdst ||
- strcmp(abbr(&newtm), ab) != 0)) {
- newt = hunt(tz, argv[i], t, newt);
- newtmp = localtime_rz(tz, &newt, &newtm);
- if (newtmp)
- ab = saveabbr(&abbrev, &abbrevsize,
- &newtm);
- }
- t = newt;
- tm = newtm;
- tmp = newtmp;
+ time_t newt = ((t < absolute_max_time - SECSPERDAY / 2
+ && t + SECSPERDAY / 2 < cuthitime)
+ ? t + SECSPERDAY / 2
+ : cuthitime);
+ struct tm *newtmp = localtime_rz(tz, &newt, &newtm);
+ bool newtm_ok = newtmp != NULL;
+ if (! (tm_ok & newtm_ok
+ ? (delta(&newtm, &tm) == newt - t
+ && newtm.tm_isdst == tm.tm_isdst
+ && strcmp(abbr(&newtm), ab) == 0)
+ : tm_ok == newtm_ok)) {
+ newt = hunt(tz, argv[i], t, newt);
+ newtmp = localtime_rz(tz, &newt, &newtm);
+ newtm_ok = newtmp != NULL;
+ if (iflag)
+ showtrans("%Y-%m-%d\t%L\t%Q", newtmp, newt,
+ newtm_ok ? abbr(&newtm) : NULL, argv[i]);
+ else {
+ show(tz, argv[i], newt - 1, true);
+ show(tz, argv[i], newt, true);
+ }
+ }
+ t = newt;
+ tm_ok = newtm_ok;
+ if (newtm_ok) {
+ ab = saveabbr(&abbrev, &abbrevsize, &newtm);
+ tm = newtm;
+ }
}
- if (!Vflag) {
+ if (! (iflag | Vflag)) {
t = absolute_max_time;
t -= SECSPERDAY;
show(tz, argv[i], t, true);
@@ -792,12 +840,11 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit)
char const * ab;
time_t t;
struct tm lotm;
- register struct tm * lotmp;
struct tm tm;
- register struct tm * tmp;
+ bool lotm_ok = my_localtime_rz(tz, &lot, &lotm) != NULL;
+ bool tm_ok;
- lotmp = my_localtime_rz(tz, &lot, &lotm);
- if (lotmp)
+ if (lotm_ok)
ab = saveabbr(&loab, &loabsize, &lotm);
for ( ; ; ) {
time_t diff = hit - lot;
@@ -809,18 +856,17 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit)
++t;
else if (t >= hit)
--t;
- tmp = my_localtime_rz(tz, &t, &tm);
- if ((lotmp == NULL || tmp == NULL) ? (lotmp == tmp) :
- (delta(&tm, &lotm) == (t - lot) &&
- tm.tm_isdst == lotm.tm_isdst &&
- strcmp(abbr(&tm), ab) == 0)) {
- lot = t;
- lotm = tm;
- lotmp = tmp;
+ tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
+ if (lotm_ok & tm_ok
+ ? (delta(&tm, &lotm) == t - lot
+ && tm.tm_isdst == lotm.tm_isdst
+ && strcmp(abbr(&tm), ab) == 0)
+ : lotm_ok == tm_ok) {
+ lot = t;
+ if (tm_ok)
+ lotm = tm;
} else hit = t;
}
- show(tz, name, lot, true);
- show(tz, name, hit, true);
return hit;
}
@@ -864,13 +910,20 @@ adjusted_yday(struct tm const *a, struct tm const *b)
/* If A is the broken-down local time and B the broken-down UTC for
the same instant, return A's UTC offset in seconds, where positive
- offsets are east of Greenwich. On failure, return LONG_MIN. */
+ offsets are east of Greenwich. On failure, return LONG_MIN.
+
+ If T is nonnull, *T is the time stamp that corresponds to A; call
+ my_gmtime_r and use its result instead of B. Otherwise, B is the
+ possibly nonnull result of an earlier call to my_gmtime_r. */
static long
-gmtoff(struct tm const *a, struct tm const *b)
+gmtoff(struct tm const *a, time_t *t, struct tm const *b)
{
#ifdef TM_GMTOFF
return a->TM_GMTOFF;
#else
+ struct tm tm;
+ if (t)
+ b = my_gmtime_r(t, &tm);
if (! b)
return LONG_MIN;
else {
@@ -909,7 +962,7 @@ show(timezone_t tz, char *zone, time_t t, bool v)
if (*abbr(tmp) != '\0')
printf(" %s", abbr(tmp));
if (v) {
- long off = gmtoff(tmp, gmtmp);
+ long off = gmtoff(tmp, NULL, gmtmp);
printf(" isdst=%d", tmp->tm_isdst);
if (off != LONG_MIN)
printf(" gmtoff=%ld", off);
@@ -920,6 +973,204 @@ show(timezone_t tz, char *zone, time_t t, bool v)
abbrok(abbr(tmp), zone);
}
+/* Store into BUF, of size SIZE, a formatted local time taken from *TM.
+ Use ISO 8601 format +HH:MM:SS. Omit :SS if SS is zero, and omit
+ :MM too if MM is also zero.
+
+ Return the length of the resulting string. If the string does not
+ fit, return the length that the string would have been if it had
+ fit; do not overrun the output buffer. */
+static int
+format_local_time(char *buf, size_t size, struct tm const *tm)
+{
+ int ss = tm->tm_sec, mm = tm->tm_min, hh = tm->tm_hour;
+ return (ss
+ ? snprintf(buf, size, "%02d:%02d:%02d", hh, mm, ss)
+ : mm
+ ? snprintf(buf, size, "%02d:%02d", hh, mm)
+ : snprintf(buf, size, "%02d", hh));
+}
+
+/* Store into BUF, of size SIZE, a formatted UTC offset for the
+ localtime *TM corresponding to time T. Use ISO 8601 format
+ +HH:MM:SS, or -HH:MM:SS for time stamps west of Greenwich. Omit
+ :SS if :SS is zero, and omit :MM too if :MM is also zero. If the
+ time stamp represents an unknown UTC offset, use the format -00.
+
+ Return the length of the resulting string, or -1 if the result is
+ not representable as a string. If the string does not fit, return
+ the length that the string would have been if it had fit; do not
+ overrun the output buffer. */
+static int
+format_utc_offset(char *buf, size_t size, struct tm const *tm, time_t t)
+{
+ long off = gmtoff(tm, &t, NULL);
+ char sign = ((off < 0
+ || (off == 0
+ && (*abbr(tm) == '-' || strcmp(abbr(tm), "zzz") == 0)))
+ ? '-' : '+');
+ long hh;
+ int mm, ss;
+ if (off < 0)
+ {
+ if (off == LONG_MIN)
+ return -1;
+ off = -off;
+ }
+ ss = off % 60;
+ mm = off / 60 % 60;
+ hh = off / 60 / 60;
+ return (ss
+ ? snprintf(buf, size, "%c%02ld:%02d:%02d", sign, hh, mm, ss)
+ : mm
+ ? snprintf(buf, size, "%c%02ld:%02d", sign, hh, mm)
+ : snprintf(buf, size, "%c%02ld", sign, hh));
+}
+
+/* Store into BUF (of size SIZE) a quoted string representation of P.
+ If the representation's length is less than SIZE, return the
+ length; the representation is not null terminated. Otherwise
+ return SIZE, to indicate that BUF is too small. */
+static size_t
+format_quoted_string(char *buf, size_t size, char const *p)
+{
+ char *b = buf;
+ size_t s = size;
+ if (!s)
+ return size;
+ *b++ = '"', s--;
+ for (;;) {
+ char c = *p++;
+ if (s <= 1)
+ return size;
+ switch (c) {
+ default: *b++ = c, s--; continue;
+ case '\0': *b++ = '"', s--; return size - s;
+ case '"': case '\\': break;
+ case ' ': c = 's'; break;
+ case '\f': c = 'f'; break;
+ case '\n': c = 'n'; break;
+ case '\r': c = 'r'; break;
+ case '\t': c = 't'; break;
+ case '\v': c = 'v'; break;
+ }
+ *b++ = '\\', *b++ = c, s -= 2;
+ }
+}
+
+/* Store into BUF (of size SIZE) a time stamp formatted by TIME_FMT.
+ TM is the broken-down time, T the seconds count, AB the time zone
+ abbreviation, and ZONE_NAME the zone name. Return true if
+ successful, false if the output would require more than SIZE bytes.
+ TIME_FMT uses the same format that strftime uses, with these
+ additions:
+
+ %f zone name
+ %L local time as per format_local_time
+ %Q like "U\t%Z\tD" where U is the UTC offset as for format_utc_offset
+ and D is the isdst flag; except omit D if it is zero, omit %Z if
+ it equals U, quote and escape %Z if it contains nonalphabetics,
+ and omit any trailing tabs. */
+
+static bool
+istrftime(char *buf, size_t size, char const *time_fmt,
+ struct tm const *tm, time_t t, char const *ab, char const *zone_name)
+{
+ char *b = buf;
+ size_t s = size;
+ char const *f = time_fmt, *p;
+
+ for (p = f; ; p++)
+ if (*p == '%' && p[1] == '%')
+ p++;
+ else if (!*p
+ || (*p == '%'
+ && (p[1] == 'f' || p[1] == 'L' || p[1] == 'Q'))) {
+ size_t formatted_len;
+ size_t f_prefix_len = p - f;
+ size_t f_prefix_copy_size = p - f + 2;
+ char fbuf[100];
+ bool oversized = sizeof fbuf <= f_prefix_copy_size;
+ char *f_prefix_copy = oversized ? xmalloc(f_prefix_copy_size) : fbuf;
+ memcpy(f_prefix_copy, f, f_prefix_len);
+ strcpy(f_prefix_copy + f_prefix_len, "X");
+ formatted_len = strftime(b, s, f_prefix_copy, tm);
+ if (oversized)
+ free(f_prefix_copy);
+ if (formatted_len == 0)
+ return false;
+ formatted_len--;
+ b += formatted_len, s -= formatted_len;
+ if (!*p++)
+ break;
+ switch (*p) {
+ case 'f':
+ formatted_len = format_quoted_string(b, s, zone_name);
+ break;
+ case 'L':
+ formatted_len = format_local_time(b, s, tm);
+ break;
+ case 'Q':
+ {
+ bool show_abbr;
+ int offlen = format_utc_offset(b, s, tm, t);
+ if (! (0 <= offlen && offlen < s))
+ return false;
+ show_abbr = strcmp(b, ab) != 0;
+ b += offlen, s -= offlen;
+ if (show_abbr) {
+ char const *abp;
+ size_t len;
+ if (s <= 1)
+ return false;
+ *b++ = '\t', s--;
+ for (abp = ab; is_alpha(*abp); abp++)
+ continue;
+ len = (!*abp && *ab
+ ? snprintf(b, s, "%s", ab)
+ : format_quoted_string(b, s, ab));
+ if (s <= len)
+ return false;
+ b += len, s -= len;
+ }
+ formatted_len = (tm->tm_isdst
+ ? snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
+ : 0);
+ }
+ break;
+ }
+ if (! (0 <= formatted_len && formatted_len < s))
+ return false;
+ b += formatted_len, s -= formatted_len;
+ f = p + 1;
+ }
+ *b = '\0';
+ return true;
+}
+
+/* Show a time transition. */
+static void
+showtrans(char const *time_fmt, struct tm const *tm, time_t t, char const *ab,
+ char const *zone_name)
+{
+ if (!tm) {
+ printf(tformat(), t);
+ putchar('\n');
+ } else {
+ char stackbuf[1000];
+ size_t size = sizeof stackbuf;
+ char *buf = stackbuf;
+ char *bufalloc = NULL;
+ while (! istrftime(buf, size, time_fmt, tm, t, ab, zone_name)) {
+ size = sumsize(size, size);
+ free(bufalloc);
+ buf = bufalloc = xmalloc(size);
+ }
+ puts(buf);
+ free(bufalloc);
+ }
+}
+
static char const *
abbr(struct tm const *tmp)
{
diff --git a/zic.c b/zic.c
index 3eb65d3..2505c11 100644
--- a/zic.c
+++ b/zic.c
@@ -106,7 +106,9 @@ extern int optind;
# define link(from, to) (errno = ENOTSUP, -1)
#endif
#if ! HAVE_SYMLINK
+# define lstat(name, st) stat(name, st)
# define symlink(from, to) (errno = ENOTSUP, -1)
+# define S_ISLNK(m) 0
#endif
static void addtt(zic_t starttime, int type);
@@ -114,7 +116,7 @@ static int addtype(zic_t, char const *, bool, bool, bool);
static void leapadd(zic_t, bool, int, int);
static void adjleap(void);
static void associate(void);
-static void dolink(const char * fromfield, const char * tofield);
+static void dolink(const char *, const char *, bool);
static char ** getfields(char * buf);
static zic_t gethms(const char * string, const char * errstring,
bool);
@@ -128,7 +130,7 @@ static bool inzsub(char **, int, bool);
static int itsdir(const char * name);
static bool is_alpha(char a);
static char lowerit(char);
-static bool mkdirs(char *);
+static void mkdirs(char const *, bool);
static void newabbr(const char * abbr);
static zic_t oadd(zic_t t1, zic_t t2);
static void outzone(const struct zone * zp, int ntzones);
@@ -144,7 +146,7 @@ static bool yearistype(int year, const char * type);
enum { PERCENT_Z_LEN_BOUND = sizeof "+995959" - 1 };
/* If true, work around a bug in Qt 5.6.1 and earlier, which mishandles
- tzdata binary files whose POSIX-TZ-style strings contain '<'; see
+ tz binary files whose POSIX-TZ-style strings contain '<'; see
QTBUG-53071 . This
workaround will no longer be needed when Qt 5.6.1 and earlier are
obsolete, say in the year 2021. */
@@ -355,6 +357,7 @@ static const int len_years[2] = {
static struct attype {
zic_t at;
+ bool dontmerge;
unsigned char type;
} * attypes;
static zic_t gmtoffs[TZ_MAX_TYPES];
@@ -495,15 +498,15 @@ warning(const char *const string, ...)
}
static void
-close_file(FILE *stream, char const *name)
+close_file(FILE *stream, char const *dir, char const *name)
{
char const *e = (ferror(stream) ? _("I/O error")
: fclose(stream) != 0 ? strerror(errno) : NULL);
if (e) {
- fprintf(stderr, "%s: ", progname);
- if (name)
- fprintf(stderr, "%s: ", name);
- fprintf(stderr, "%s\n", e);
+ fprintf(stderr, "%s: %s%s%s%s%s\n", progname,
+ dir ? dir : "", dir ? "/" : "",
+ name ? name : "", name ? ": " : "",
+ e);
exit(EXIT_FAILURE);
}
}
@@ -518,10 +521,30 @@ usage(FILE *stream, int status)
"Report bugs to %s.\n"),
progname, progname, REPORT_BUGS_TO);
if (status == EXIT_SUCCESS)
- close_file(stream, NULL);
+ close_file(stream, NULL, NULL);
exit(status);
}
+/* Change the working directory to DIR, possibly creating DIR and its
+ ancestors. After this is done, all files are accessed with names
+ relative to DIR. */
+static void
+change_directory (char const *dir)
+{
+ if (chdir(dir) != 0) {
+ int chdir_errno = errno;
+ if (chdir_errno == ENOENT) {
+ mkdirs(dir, false);
+ chdir_errno = chdir(dir) == 0 ? 0 : errno;
+ }
+ if (chdir_errno != 0) {
+ fprintf(stderr, _("%s: Can't chdir to %s: %s\n"),
+ progname, dir, strerror(chdir_errno));
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
static const char * psxrules;
static const char * lcltime;
static const char * directory;
@@ -554,7 +577,7 @@ main(int argc, char **argv)
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
printf("zic %s%s\n", PKGVERSION, TZVERSION);
- close_file(stdout, NULL);
+ close_file(stdout, NULL, NULL);
return EXIT_SUCCESS;
} else if (strcmp(argv[i], "--help") == 0) {
usage(stdout, EXIT_SUCCESS);
@@ -637,6 +660,7 @@ _("%s: More than one -L option specified\n"),
if (errors)
return EXIT_FAILURE;
associate();
+ change_directory(directory);
for (i = 0; i < nzones; i = j) {
/*
** Find the next non-continuation zone entry.
@@ -650,7 +674,7 @@ _("%s: More than one -L option specified\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);
+ dolink(links[i].l_from, links[i].l_to, false);
if (noise)
for (j = 0; j < nlinks; ++j)
if (strcmp(links[i].l_to,
@@ -659,11 +683,11 @@ _("%s: More than one -L option specified\n"),
}
if (lcltime != NULL) {
eat(_("command line"), 1);
- dolink(lcltime, TZDEFAULT);
+ dolink(lcltime, TZDEFAULT, true);
}
if (psxrules != NULL) {
eat(_("command line"), 1);
- dolink(psxrules, TZDEFRULES);
+ dolink(psxrules, TZDEFRULES, true);
}
if (warnings && (ferror(stderr) || fclose(stderr) != 0))
return EXIT_FAILURE;
@@ -740,112 +764,99 @@ namecheck(const char *name)
return componentcheck(name, component, cp);
}
-static char *
-relname(char const *dir, char const *base)
-{
- if (*base == '/')
- return ecpyalloc(base);
- else {
- size_t dir_len = strlen(dir);
- bool needs_slash = dir_len && dir[dir_len - 1] != '/';
- char *result = emalloc(dir_len + needs_slash + strlen(base) + 1);
- result[dir_len] = '/';
- strcpy(result + dir_len + needs_slash, base);
- return memcpy(result, dir, dir_len);
- }
-}
-
static void
-dolink(char const *fromfield, char const *tofield)
+dolink(char const *fromfield, char const *tofield, bool staysymlink)
{
- register char * fromname;
- register char * toname;
register int fromisdir;
+ bool todirs_made = false;
+ int link_errno;
- fromname = relname(directory, fromfield);
- toname = relname(directory, tofield);
/*
** We get to be careful here since
** there's a fair chance of root running us.
*/
- fromisdir = itsdir(fromname);
+ fromisdir = itsdir(fromfield);
if (fromisdir) {
char const *e = strerror(fromisdir < 0 ? errno : EPERM);
- fprintf(stderr, _("%s: link from %s failed: %s"),
- progname, fromname, e);
+ fprintf(stderr, _("%s: link from %s/%s failed: %s\n"),
+ progname, directory, fromfield, e);
exit(EXIT_FAILURE);
}
- if (link(fromname, toname) != 0) {
- int link_errno = errno;
- bool retry_if_link_supported = false;
-
- if (link_errno == ENOENT || link_errno == ENOTSUP) {
- if (! mkdirs(toname))
- exit(EXIT_FAILURE);
- retry_if_link_supported = true;
+ if (staysymlink)
+ staysymlink = itsdir(tofield) == 2;
+ if (remove(tofield) == 0)
+ todirs_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);
+ exit(EXIT_FAILURE);
+ }
+ link_errno = (staysymlink ? ENOTSUP
+ : link(fromfield, tofield) == 0 ? 0 : errno);
+ if (link_errno == ENOENT && !todirs_made) {
+ mkdirs(tofield, true);
+ todirs_made = true;
+ link_errno = link(fromfield, tofield) == 0 ? 0 : errno;
+ }
+ if (link_errno != 0) {
+ const char *s = fromfield;
+ const char *t;
+ char *p;
+ size_t dotdots = 0;
+ char *symlinkcontents;
+ int symlink_errno;
+
+ do
+ t = s;
+ while ((s = strchr(s, '/'))
+ && strncmp(fromfield, tofield, ++s - fromfield) == 0);
+
+ for (s = tofield + (t - fromfield); *s; s++)
+ dotdots += *s == '/';
+ symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1);
+ for (p = symlinkcontents; dotdots-- != 0; p += 3)
+ memcpy(p, "../", 3);
+ strcpy(p, t);
+ symlink_errno = symlink(symlinkcontents, tofield) == 0 ? 0 : errno;
+ if (symlink_errno == ENOENT && !todirs_made) {
+ mkdirs(tofield, true);
+ symlink_errno = symlink(symlinkcontents, tofield) == 0 ? 0 : errno;
}
- if ((link_errno == EEXIST || link_errno == ENOTSUP)
- && itsdir(toname) == 0
- && (remove(toname) == 0 || errno == ENOENT))
- retry_if_link_supported = true;
- if (retry_if_link_supported && link_errno != ENOTSUP)
- link_errno = link(fromname, toname) == 0 ? 0 : errno;
- if (link_errno != 0) {
- const char *s = fromfield;
- const char *t;
- char *p;
- size_t dotdots = 0;
- char *symlinkcontents;
- int symlink_result;
-
- do
- t = s;
- while ((s = strchr(s, '/'))
- && strncmp(fromfield, tofield, ++s - fromfield) == 0);
-
- for (s = tofield + (t - fromfield); *s; s++)
- dotdots += *s == '/';
- symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1);
- for (p = symlinkcontents; dotdots-- != 0; p += 3)
- memcpy(p, "../", 3);
- strcpy(p, t);
- symlink_result = symlink(symlinkcontents, toname);
- free(symlinkcontents);
- if (symlink_result == 0) {
- if (link_errno != ENOTSUP)
- warning(_("symbolic link used because hard link failed: %s"),
- strerror (link_errno));
- } else {
- FILE *fp, *tp;
- int c;
- fp = fopen(fromname, "rb");
- if (!fp) {
- const char *e = strerror(errno);
- fprintf(stderr,
- _("%s: Can't read %s: %s\n"),
- progname, fromname, e);
- exit(EXIT_FAILURE);
- }
- tp = fopen(toname, "wb");
- if (!tp) {
- const char *e = strerror(errno);
- fprintf(stderr,
- _("%s: Can't create %s: %s\n"),
- progname, toname, e);
- exit(EXIT_FAILURE);
- }
- while ((c = getc(fp)) != EOF)
- putc(c, tp);
- close_file(fp, fromname);
- close_file(tp, toname);
- if (link_errno != ENOTSUP)
- warning(_("copy used because hard link failed: %s"),
- strerror (link_errno));
+ free(symlinkcontents);
+ if (symlink_errno == 0) {
+ if (link_errno != ENOTSUP)
+ warning(_("symbolic link used because hard link failed: %s"),
+ strerror(link_errno));
+ } else {
+ FILE *fp, *tp;
+ int c;
+ fp = fopen(fromfield, "rb");
+ if (!fp) {
+ char const *e = strerror(errno);
+ fprintf(stderr, _("%s: Can't read %s/%s: %s\n"),
+ progname, directory, fromfield, e);
+ exit(EXIT_FAILURE);
}
+ tp = fopen(tofield, "wb");
+ if (!tp) {
+ char const *e = strerror(errno);
+ fprintf(stderr, _("%s: Can't create %s/%s: %s\n"),
+ progname, directory, tofield, e);
+ exit(EXIT_FAILURE);
+ }
+ while ((c = getc(fp)) != EOF)
+ putc(c, tp);
+ close_file(fp, directory, fromfield);
+ close_file(tp, directory, tofield);
+ if (link_errno != ENOTSUP)
+ warning(_("copy used because hard link failed: %s"),
+ strerror(link_errno));
+ else if (symlink_errno != ENOTSUP)
+ warning(_("copy used because symbolic link failed: %s"),
+ strerror(symlink_errno));
}
}
- free(fromname);
- free(toname);
}
#define TIME_T_BITS_IN_FILE 64
@@ -891,21 +902,26 @@ static const zic_t early_time = (WORK_AROUND_GNOME_BUG_730332
? BIG_BANG
: MINVAL(zic_t, TIME_T_BITS_IN_FILE));
-/* Return 1 if NAME is a directory, 0 if it's something else, -1 if trouble. */
+/* Return 1 if NAME is a directory, 2 if a symbolic link, 0 if
+ something else, -1 (setting errno) if trouble. */
static int
itsdir(char const *name)
{
struct stat st;
- int res = stat(name, &st);
+ int res = lstat(name, &st);
+ if (res == 0) {
#ifdef S_ISDIR
- if (res == 0)
- return S_ISDIR(st.st_mode) != 0;
-#endif
- if (res == 0 || errno == EOVERFLOW) {
- char *nameslashdot = relname(name, ".");
- bool dir = stat(nameslashdot, &st) == 0 || errno == EOVERFLOW;
+ return S_ISDIR(st.st_mode) ? 1 : S_ISLNK(st.st_mode) ? 2 : 0;
+#else
+ size_t n = strlen(name);
+ char *nameslashdot = emalloc(n + 3);
+ bool dir;
+ memcpy(nameslashdot, name, n);
+ strcpy(&nameslashdot[n], &"/."[! (n && name[n - 1] != '/')]);
+ dir = lstat(nameslashdot, &st) == 0;
free(nameslashdot);
return dir;
+#endif
}
return -1;
}
@@ -1079,7 +1095,7 @@ _("%s: panic: Invalid l_value %d\n"),
}
free(fields);
}
- close_file(fp, filename);
+ close_file(fp, NULL, filename);
if (wantcont)
error(_("expected continuation line not found"));
}
@@ -1629,9 +1645,9 @@ writezone(const char *const name, const char *const string, char version)
register int leapcnt32, leapi32;
register int timecnt32, timei32;
register int pass;
- char * fullname;
static const struct tzhead tzh0;
static struct tzhead tzh;
+ bool dir_checked = false;
zic_t one = 1;
zic_t y2038_boundary = one << 31;
int nats = timecnt + WORK_AROUND_QTBUG_53071;
@@ -1664,8 +1680,9 @@ writezone(const char *const name, const char *const string, char version)
attypes[fromi].type;
continue;
}
- if (toi == 0 ||
- attypes[toi - 1].type != attypes[fromi].type)
+ if (toi == 0
+ || attypes[fromi].dontmerge
+ || attypes[toi - 1].type != attypes[fromi].type)
attypes[toi++] = attypes[fromi];
}
timecnt = toi;
@@ -1730,27 +1747,31 @@ writezone(const char *const name, const char *const string, char version)
--leapcnt32;
++leapi32;
}
- fullname = relname(directory, name);
/*
** Remove old file, if any, to snap links.
*/
- if (itsdir(fullname) == 0 && remove(fullname) != 0 && errno != ENOENT) {
+ if (remove(name) == 0)
+ dir_checked = true;
+ else if (errno != ENOENT) {
const char *e = strerror(errno);
- fprintf(stderr, _("%s: Can't remove %s: %s\n"),
- progname, fullname, e);
+ fprintf(stderr, _("%s: Can't remove %s/%s: %s\n"),
+ progname, directory, name, e);
exit(EXIT_FAILURE);
}
- if ((fp = fopen(fullname, "wb")) == NULL) {
- if (! mkdirs(fullname))
- exit(EXIT_FAILURE);
- if ((fp = fopen(fullname, "wb")) == NULL) {
- const char *e = strerror(errno);
-
- fprintf(stderr, _("%s: Can't create %s: %s\n"),
- progname, fullname, e);
- exit(EXIT_FAILURE);
- }
+ fp = fopen(name, "wb");
+ if (!fp) {
+ int fopen_errno = errno;
+ if (fopen_errno == ENOENT && !dir_checked) {
+ mkdirs(name, true);
+ fp = fopen(name, "wb");
+ fopen_errno = errno;
+ }
+ if (!fp) {
+ fprintf(stderr, _("%s: Can't create %s/%s: %s\n"),
+ progname, directory, name, strerror(fopen_errno));
+ exit(EXIT_FAILURE);
+ }
}
for (pass = 1; pass <= 2; ++pass) {
register int thistimei, thistimecnt;
@@ -1943,9 +1964,8 @@ writezone(const char *const name, const char *const string, char version)
putc(ttisgmts[i], fp);
}
fprintf(fp, "\n%s\n", string);
- close_file(fp, fullname);
+ close_file(fp, directory, name);
free(ats);
- free(fullname);
}
static char const *
@@ -2288,6 +2308,7 @@ outzone(const struct zone *zpfirst, int zonecount)
register int compat;
register bool do_extend;
register char version;
+ int lastatmax = -1;
max_abbr_len = 2 + max_format_len + max_abbrvar_len;
max_envvar_len = 2 * max_abbr_len + 5 * 9;
@@ -2520,6 +2541,10 @@ outzone(const struct zone *zpfirst, int zonecount)
offset = oadd(zp->z_gmtoff, rp->r_stdoff);
type = addtype(offset, ab, rp->r_stdoff != 0,
rp->r_todisstd, rp->r_todisgmt);
+ if (rp->r_hiyear == ZIC_MAX
+ && ! (0 <= lastatmax
+ && ktime < attypes[lastatmax].at))
+ lastatmax = timecnt;
addtt(ktime, type);
}
}
@@ -2551,6 +2576,8 @@ error(_("can't determine time zone abbreviation to use just after until time"));
starttime = tadd(starttime, -gmtoff);
}
}
+ if (0 <= lastatmax)
+ attypes[lastatmax].dontmerge = true;
if (do_extend) {
/*
** If we're extending the explicitly listed observations
@@ -2572,21 +2599,8 @@ error(_("can't determine time zone abbreviation to use just after until time"));
if (attypes[i].at > lastat->at)
lastat = &attypes[i];
if (lastat->at < rpytime(&xr, max_year - 1)) {
- /*
- ** Create new type code for the redundant entry,
- ** to prevent it being optimized away.
- */
- if (typecnt >= TZ_MAX_TYPES) {
- error(_("too many local time types"));
- exit(EXIT_FAILURE);
- }
- gmtoffs[typecnt] = gmtoffs[lastat->type];
- isdsts[typecnt] = isdsts[lastat->type];
- ttisstds[typecnt] = ttisstds[lastat->type];
- ttisgmts[typecnt] = ttisgmts[lastat->type];
- abbrinds[typecnt] = abbrinds[lastat->type];
- ++typecnt;
addtt(rpytime(&xr, max_year + 1), typecnt-1);
+ attypes[timecnt - 1].dontmerge = true;
}
}
writezone(zpfirst->z_name, envvar, version);
@@ -2614,6 +2628,7 @@ addtt(zic_t starttime, int type)
}
attypes = growalloc(attypes, sizeof *attypes, timecnt, &timecnt_alloc);
attypes[timecnt].at = starttime;
+ attypes[timecnt].dontmerge = false;
attypes[timecnt].type = type;
++timecnt;
}
@@ -3021,44 +3036,45 @@ mp = _("time zone abbreviation differs from POSIX standard");
charcnt += i;
}
-static bool
-mkdirs(char *argname)
+/* Ensure that the directories of ARGNAME exist, by making any missing
+ ones. If ANCESTORS, do this only for ARGNAME's ancestors; otherwise,
+ do it for ARGNAME too. Exit with failure if there is trouble. */
+static void
+mkdirs(char const *argname, bool ancestors)
{
register char * name;
register char * cp;
- if (argname == NULL || *argname == '\0')
- return true;
cp = name = ecpyalloc(argname);
- while ((cp = strchr(cp + 1, '/')) != 0) {
- *cp = '\0';
+
+ /* Do not mkdir a root directory, as it must exist. */
#ifdef HAVE_DOS_FILE_NAMES
- /*
- ** DOS drive specifier?
- */
- if (is_alpha(name[0]) && name[1] == ':' && name[2] == '\0') {
- *cp = '/';
- continue;
- }
+ if (is_alpha(name[0]) && name[1] == ':')
+ cp += 2;
#endif
+ while (*cp == '/')
+ cp++;
+
+ while (cp && ((cp = strchr(cp, '/')) || !ancestors)) {
+ if (cp)
+ *cp = '\0';
/*
** Try to create it. It's OK if creation fails because
** the directory already exists, perhaps because some
- ** other process just created it.
+ ** other process just created it. For simplicity do
+ ** not check first whether it already exists, as that
+ ** is checked anyway if the mkdir fails.
*/
if (mkdir(name, MKDIR_UMASK) != 0) {
int err = errno;
- if (itsdir(name) <= 0) {
- char const *e = strerror(err);
- warning(_("%s: Can't create directory"
- " %s: %s"),
- progname, name, e);
- free(name);
- return false;
+ if (err != EEXIST && itsdir(name) < 0) {
+ error(_("%s: Can't create directory %s: %s"),
+ progname, name, strerror(err));
+ exit(EXIT_FAILURE);
}
}
- *cp = '/';
+ if (cp)
+ *cp++ = '/';
}
free(name);
- return true;
}
diff --git a/zone.tab b/zone.tab
index bf1bb71..cf774b5 100644
--- a/zone.tab
+++ b/zone.tab
@@ -261,7 +261,7 @@ MH +0709+17112 Pacific/Majuro Marshall Islands (most areas)
MH +0905+16720 Pacific/Kwajalein Kwajalein
MK +4159+02126 Europe/Skopje
ML +1239-00800 Africa/Bamako
-MM +1647+09610 Asia/Rangoon
+MM +1647+09610 Asia/Yangon
MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas)
MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar
diff --git a/zone1970.tab b/zone1970.tab
index 49f0b0b..b7372cf 100644
--- a/zone1970.tab
+++ b/zone1970.tab
@@ -224,7 +224,7 @@ MC +4342+00723 Europe/Monaco
MD +4700+02850 Europe/Chisinau
MH +0709+17112 Pacific/Majuro Marshall Islands (most areas)
MH +0905+16720 Pacific/Kwajalein Kwajalein
-MM +1647+09610 Asia/Rangoon
+MM +1647+09610 Asia/Yangon
MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas)
MN +4801+09139 Asia/Hovd Bayan-Ãlgii, Govi-Altai, Hovd, Uvs, Zavkhan
MN +4804+11430 Asia/Choibalsan Dornod, Sükhbaatar