Imported Upstream version 2018f 56/191556/1 upstream/2018f
authorHyunjee Kim <hj0426.kim@samsung.com>
Thu, 18 Oct 2018 08:33:21 +0000 (17:33 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Thu, 18 Oct 2018 08:33:43 +0000 (17:33 +0900)
Change-Id: Ice30f3e7202efd9574472fa4d3c345a6df5ab079
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
55 files changed:
CONTRIBUTING
Makefile
NEWS
README
africa
antarctica
asia
australasia
backward
backzone
date.1
date.1.txt
difftime.c
etcetera
europe
factory
leap-seconds.list
leapseconds
leapseconds.awk
localtime.c
newctime.3
newctime.3.txt
newstrftime.3
newstrftime.3.txt
newtzset.3
newtzset.3.txt
northamerica
pacificnew
private.h
southamerica
strftime.c
systemv
theory.html
tz-art.html
tz-how-to.html
tz-link.html
tzfile.5
tzfile.5.txt
tzfile.h
tzselect.8
tzselect.8.txt
tzselect.ksh
version
workman.sh
yearistype.sh
zdump.8
zdump.8.txt
zdump.c
zic.8
zic.8.txt
zic.c
zishrink.awk
zone.tab
zone1970.tab
zoneinfo2tdf.pl [changed mode: 0644->0755]

index 0cfc77f..01336fc 100644 (file)
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell command like
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the theory.html file and browse
-the mailing list archives <https://mm.icann.org/pipermail/tz/> for
-examples of patches that tend to work well.  Additions to
-data should contain commentary citing reliable sources as
-justification.  Citations should use https: URLs if available.
+For more-elaborate or possibly-controversial changes,
+such as renaming, adding or removing zones, please read
+<https://www.iana.org/time-zones/repository/theory.html> or the file
+theory.html.  It is also good to browse the mailing list archives
+<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
+to work well.  Additions to data should contain commentary citing
+reliable sources as justification.  Citations should use https: URLs
+if available.
 
 Please submit changes against either the latest release in
 <https://www.iana.org/time-zones> or the master branch of the development
index 21fa488..d56a198 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+# Make and install tzdb code and data.
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -19,9 +21,9 @@ BUGEMAIL=     tz@iana.org
 #      DATAFORM=       rearguard
 DATAFORM=              main
 
-# Change the line below for your time zone (after finding the zone you want in
-# the time zone files, or adding it to a time zone file).
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Change the line below for your timezone (after finding the one you want in
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #      zic -l rightzone
 # to correct things.
 # Use the command
@@ -31,14 +33,14 @@ DATAFORM=           main
 LOCALTIME=     GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style time zone environment variables,
-# change the line below (after finding the zone you want in the
-# time zone files, or adding it to a time zone file).
+# for handling POSIX-style timezone environment variables,
+# change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
 # When a POSIX-style environment variable is handled, the rules in the
 # template file are used to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #      zic -p rightzone
 # to correct things.
 # Use the command
@@ -75,7 +77,7 @@ DESTDIR =
 # TOPDIR should be empty or an absolute name unless you're just testing.
 TOPDIR =
 
-# The default local time zone is taken from the file TZDEFAULT.
+# The default local timezone is taken from the file TZDEFAULT.
 TZDEFAULT = $(TOPDIR)/etc/localtime
 
 # The subdirectory containing installed program and data files, and
@@ -84,7 +86,7 @@ TZDEFAULT = $(TOPDIR)/etc/localtime
 USRDIR = usr
 USRSHAREDIR = $(USRDIR)/share
 
-# "Compiled" time zone information is placed in the "TZDIR" directory
+# "Compiled" timezone information is placed in the "TZDIR" directory
 # (and subdirectories).
 # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
 TZDIR_BASENAME=        zoneinfo
@@ -106,9 +108,13 @@ MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
 LIBDIR = $(TOPDIR)/$(USRDIR)/lib
 
 
-# Types to try, as an alternative to time_t.  int64_t should be first.
-TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
+# Types to try, as an alternative to time_t.
+TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
+TIME_T_ALTERNATIVES_HEAD = int64_t
+TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
 
+# What kind of TZif data files to generate.
+# (TZif is the binary time zone data format that zic generates.)
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #      REDO=           posix_only
@@ -129,7 +135,7 @@ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
 
 REDO=          posix_right
 
-# To install data in text form that has all the information of the binary data,
+# To install data in text form that has all the information of the TZif data,
 # (optionally incorporating leap second information), use
 #      TZDATA_TEXT=    tzdata.zi leapseconds
 # To install text data without leap second information (e.g., because
@@ -171,7 +177,6 @@ LDLIBS=
 
 # Add the following to the end of the "CFLAGS=" line as needed to override
 # defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
-#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
 #  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
 #      formats that generate only the last two digits of year numbers
 #  -DEPOCH_LOCAL if the 'time' function returns local time not UT
@@ -295,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
 # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
 # "posix2time", and "time2posix" to be added to the time conversion library.
 # "tzsetwall" is like "tzset" except that it arranges for local wall clock
-# time (rather than the time specified in the TZ environment variable)
+# time (rather than the timezone specified in the TZ environment variable)
 # to be used.
 # "offtime" is like "gmtime" except that it accepts a second (long) argument
 # that gives an offset to add to the time_t when converting it.
@@ -318,7 +323,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
 # "posix2time_z" and "time2posix_z" are added as well.
 # The functions ending in "_z" (or "_rz") are like their unsuffixed
 # (or suffixed-by-"_r") counterparts, except with an extra first
-# argument of opaque type timezone_t that specifies the time zone.
+# argument of opaque type timezone_t that specifies the timezone.
 # "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
 #
 # If you want to allocate state structures in localtime, add
@@ -357,11 +362,14 @@ ZIC=              $(zic) $(ZFLAGS)
 
 ZFLAGS=
 
-# How to use zic to install tz binary files.
+# How to use zic to install TZif files.
 
 ZIC_INSTALL=   $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
 
 # The name of a Posix-compliant 'awk' on your system.
+# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core;
+# on Ubuntu you can work around this with
+#      AWK=            gawk
 AWK=           awk
 
 # The full path name of a Posix-compliant shell, preferably one that supports
@@ -410,10 +418,16 @@ SAFE_CHARSET3=    'abcdefghijklmnopqrstuvwxyz{|}~'
 SAFE_CHARSET=  $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
 SAFE_CHAR=     '[]'$(SAFE_CHARSET)'-]'
 
+# These characters are Latin-1, and so are likely to be displayable
+# even in editors with limited character sets.
+UNUSUAL_OK_LATIN_1 = «°±»½¾×
+# This IPA symbol is represented in Unicode as the composition of
+# U+0075 and U+032F, and U+032F is not considered alphabetic by some
+# grep implementations that do not grok composition.
+UNUSUAL_OK_IPA = u̯
 # Non-ASCII non-letters that OK_CHAR allows, as these characters are
-# useful in commentary.  XEmacs 21.5.34 displays them correctly,
-# presumably because they are Latin-1.
-UNUSUAL_OK_CHARSET= °±½¾×
+# useful in commentary.
+UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
 
 # OK_CHAR matches any character allowed in the distributed files.
 # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
@@ -492,11 +506,14 @@ AWK_SCRIPTS=      checklinks.awk checktab.awk leapseconds.awk \
                        ziguard.awk zishrink.awk
 MISC=          $(AWK_SCRIPTS) zoneinfo2tdf.pl
 TZS_YEAR=      2050
+TZS_CUTOFF_FLAG=       -c $(TZS_YEAR)
 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) tzdata.zi
+# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
+EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
+ENCHILADA = $(EIGHT_YARDS) $(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
@@ -560,14 +577,21 @@ version:  $(VERSION_DEPS)
                printf '%s\n' "$$V" >$@.out
                mv $@.out $@
 
-# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
+# These files can be tailored by setting BACKWARD and PACKRATDATA.
 vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
                $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
                  $(TDATA) $(PACKRATDATA) >$@.out
                mv $@.out $@
-tzdata.zi:     $(DATAFORM).zi version
+# This file has a version comment that attempts to capture any tailoring
+# via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
+tzdata.zi:     $(DATAFORM).zi version zishrink.awk
                version=`sed 1q version` && \
-                 LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
+                 LC_ALL=C $(AWK) \
+                   -v dataform='$(DATAFORM)' \
+                   -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
+                   -v redo='$(REDO)' \
+                   -v version="$$version" \
+                   -f zishrink.awk \
                    $(DATAFORM).zi >$@.out
                mv $@.out $@
 
@@ -605,14 +629,16 @@ INSTALLARGS = \
  YEARISTYPE='$(YEARISTYPE)' \
  ZIC='$(ZIC)'
 
-# 'make install_data' installs one set of tz binary files.
-install_data:  zic leapseconds yearistype tzdata.zi
+INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
+
+# 'make install_data' installs one set of TZif files.
+install_data: $(INSTALL_DATA_DEPS)
                $(ZIC_INSTALL) tzdata.zi
 
-posix_only:
+posix_only: $(INSTALL_DATA_DEPS)
                $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
 
-right_only:
+right_only: $(INSTALL_DATA_DEPS)
                $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
                        install_data
 
@@ -639,7 +665,7 @@ posix_right:        posix_only
 
 # This obsolescent rule is present for backwards compatibility with
 # tz releases 2014g through 2015g.  It should go away eventually.
-posix_packrat:
+posix_packrat: $(INSTALL_DATA_DEPS)
                $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
 
 zones:         $(REDO)
@@ -650,29 +676,33 @@ ZDS = dummy.zd
 # Rule used only by submakes invoked by the $(TZS_NEW) rule.
 # It is separate so that GNU 'make -j' can run instances in parallel.
 $(ZDS): zdump
-               ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@
-
-$(TZS_NEW):    tzdata.zi zdump zic
-               rm -fr tzs.dir
-               mkdir tzs.dir
-               $(zic) -d tzs.dir tzdata.zi
+               ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
+                 >$@
+
+TZS_NEW_DEPS = tzdata.zi zdump zic
+$(TZS_NEW): $(TZS_NEW_DEPS)
+               rm -fr tzs$(TZS_YEAR).dir
+               mkdir tzs$(TZS_YEAR).dir
+               $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
                $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
                   tzdata.zi | LC_ALL=C sort >$@.out
                wd=`pwd` && \
-               set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
+               x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
+                               tzdata.zi \
                        | LC_ALL=C sort -t . -k 2,2` && \
+               set x $$x && \
                shift && \
                ZDS=$$* && \
-               $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
-               sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out
-               rm -fr tzs.dir
+               $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
+                 ZDS="$$ZDS" $$ZDS && \
+               sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
+               rm -fr tzs$(TZS_YEAR).dir
                mv $@.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
+# If $(TZS) 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
+               touch $@
 
 force_tzs:     $(TZS_NEW)
                cp $(TZS_NEW) $(TZS)
@@ -711,18 +741,21 @@ check_character_set: $(ENCHILADA)
                        $(MISC) $(SOURCES) $(WEB_PAGES) \
                        CONTRIBUTING LICENSE README \
                        version tzdata.zi && \
-               ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
+               ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
                        Makefile && \
                ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
                        leapseconds yearistype.sh zone.tab && \
                ! grep -Env $(OK_LINE) $(ENCHILADA); \
        }
+       touch $@
 
 check_white_space: $(ENCHILADA)
                patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
-               ! grep -En "$$pat" $(ENCHILADA)
+               ! grep -En "$$pat" \
+                       $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
                ! grep -n '[[:space:]]$$' \
                        $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
+               touch $@
 
 PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
 FILE_NAME_COMPONENT_TOO_LONG = \
@@ -731,6 +764,7 @@ FILE_NAME_COMPONENT_TOO_LONG = \
 check_name_lengths: $(TDATA_TO_CHECK) backzone
                ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
                        $(TDATA_TO_CHECK) backzone
+               touch $@
 
 CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
 
@@ -743,52 +777,61 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
                  LC_ALL=C sort -c
                $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
                  LC_ALL=C sort -cu
+               touch $@
 
 check_links:   checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
                $(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
                $(AWK) -f checklinks.awk tzdata.zi
+               touch $@
 
 check_tables:  checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
                for tab in $(ZONETABLES); do \
                  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
                    || exit; \
                done
+               touch $@
 
 check_tzs:     $(TZS) $(TZS_NEW)
-               diff -u $(TZS) $(TZS_NEW)
+               if test -s $(TZS); then \
+                 diff -u $(TZS) $(TZS_NEW); \
+               else \
+                 cp $(TZS_NEW) $(TZS); \
+               fi
+               touch $@
 
 # This checks only the HTML 4.01 strict page.
 # To check the the other pages, use <https://validator.w3.org/>.
 check_web:     tz-how-to.html
                $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
+               touch $@
 
 # Check that zishrink.awk does not alter the data, and that ziguard.awk
 # preserves main-format data.
-check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
-                 $(DATAFORM).zi tzdata.zi
-               for type in posix right; do \
-                 mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
-                   time_t.dir/$$type-shrunk && \
-                 case $$type in \
-                   right) leap='-L leapseconds';; \
-                   *) leap=;; \
-                 esac && \
-                 $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
+check_zishrink: check_zishrink_posix check_zishrink_right
+check_zishrink_posix check_zishrink_right: \
+  zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
+               rm -fr $@.dir $@-t.dir $@-shrunk.dir
+               mkdir $@.dir $@-t.dir $@-shrunk.dir
+               case $@ in \
+                 *_right) leap='-L leapseconds';; \
+                 *) leap=;; \
+               esac && \
+                 $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
+                 $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
                  case $(DATAFORM) in \
                    main) \
-                     $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
+                     $(ZIC) $$leap -d $@-t.dir $(TDATA) && \
                      $(AWK) '/^Rule/' $(TDATA) | \
-                       $(ZIC) $$leap -d time_t.dir/$$type-t - \
-                         $(PACKRATDATA) && \
-                     diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
-                 esac && \
-                 $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
-                 diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
-               done
-               rm -fr time_t.dir
+                       $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
+                     diff -r $@.dir $@-t.dir;; \
+                 esac
+               diff -r $@.dir $@-shrunk.dir
+               rm -fr $@.dir $@-t.dir $@-shrunk.dir
+               touch $@
 
 clean_misc:
-               rm -f core *.o *.out \
+               rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
+                 check_* core typecheck_* \
                  date tzselect version.h zdump zic yearistype libtz.a
 clean:         clean_misc
                rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
@@ -818,17 +861,17 @@ $(MANTXTS):       workman.sh
                LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
                mv $@.out $@
 
-# Set the time stamps to those of the git repository, if available,
+# Set the timestamps to those of the git repository, if available,
 # and if the files have not changed since then.
 # This uses GNU 'touch' syntax 'touch -d@N FILE',
 # where N is the number of seconds since 1970.
 # If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
 # Also, set the timestamp of each prebuilt file like 'leapseconds'
 # to be the maximum of the files it depends on.
-set-timestamps.out: $(ENCHILADA)
+set-timestamps.out: $(EIGHT_YARDS)
                rm -f $@
                if (type git) >/dev/null 2>&1 && \
-                  files=`git ls-files $(ENCHILADA)` && \
+                  files=`git ls-files $(EIGHT_YARDS)` && \
                   touch -md @1 test.out; then \
                  rm -f test.out && \
                  for file in $$files; do \
@@ -846,83 +889,100 @@ set-timestamps.out: $(ENCHILADA)
                    exit; \
                done
                touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
-               touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
                touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
                touch $@
+set-tzs-timestamp.out: $(TZS)
+               touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
+               touch $@
 
 # The zics below ensure that each data file can stand on its own.
 # We also do an all-files run to catch links to links.
 
-check_public:
-               $(MAKE) maintainer-clean
-               $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
-               mkdir -p public.dir
-               for i in $(TDATA_TO_CHECK) tzdata.zi; do \
-                 $(zic) -v -d public.dir $$i 2>&1 || exit; \
+check_public: $(VERSION_DEPS)
+               rm -fr public.dir
+               mkdir public.dir
+               ln $(VERSION_DEPS) public.dir
+               cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
+               for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \
+                 public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
                done
-               $(zic) -v -d public.dir $(TDATA_TO_CHECK)
+               public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
                rm -fr public.dir
+               touch $@
 
 # Check that the code works under various alternative
 # implementations of time_t.
-check_time_t_alternatives:
-               if diff -q Makefile Makefile 2>/dev/null; then \
-                 quiet_option='-q'; \
-               else \
-                 quiet_option=''; \
-               fi && \
+check_time_t_alternatives: $(TIME_T_ALTERNATIVES)
+$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD)
+$(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
+               rm -fr $@.dir
+               mkdir $@.dir
+               ln $(VERSION_DEPS) $@.dir
+               case $@ in \
+                 int32_t) range=-2147483648,2147483648;; \
+                 u*) range=0,4294967296;; \
+                 *) range=-4294967296,4294967296;; \
+               esac && \
                wd=`pwd` && \
                zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
-               for type in $(TIME_T_ALTERNATIVES); do \
-                 mkdir -p time_t.dir/$$type && \
-                 $(MAKE) clean_misc && \
-                 $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
-                   CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
+               if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \
+                 range_target=; \
+               else \
+                 range_target=to$$range.tzs; \
+               fi && \
+               (cd $@.dir && \
+                 $(MAKE) TOPDIR="$$wd/$@.dir" \
+                   CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \
                    REDO='$(REDO)' \
-                   install && \
-                 diff $$quiet_option -r \
-                   time_t.dir/int64_t/etc \
-                   time_t.dir/$$type/etc && \
-                 diff $$quiet_option -r \
-                   time_t.dir/int64_t/usr/share \
-                   time_t.dir/$$type/usr/share && \
-                 case $$type in \
-                 int32_t) range=-2147483648,2147483647;; \
-                 uint32_t) range=0,4294967296;; \
-                 int64_t) continue;; \
-                 *u*) range=0,10000000000;; \
-                 *) range=-10000000000,10000000000;; \
-                 esac && \
-                 echo checking $$type zones ... && \
-                 time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
-                     >time_t.dir/int64_t.out && \
-                 time_t.dir/$$type/usr/bin/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 time_t.dir
+                       D=$$wd/$@.dir \
+                   TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
+                   install $$range_target) && \
+               test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \
+                 (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \
+                   $(MAKE) TOPDIR="$$wd/$@.dir" \
+                     TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
+                       D=$$wd/$@.dir \
+                     to$$range.tzs) && \
+                 diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \
+                         $@.dir/to$$range.tzs && \
+                 if diff -q Makefile Makefile 2>/dev/null; then \
+                   quiet_option='-q'; \
+                 else \
+                   quiet_option=''; \
+                 fi && \
+                   diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \
+                                          $@.dir/etc && \
+                   diff $$quiet_option -r \
+                     $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \
+                     $@.dir/usr/share; \
+               }
+               touch $@
 
 TRADITIONAL_ASC = \
   tzcode$(VERSION).tar.gz.asc \
   tzdata$(VERSION).tar.gz.asc
-ALL_ASC = $(TRADITIONAL_ASC) \
-  tzdata$(VERSION)-rearguard.tar.gz.asc \
+REARGUARD_ASC = \
+  tzdata$(VERSION)-rearguard.tar.gz.asc
+ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
   tzdb-$(VERSION).tar.lz.asc
 
-tarballs traditional_tarballs signatures traditional_signatures: version
+tarballs rearguard_tarballs traditional_tarballs \
+signatures rearguard_signatures traditional_signatures: \
+  version set-timestamps.out rearguard.zi
                VERSION=`cat version` && \
                $(MAKE) VERSION="$$VERSION" $@_version
 
 # These *_version rules are intended for use if VERSION is set by some
 # other means.  Ordinarily these rules are used only by the above
 # non-_version rules, which set VERSION on the 'make' command line.
-tarballs_version: traditional_tarballs_version \
-  tzdata$(VERSION)-rearguard.tar.gz \
+tarballs_version: traditional_tarballs_version rearguard_tarballs_version \
   tzdb-$(VERSION).tar.lz
+rearguard_tarballs_version: \
+  tzdata$(VERSION)-rearguard.tar.gz
 traditional_tarballs_version: \
   tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
 signatures_version: $(ALL_ASC)
+rearguard_signatures_version: $(REARGUARD_ASC)
 traditional_signatures_version: $(TRADITIONAL_ASC)
 
 tzcode$(VERSION).tar.gz: set-timestamps.out
@@ -958,7 +1018,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
                     gzip $(GZIPFLAGS)) >$@.out
                mv $@.out $@
 
-tzdb-$(VERSION).tar.lz: set-timestamps.out
+tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
                rm -fr tzdb-$(VERSION)
                mkdir tzdb-$(VERSION)
                ln $(ENCHILADA) tzdb-$(VERSION)
@@ -972,16 +1032,26 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
 tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
 tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
 $(ALL_ASC):
-               gpg --armor --detach-sign $?
-
-typecheck:
-               $(MAKE) clean
-               for i in "long long" unsigned; \
-               do \
-                       $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
-                       ./zdump -v Europe/Rome ; \
-                       $(MAKE) clean ; \
-               done
+               gpg2 --armor --detach-sign $?
+
+TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
+typecheck: typecheck_long_long typecheck_unsigned
+typecheck_long_long typecheck_unsigned: $(VERSION_DEPS)
+               rm -fr $@.dir
+               mkdir $@.dir
+               ln $(VERSION_DEPS) $@.dir
+               cd $@.dir && \
+                 case $@ in \
+                   *_long_long) i="long long";; \
+                   *_unsigned ) i="unsigned" ;; \
+                 esac && \
+                 typecheck_cflags='' && \
+                 $(MAKE) \
+                   CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \
+                   TOPDIR="`pwd`" \
+                   install
+               $@.dir/zdump -i -c 1970,1971 Europe/Rome
+               touch $@
 
 zonenames:     tzdata.zi
                @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
@@ -997,14 +1067,14 @@ zic.o:           private.h tzfile.h version.h
 .KEEP_STATE:
 
 .PHONY: ALL INSTALL all
-.PHONY: check check_character_set check_links check_name_lengths
-.PHONY: check_public check_sorted check_tables
-.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
+.PHONY: check check_time_t_alternatives
 .PHONY: check_zishrink
 .PHONY: clean clean_misc dummy.zd force_tzs
 .PHONY: install install_data maintainer-clean names
-.PHONY: posix_only posix_packrat posix_right
-.PHONY: public right_only right_posix signatures signatures_version
+.PHONY: posix_only posix_packrat posix_right public
+.PHONY: rearguard_signatures rearguard_signatures_version
+.PHONY: rearguard_tarballs rearguard_tarballs_version
+.PHONY: right_only right_posix signatures signatures_version
 .PHONY: tarballs tarballs_version
 .PHONY: traditional_signatures traditional_signatures_version
 .PHONY: traditional_tarballs traditional_tarballs_version
diff --git a/NEWS b/NEWS
index 9c445cd..aeeef10 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,136 @@
 News for the tz database
 
+Release 2018f - 2018-10-18 00:14:18 -0700
+
+  Briefly:
+  Volgograd moves from +03 to +04 on 2018-10-28.
+  Fiji ends DST 2019-01-13, not 2019-01-20.
+  Most of Chile changes DST dates, effective 2019-04-06.
+
+  Changes to future timestamps
+
+    Volgograd moves from +03 to +04 on 2018-10-28 at 02:00.
+    (Thanks to Alexander Fetisov and Stepan Golosunov.)
+
+    Fiji ends DST 2019-01-13 instead of the 2019-01-20 previously
+    predicted.  (Thanks to Raymond Kumar.)  Adjust future predictions
+    accordingly.
+
+    Most of Chile will end DST on the first Saturday in April at 24:00 mainland
+    time, and resume DST on the first Saturday in September at 24:00 mainland
+    time.  The changes are effective from 2019-04-06, and do not affect the
+    Magallanes region modeled by America/Punta_Arenas.  (Thanks to Juan Correa
+    and Tim Parenti.)  Adjust future predictions accordingly.
+
+  Changes to past timestamps
+
+    The 2018-05-05 North Korea 30-minute time zone change took place
+    at 23:30 the previous day, not at 00:00 that day.
+
+    China's 1988 spring-forward transition was on April 17, not
+    April 10.  Its DST transitions in 1986/91 were at 02:00, not 00:00.
+    (Thanks to P Chan.)
+
+    Fix several issues for Macau before 1992.  Macau's pre-1904 LMT
+    was off by 10 s.  Macau switched to +08 in 1904 not 1912, and
+    temporarily switched to +09/+10 during World War II.  Macau
+    observed DST in 1942/79, not 1961/80, and there were several
+    errors for transition times and dates.  (Thanks to P Chan.)
+
+    The 1948-1951 fallback transitions in Japan were at 25:00 on
+    September's second Saturday, not at 24:00.  (Thanks to Phake Nick.)
+    zic turns this into 01:00 on the day after September's second
+    Saturday, which is the best that POSIX or C platforms can do.
+
+    Incorporate 1940-1949 Asia/Shanghai DST transitions from a 2014
+    paper by Li Yu, replacing more-questionable data from Shanks.
+
+  Changes to time zone abbreviations
+
+    Use "PST" and "PDT" for Philippine time.  (Thanks to Paul Goyette.)
+
+  Changes to code
+
+    zic now always generates TZif files where time type 0 is used for
+    timestamps before the first transition.  This simplifies the
+    reading of TZif files and should not affect behavior of existing
+    TZif readers because the same set of time types is used; only
+    their internal indexes may have changed.  This affects only the
+    legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and
+    EET, which previously used nonzero types for these timestamps.
+
+    Because of the type 0 change, zic no longer outputs a dummy
+    transition at time -2**59 (before the Big Bang), as clients should
+    no longer need this to handle historical timestamps correctly.
+    This reverts a change introduced in 2013d and shrinks most TZif
+    files by a few bytes.
+
+    zic now supports negative time-of-day in Rule and Leap lines, e.g.,
+    "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition
+    occurs at 18:00 on the Saturday before the last Sunday in April.
+    This behavior was documented in 2018a but the code did not
+    entirely match the documentation.
+
+    localtime.c no longer requires at least one time type in TZif
+    files that lack transitions or have a POSIX-style TZ string.  This
+    future-proofs the code against possible future extensions to the
+    format that would allow TZif files with POSIX-style TZ strings and
+    without transitions or time types.
+
+    A read-access subscript error in localtime.c has been fixed.
+    It could occur only in TZif files with timecnt == 0, something that
+    does not happen in practice now but could happen in future versions.
+
+    localtime.c no longer ignores TZif POSIX-style TZ strings that
+    specify only standard time.  Instead, these TZ strings now
+    override the default time type for timestamps after the last
+    transition (or for all time stamps if there are no transitions),
+    just as DST strings specifying DST have always done.
+
+    leapseconds.awk now outputs "#updated" and "#expires" comments,
+    and supports leap seconds at the ends of months other than June
+    and December.  (Inspired by suggestions from Chris Woodbury.)
+
+  Changes to documentation
+
+    New restrictions: A Rule name must start with a character that
+    is neither an ASCII digit nor "-" nor "+", and an unquoted name
+    should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~".
+    The latter restriction makes room for future extensions (a
+    possibility noted by Tom Lane).
+
+    tzfile.5 now documents what time types apply before the first and
+    after the last transition, if any.
+
+    Documentation now uses the spelling "timezone" for a TZ setting
+    that determines timestamp history, and "time zone" for a
+    geographic region currently sharing the same standard time.
+
+    The name "TZif" is now used for the tz binary data format.
+
+    tz-link.htm now mentions the A0 TimeZone Migration utilities.
+    (Thanks to Aldrin Martoq for the link.)
+
+  Changes to build procedure
+
+    New 'make' target 'rearguard_tarballs' to build the rearguard
+    tarball only.  This is a convenience on platforms that lack lzip
+    if you want to build the rearguard tarball.  (Problem reported by
+    Deborah Goldsmith.)
+
+    tzdata.zi is now more stable from release to release.  (Problem
+    noted by Tom Lane.)  It is also a bit shorter.
+
+    tzdata.zi now can contain comment lines documenting configuration
+    information, such as which data format was selected, which input
+    files were used, and how leap seconds are treated.  (Problems
+    noted by Lester Caine and Brian Inglis.)  If the Makefile defaults
+    are used these comment lines are absent, for backward
+    compatibility.  A redistributor intending to alter its copy of the
+    files should also append "-LABEL" to the 'version' file's first
+    line, where "LABEL" identifies the redistributor's change.
+
+
 Release 2018e - 2018-05-01 23:42:51 -0700
 
   Briefly:
@@ -9,7 +140,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
     'make tarballs' now also builds a rearguard tarball.
     New 's' and 'd' suffixes in SAVE columns of Rule and Zone lines.
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     North Korea switches back from +0830 to +09 on 2018-05-05.
     (Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon,
@@ -17,9 +148,9 @@ Release 2018e - 2018-05-01 23:42:51 -0700
 
     Bring back the negative-DST changes of 2018a, except be more
     compatible with data parsers that do not support negative DST.
-    Also, this now affects historical time stamps in Namibia and the
+    Also, this now affects historical timestamps in Namibia and the
     former Czechoslovakia, not just Ireland.  The main format now uses
-    negative DST to model time stamps in Europe/Dublin (from 1971 on),
+    negative DST to model timestamps in Europe/Dublin (from 1971 on),
     Europe/Prague (1946/7), and Africa/Windhoek (1994/2017).  This
     does not affect UT offsets, only time zone abbreviations and the
     tm_isdst flag.  Also, this does not affect rearguard or vanguard
@@ -44,7 +175,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
     in tzdata, it could be used to specify the legal time in Namibia
     1994-2017, as opposed to the popular time (see below).
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     From 1994 through 2017 Namibia observed DST in winter, not summer.
     That is, it used negative DST, as Ireland still does.  This change
@@ -54,12 +185,12 @@ Release 2018e - 2018-05-01 23:42:51 -0700
     both simply called "standard time" in Namibian law, in common
     practice winter time was considered to be DST (as noted by Stephen
     Colebourne).  The full effect of this change is only in vanguard
-    format; in rearguard and main format, the tm_isdst flag is still
+    and main format; in rearguard format, the tm_isdst flag is still
     zero in winter and nonzero in summer.
 
     In 1946/7 Czechoslovakia also observed negative DST in winter.
-    The full effect of this change is only in vanguard format; in
-    rearguard and main formats, it is modeled as plain GMT without
+    The full effect of this change is only in vanguard and main
+    formats; in rearguard format, it is modeled as plain GMT without
     daylight saving.  Also, the dates of some 1944/5 DST transitions
     in Czechoslovakia have been changed.
 
@@ -72,17 +203,17 @@ Release 2018d - 2018-03-22 07:05:46 -0700
   Add support for vanguard and rearguard data consumers.
   Add subsecond precision to source data format, though not to data.
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     In 2018, Palestine starts DST on March 24, not March 31.
     Adjust future predictions accordingly.  (Thanks to Sharef Mustafa.)
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
     at 04:00.  (Thanks to Steffen Thorsen.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     Historical transitions for Uruguay, represented by
     America/Montevideo, have been updated per official legal documents,
@@ -224,7 +355,7 @@ Release 2018c - 2018-01-22 23:00:44 -0800
     change is reapplied.  (Problems reported by Deborah Goldsmith and
     Stephen Colebourne.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     Japanese DST transitions (1948-1951) were Sundays at 00:00, not
     Saturdays or Sundays at 02:00.  (Thanks to Takayuki Nikai.)
@@ -256,18 +387,18 @@ Release 2018a - 2018-01-12 22:29:21 -0800
   Use Debian-style installation locations, instead of 4.3BSD-style.
   New zic option -t.
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at
     01:00.  (Thanks to Steffen Thorsen and Michael Deckers.)
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Starting in 2018 southern Brazil will begin DST on November's
     first Sunday instead of October's third Sunday.  (Thanks to
     Steffen Thorsen.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     A discrepancy of 4 s in timestamps before 1931 in South Sudan has
     been corrected.  The 'backzone' and 'zone.tab' files did not agree
@@ -355,7 +486,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
   A new file tzdata.zi now holds a small text copy of all data.
   The zic input format has been regularized slightly.
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Northern Cyprus has decided to resume EU rules starting
     2017-10-29, thus reinstituting winter time.
@@ -381,7 +512,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
     2018-03-11 at 03:00.  This affects UT offsets starting 2018-11-04
     at 02:00.  (Thanks to Steffen Thorsen.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03.
     (Thanks to Arthur David Olson.)
@@ -511,11 +642,11 @@ Release 2017b - 2017-03-17 07:30:38 -0700
 
   Briefly: Haiti has resumed DST.
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     Haiti resumed observance of DST in 2017.  (Thanks to Steffen Thorsen.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
 
@@ -527,7 +658,7 @@ Release 2017b - 2017-03-17 07:30:38 -0700
     The reference localtime implementation now falls back on the
     current US daylight-saving transition rules rather than the
     1987-2006 rules.  This fallback occurs only when (1) the TZ
-    environment variable's value has a name like "AST4ADT" that asks
+    environment variable has a value like "AST4ADT" that asks
     for daylight saving time but does not specify the rules, (2) there
     is no file by that name, and (3) the TZDEFRULES file cannot be
     loaded.  (Thanks to Tom Lane.)
@@ -538,7 +669,7 @@ Release 2017a - 2017-02-28 00:05:36 -0800
   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
   discontinues DST.
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Mongolia no longer observes DST.  (Thanks to Ganbold Tsagaankhuu.)
 
@@ -549,12 +680,12 @@ Release 2017a - 2017-02-28 00:05:36 -0800
     assume it's permanent.  (Thanks to Juan Correa and Deborah
     Goldsmith.)  This also affects Antarctica/Palmer.
 
-  Changes to past time stamps
+  Changes to past timestamps
 
-    Fix many entries for historical time stamps for Europe/Madrid
+    Fix many entries for historical timestamps for Europe/Madrid
     before 1979, to agree with tables compiled by Pere Planesas of the
     National Astronomical Observatory of Spain.  As a side effect,
-    this changes some time stamps for Africa/Ceuta before 1929, which
+    this changes some timestamps for Africa/Ceuta before 1929, which
     are probably guesswork anyway.  (Thanks to Steve Allen and
     Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
     correcting the 1901 transition.)
@@ -645,13 +776,13 @@ Release 2016j - 2016-11-22 23:17:13 -0800
 
   Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04.
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00.
     This hives off a new zone Europe/Saratov from Europe/Volgograd.
     (Thanks to Yuri Konotopov and Stepan Golosunov.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     The new zone Asia/Atyrau for Atyraū Region, Kazakhstan, is like
     Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring
@@ -687,7 +818,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
   Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga
   reintroduces DST on 2016-11-06.
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on
     2017-01-15 at 03:00.  Assume future observances in Tonga will be
@@ -695,7 +826,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
     January, like Fiji.  (Thanks to Pulu ʻAnau.)  Switch to numeric
     time zone abbreviations for this zone.
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     Northern Cyprus is now +03 year round, causing a split in Cyprus
     time zones starting 2016-10-30 at 04:00.  This creates a zone
@@ -704,9 +835,9 @@ Release 2016i - 2016-11-01 23:19:52 -0700
     Antarctica/Casey switched from +08 to +11 on 2016-10-22.
     (Thanks to Steffen Thorsen.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
-    Several corrections were made for pre-1975 time stamps in Italy.
+    Several corrections were made for pre-1975 timestamps in Italy.
     These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and
     Europe/Vatican.
 
@@ -744,7 +875,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
 
 Release 2016h - 2016-10-19 23:17:57 -0700
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not
     2016-10-21 at 00:00.  (Thanks to Sharef Mustafa.)  Predict that
@@ -752,7 +883,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
     at 01:00, which is consistent with predicted spring transitions
     on the last Saturday of March.  (Thanks to Tim Parenti.)
 
-  Changes to past time stamps
+  Changes to past timestamps
 
     In Turkey, transitions in 1986-1990 were at 01:00 standard time
     not at 02:00, and the spring 1994 transition was on March 20, not
@@ -801,7 +932,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
 
 Release 2016g - 2016-09-13 08:56:38 -0700
 
-  Changes to future time stamps
+  Changes to future timestamps
 
     Turkey switched from EET/EEST (+02/+03) to permanent +03,
     effective 2016-09-07.  (Thanks to Burak AYDIN.)  Use "+03" rather
@@ -810,7 +941,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
     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
+  Changes to past timestamps
 
     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
@@ -859,9 +990,9 @@ Release 2016g - 2016-09-13 08:56:38 -0700
     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.)
+    Africa/Casablanca and Africa/El_Aaiun in some year-2037 timestamps
+    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
@@ -924,7 +1055,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
 
 Release 2016f - 2016-07-05 16:26:51 +0200
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     The Egyptian government changed its mind on short notice, and
     Africa/Cairo will not introduce DST starting 2016-07-07 after all.
@@ -933,12 +1064,12 @@ Release 2016f - 2016-07-05 16:26:51 +0200
     Asia/Novosibirsk switches from +06 to +07 on 2016-07-24 at 02:00.
     (Thanks to Stepan Golosunov.)
 
-  Changes to past and future time stamps
+  Changes to past and future timestamps
 
     Asia/Novokuznetsk and Asia/Novosibirsk now use numeric time zone
     abbreviations instead of invented ones.
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Europe/Minsk's 1992-03-29 spring-forward transition was at 02:00 not 00:00.
     (Thanks to Stepan Golosunov.)
@@ -946,14 +1077,14 @@ Release 2016f - 2016-07-05 16:26:51 +0200
 
 Release 2016e - 2016-06-14 08:46:16 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Africa/Cairo observes DST in 2016 from July 7 to the end of October.
     Guess October 27 and 24:00 transitions.  (Thanks to Steffen Thorsen.)
     For future years, guess April's last Thursday to October's last
     Thursday except for Ramadan.
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Locations while uninhabited now use '-00', not 'zzz', as a
     placeholder time zone abbreviation.  This is inspired by Internet
@@ -982,7 +1113,7 @@ Release 2016e - 2016-06-14 08:46:16 -0700
 
 Release 2016d - 2016-04-17 22:50:29 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     America/Caracas switches from -0430 to -04 on 2016-05-01 at 02:30.
     (Thanks to Alexander Krivenyshev for the heads-up.)
@@ -994,7 +1125,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
     Tomsk Oblast, Russia, which switches from +06 to +07 on 2016-05-29
     at 02:00.  (Thanks to Stepan Golosunov.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     New zone Europe/Kirov, split off from Europe/Volgograd.  It covers
     Kirov Oblast, Russia, which switched from +04/+05 to +03/+04 on
@@ -1017,7 +1148,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
 
 Release 2016c - 2016-03-23 00:51:27 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Azerbaijan no longer observes DST.  (Thanks to Steffen Thorsen.)
 
@@ -1028,7 +1159,7 @@ Release 2016c - 2016-03-23 00:51:27 -0700
     2014-09-07 through 2016-05-14 daylight saving time instead of
     standard time, as that seems more appropriate now.
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
     +02/+03 on 1989-03-26, not 1991-03-31.  Europe/Volgograd changed
@@ -1053,7 +1184,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
     POSIX.1-1988 that was removed in POSIX.1-2001.  One way to suppress the
     warnings is to upgrade to zic derived from tz releases 2015f and later.
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
     Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
@@ -1077,7 +1208,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
     (Thanks to Hannah Kreitem.) Guess future transitions will be March's last
     Saturday at 01:00, not March's last Friday at 24:00.
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Europe/Chisinau observed DST during 1990, and switched from +04 to
     +03 at 1990-05-06 02:00, instead of switching from +03 to +02.
@@ -1112,7 +1243,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
 
 Release 2016a - 2016-01-26 23:28:02 -0800
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     America/Cayman will not observe daylight saving this year after all.
     Revert our guess that it would.  (Thanks to Matt Johnson.)
@@ -1124,7 +1255,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
     to be March 21 00:00 to September 21 00:00.  This is likely better
     than predicting no DST, albeit off by a day every now and then.
 
-  Changes affecting past and future time stamps
+  Changes affecting past and future timestamps
 
     America/Metlakatla switched from PST all year to AKST/AKDT on
     2015-11-01 at 02:00.  (Thanks to Steffen Thorsen.)
@@ -1133,7 +1264,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
     backward compatibility link to America/Tijuana.  Its contents were
     apparently based on a misreading of Mexican legislation.
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Asia/Karachi's two transition times in 2002 were off by a minute.
     (Thanks to Matt Johnson.)
@@ -1167,7 +1298,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
 
 Release 2015g - 2015-10-01 00:39:51 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.
     (Thanks to Fatih.)
@@ -1182,7 +1313,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
     effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
     New zone America/Fort_Nelson.  (Thanks to Matt Johnson.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Norfolk observed DST from 1974-10-27 02:00 to 1975-03-02 02:00.
 
@@ -1212,7 +1343,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
 
 Release 2015f - 2015-08-10 18:06:56 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
     The abbreviation remains "KST".  (Thanks to Robert Elz.)
@@ -1220,7 +1351,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
     Uruguay no longer observes DST.  (Thanks to Steffen Thorsen
     and Pablo Camargo.)
 
-  Changes affecting past and future time stamps
+  Changes affecting past and future timestamps
 
     Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC.
     (Thanks to Roman Tudos.)
@@ -1279,7 +1410,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
 
 Release 2015e - 2015-06-13 10:56:02 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
     not 06-13 and 07-18 as we had guessed.  (Thanks to Milamber.)
@@ -1307,13 +1438,13 @@ Release 2015e - 2015-06-13 10:56:02 -0700
 
 Release 2015d - 2015-04-24 08:09:46 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Egypt will not observe DST in 2015 and will consider canceling it
     permanently.  For now, assume no DST indefinitely.
     (Thanks to Ahmed Nazmy and Tim Parenti.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     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.
@@ -1333,16 +1464,16 @@ Release 2015d - 2015-04-24 08:09:46 -0700
 
 Release 2015c - 2015-04-11 08:55:55 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Egypt's spring-forward transition is at 24:00 on April's last Thursday,
     not 00:00 on April's last Friday.  2015's transition will therefore be on
     Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
     apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
-    The following changes affect some pre-1991 Chile-related time stamps
+    The following changes affect some pre-1991 Chile-related timestamps
     in America/Santiago, Antarctica/Palmer, and Pacific/Easter.
 
       The 1910 transition was January 10, not January 1.
@@ -1367,8 +1498,8 @@ Release 2015c - 2015-04-11 08:55:55 -0700
       since we have no data suggesting that they existed.
 
     One more zone has been turned into a link, as it differed
-    from an existing zone only for older time stamps.  As usual,
-    this change affects UT offsets in pre-1970 time stamps only.
+    from an existing zone only for older timestamps.  As usual,
+    this change affects UT offsets in pre-1970 timestamps only.
     The zone's old contents have been moved to the 'backzone' file.
     The affected zone is America/Montreal.
 
@@ -1381,7 +1512,7 @@ Release 2015c - 2015-04-11 08:55:55 -0700
 
 Release 2015b - 2015-03-19 23:28:11 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Mongolia will start observing DST again this year, from the last
     Saturday in March at 02:00 to the last Saturday in September at 00:00.
@@ -1391,14 +1522,14 @@ Release 2015b - 2015-03-19 23:28:11 -0700
     correct the fall 2014 transition from September 26 to October 24.
     Adjust future predictions accordingly.  (Thanks to Steffen Thorsen.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
     regression.  (Thanks to Stuart Bishop for reporting the problem.)
 
     Some more zones have been turned into links, when they differed
-    from existing zones only for older time stamps.  As usual,
-    these changes affect UT offsets in pre-1970 time stamps only.
+    from existing zones only for older timestamps.  As usual,
+    these changes affect UT offsets in pre-1970 timestamps only.
     Their old contents have been moved to the 'backzone' file.
     The affected zones are: America/Antigua, America/Cayman,
     Pacific/Midway, and Pacific/Saipan.
@@ -1429,7 +1560,7 @@ Release 2015b - 2015-03-19 23:28:11 -0700
 
 Release 2015a - 2015-01-29 22:35:20 -0800
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     The Mexican state of Quintana Roo, represented by America/Cancun,
     will shift from Central Time with DST to Eastern Time without DST
@@ -1442,15 +1573,15 @@ Release 2015a - 2015-01-29 22:35:20 -0800
     New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
     (Thanks to Tim Parenti.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
     Iceland observed DST in 1919 and 1921, and its 1939 fallback
     transition was Oct. 29, not Nov. 29.  Remove incorrect data from
     Shanks about time in Iceland between 1837 and 1908.
 
     Some more zones have been turned into links, when they differed
-    from existing zones only for older time stamps.  As usual,
-    these changes affect UT offsets in pre-1970 time stamps only.
+    from existing zones only for older timestamps.  As usual,
+    these changes affect UT offsets in pre-1970 timestamps only.
     Their old contents have been moved to the 'backzone' file.
     The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
     and Asia/Muscat.
@@ -1481,23 +1612,23 @@ Release 2015a - 2015-01-29 22:35:20 -0800
 
 Release 2014j - 2014-11-10 17:37:11 -0800
 
-  Changes affecting current and future time stamps
+  Changes affecting current and future timestamps
 
     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.)
 
-  Changes affecting past time stamps
+  Changes affecting past timestamps
 
-    Many pre-1989 time stamps have been corrected for Asia/Seoul and
+    Many pre-1989 timestamps have been corrected for Asia/Seoul and
     Asia/Pyongyang, based on sources for the Korean-language Wikipedia
     entry for time in Korea.  (Thanks to Sanghyuk Jung.)  Also, no
     longer guess that Pyongyang mimicked Seoul time after World War II,
     as this is politically implausible.
 
     Some more zones have been turned into links, when they differed
-    from existing zones only for older time stamps.  As usual,
-    these changes affect UT offsets in pre-1970 time stamps only.
+    from existing zones only for older timestamps.  As usual,
+    these changes affect UT offsets in pre-1970 timestamps only.
     Their old contents have been moved to the 'backzone' file.
     The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
     Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
@@ -1512,7 +1643,7 @@ Release 2014j - 2014-11-10 17:37:11 -0800
 
 Release 2014i - 2014-10-21 22:04:57 -0700
 
-  Changes affecting future time stamps
+  Changes affecting future timestamps
 
     Pacific/Fiji will observe DST from 2014-11-02 02:00 to 2015-01-18 03:00.
     (Thanks to Ken Rylander for the heads-up.)  Guess that future
@@ -1532,17 +1663,17 @@ Release 2014i - 2014-10-21 22:04:57 -0700
     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
+  Changes affecting past timestamps
 
-    Many time stamps have been corrected for Asia/Ho_Chi_Minh before 1976
+    Many timestamps have been corrected for Asia/Ho_Chi_Minh before 1976
     (thanks to Trần Ngọc Quân for an indirect pointer to Trần Tiến Bình's
     authoritative book).  Asia/Ho_Chi_Minh has been added to
     zone1970.tab, to give tzselect users in Vietnam two choices,
     since north and south Vietnam disagreed after our 1970 cutoff.
 
     Asia/Phnom_Penh and Asia/Vientiane have been turned into links, as
-    they differed from existing zones only for older time stamps.  As
-    usual, these changes affect pre-1970 time stamps only.  Their old
+    they differed from existing zones only for older timestamps.  As
+    usual, these changes affect pre-1970 timestamps only.  Their old
     contents have been moved to the 'backzone' file.
 
   Changes affecting code
@@ -1682,7 +1813,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
 
     Unless NETBSD_INSPIRED is defined to 0, the tz library now
     supplies functions for creating and using objects that represent
-    time zones. The new functions are tzalloc, tzfree, localtime_rz,
+    timezones. The new functions are tzalloc, tzfree, localtime_rz,
     mktime_z, and (if STD_INSPIRED is also defined) posix2time_z and
     time2posix_z.  They are intended for performance: for example,
     localtime_rz (unlike localtime_r) is trivially thread-safe without
@@ -1696,7 +1827,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
     TZDOBJS=zdump.o CHECK_TIME_T_ALTERNATIVES='.
 
     zdump now uses localtime_rz if available, as it's significantly faster,
-    and it can help zdump better diagnose invalid time zone names.
+    and it can help zdump better diagnose invalid timezone names.
     Define HAVE_LOCALTIME_RZ to 0 to suppress this.  HAVE_LOCALTIME_RZ
     defaults to 1 if NETBSD_INSPIRED && USE_LTZ.  When localtime_rz is
     not available, zdump now uses localtime_r and tzset if available,
@@ -1712,7 +1843,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
     invalid or outlandish input.
 
     The tz library no longer mishandles leap seconds on platforms with
-    unsigned time_t in time zones that lack ordinary transitions after 1970.
+    unsigned time_t in timezones that lack ordinary transitions after 1970.
 
     The tz code now attempts to infer TM_GMTOFF and TM_ZONE if not
     already defined, to make it easier to configure on common platforms.
@@ -2036,8 +2167,8 @@ Release 2014d - 2014-05-27 21:34:40 -0700
   Changes affecting code
 
     zic no longer generates files containing timestamps before the Big Bang.
-    This works around GNOME bug 730332
-    <https://bugzilla.gnome.org/show_bug.cgi?id=730332>.
+    This works around GNOME glib bug 878
+    <https://gitlab.gnome.org/GNOME/glib/issues/878>
     (Thanks to Leonardo Chiquitto for reporting the bug, and to
     Arthur David Olson and James Cloos for suggesting improvements to the fix.)
 
@@ -3490,7 +3621,7 @@ Release 2005j - 2005-06-13 14:34:13 -0400
   These reflect changes to limit the length of time zone abbreviations
   and the characters used in those abbreviations.
 
-  There are also changes to handle POSIX-style "quoted" time zone
+  There are also changes to handle POSIX-style "quoted" timezone
   environment variables.
 
   The changes were circulated on the time zone mailing list; the only
@@ -3816,7 +3947,7 @@ Release 1999f - 1999-09-23 09:48:14 -0400
 Release 1999e - 1999-08-17 15:20:54 -0400
 
   changes circulated by Paul Eggert, although the change to handling
-  of DST-specifying time zone names has been commented out for now
+  of DST-specifying timezone names has been commented out for now
   (search for "XXX" in "localtime.c" for details).  These files also
   do not make any changes to the start of DST in Brazil.
 
@@ -3941,7 +4072,7 @@ Release code1997i-data1997k - 1997-12-29 09:53:41 -0500
 
 Release code1997h-data1997j - 1997-12-18 17:47:35 -0500
 
-  minor changes to put "TZif" at the start of each time zone information file
+  minor changes to put "TZif" at the start of each timezone information file
 
   a rule has also been added to the Makefile so you can
        make zones
@@ -4451,8 +4582,8 @@ consisting of a single tarball tzdb-R.tar.lz with extra data.
 Release timestamps are taken from the release's commit (for newer,
 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).
+the release (if all else fails; these are marked with a time zone
+abbreviation of -0000 and an "is missing!" comment).
 
 Earlier versions of the code and data were not announced on the tz
 list and are not summarized here.
diff --git a/README b/README
index ab8e47b..efe7a17 100644 (file)
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ README for the tz distribution
 "Any time you want it to be." -- Frank Baxter as The Scientist
                                        (from the Bell System film "About Time")
 
-The Time Zone Database (often called tz or zoneinfo) contains code and
+The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
 data that represent the history of local time for many representative
 locations around the globe.  It is updated periodically to reflect
 changes made by political bodies to time zone boundaries, UTC offsets,
@@ -20,17 +20,15 @@ substituting your desired installation directory for "$HOME/tzdir":
        make TOPDIR=$HOME/tzdir install
        $HOME/tzdir/usr/bin/zdump -v America/Los_Angeles
 
-Historical local time information has been included here to:
+This database of historical local time information has several goals:
 
-*      provide a compendium of data about the history of civil time
-       that is useful even if not 100% accurate;
+ * Provide a compendium of data about the history of civil time that
+   is useful even if not 100% accurate.
 
-*      give an idea of the variety of local time rules that have
-       existed in the past and thus an idea of the variety that may be
-       expected in the future;
+ * Give an idea of the variety of local time rules that have existed
+   in the past and thus may be expected in the future.
 
-*      provide a test of the generality of the local time rule description
-       system.
+ * Test the generality of the local time rule description system.
 
 The information in the time zone data files is by no means authoritative;
 fixes and enhancements are welcome.  Please see the file CONTRIBUTING
diff --git a/africa b/africa
index 84e1ce2..555052b 100644 (file)
--- a/africa
+++ b/africa
@@ -1,3 +1,5 @@
+# tzdb data for Africa and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -6,7 +8,7 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2017-04-09):
+# From Paul Eggert (2018-05-27):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # I vaguely recall 'WAT' also being used for -01 in the past but
 # cannot now come up with solid citations.
 #
-# I invented the following abbreviations; corrections are welcome!
-#       +02    WAST    West Africa Summer Time (no longer used)
-#       +03    CAST    Central Africa Summer Time (no longer used)
-#       +03    SAST    South Africa Summer Time (no longer used)
+# I invented the following abbreviations in the 1990s:
+#       +02    WAST    West Africa Summer Time
+#       +03    CAST    Central Africa Summer Time
+#       +03    SAST    South Africa Summer Time
 #       +03    EAT     East Africa Time
-# 'EAT' also seems to have caught on; the others are rare but are paired
-# with better-attested non-DST abbreviations.
+# 'EAT' seems to have caught on and is in current timestamps, and though
+# the other abbreviations are rarer and are only in past timestamps,
+# they are paired with better-attested non-DST abbreviations.
+# Corrections are welcome.
 
 # Algeria
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
@@ -362,6 +366,13 @@ Zone       Africa/Cairo    2:05:09 -       LMT     1900 Oct
 # Eritrea
 # Ethiopia
 # See Africa/Nairobi.
+#
+# Unfortunately tzdb records only Western clock time in use in Ethiopia,
+# as the tzdb format is not up to properly recording a common Ethiopian
+# timekeeping practice that is based on solar time.  See:
+# Mortada D. If you have a meeting in Ethiopia, you'd better double
+# check the time. PRI's The World. 2015-01-30 15:15 -05.
+# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time
 
 # Gabon
 # See Africa/Lagos.
index 866cf4f..1dd9b00 100644 (file)
@@ -1,3 +1,5 @@
+# tzdb data for Antarctica and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
diff --git a/asia b/asia
index 3d30864..48b4c65 100644 (file)
--- a/asia
+++ b/asia
@@ -1,3 +1,5 @@
+# tzdb data for Asia and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -6,7 +8,7 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2017-01-13):
+# From Paul Eggert (2018-06-19):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -35,7 +37,8 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
-# The following alphabetic abbreviations appear in these tables:
+# The following alphabetic abbreviations appear in these tables
+# (corrections are welcome):
 #           std  dst
 #           LMT        Local Mean Time
 #      2:00 EET  EEST  Eastern European Time
 #      7:00 WIB        west Indonesia (Waktu Indonesia Barat)
 #      8:00 WITA       central Indonesia (Waktu Indonesia Tengah)
 #      8:00 CST        China
+#      8:00 PST  PDT*  Philippine Standard Time
 #      8:30 KST  KDT   Korea when at +0830
 #      9:00 WIT        east Indonesia (Waktu Indonesia Timur)
 #      9:00 JST  JDT   Japan
 #      9:00 KST  KDT   Korea when at +09
 #      9:30 ACST       Australian Central Standard Time
+# *I invented the abbreviation PDT; see "Philippines" below.
 # Otherwise, these tables typically use numeric abbreviations like +03
 # and +0330 for integer hour and minute UT offsets.  Although earlier
 # editions invented alphabetic time zone abbreviations for every
@@ -281,6 +286,29 @@ Zone       Asia/Yangon     6:24:47 -       LMT     1880        # or Rangoon
 
 # China
 
+# From Paul Eggert (2018-10-02):
+# The following comes from Table 1 of:
+# Li Yu. Research on the daylight saving movement in 1940s Shanghai.
+# Nanjing Journal of Social Sciences. 2014;(2):144-50.
+# http://oversea.cnki.net/kns55/detail.aspx?dbname=CJFD2014&filename=NJSH201402020
+# The table lists dates only; I am guessing 00:00 and 24:00 transition times.
+# Also, the table lists the planned end of DST in 1949, but the corresponding
+# zone line cuts this off on May 28, when the Communists took power.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Shang   1940    only    -       Jun      1       0:00   1:00    D
+Rule   Shang   1940    only    -       Oct     12      24:00   0       S
+Rule   Shang   1941    only    -       Mar     15       0:00   1:00    D
+Rule   Shang   1941    only    -       Nov      1      24:00   0       S
+Rule   Shang   1942    only    -       Jan     31       0:00   1:00    D
+Rule   Shang   1945    only    -       Sep      1      24:00   0       S
+Rule   Shang   1946    only    -       May     15       0:00   1:00    D
+Rule   Shang   1946    only    -       Sep     30      24:00   0       S
+Rule   Shang   1947    only    -       Apr     15       0:00   1:00    D
+Rule   Shang   1947    only    -       Oct     31      24:00   0       S
+Rule   Shang   1948    1949    -       May      1       0:00   1:00    D
+Rule   Shang   1948    1949    -       Sep     30      24:00   0       S #plan
+
 # From Guy Harris:
 # People's Republic of China.  Yes, they really have only one time zone.
 
@@ -307,18 +335,33 @@ Zone      Asia/Yangon     6:24:47 -       LMT     1880        # or Rangoon
 # time - sort of", Los Angeles Times, 1986-05-05 ... [says] that China began
 # observing daylight saving time in 1986.
 
-# From Paul Eggert (2014-06-30):
-# Shanks & Pottenger have China switching to a single time zone in 1980, but
-# this doesn't seem to be correct.  They also write that China observed summer
-# DST from 1986 through 1991, which seems to match the above commentary, so
-# go with them for DST rules as follows:
+# From P Chan (2018-05-07):
+# The start and end time of DST in China [from 1986 on] should be 2:00
+# (i.e. 2:00 to 3:00 at the start and 2:00 to 1:00 at the end)....
+# Government notices about summer time:
+#
+# 1986-04-12 http://www.zj.gov.cn/attach/zfgb/198608.pdf p.21-22
+# (To establish summer time from 1986. On 4 May, set the clocks ahead one hour
+# at 2 am. On 14 September, set the clocks backward one hour at 2 am.)
+#
+# 1987-02-15 http://www.gov.cn/gongbao/shuju/1987/gwyb198703.pdf p.114
+# (Summer time in 1987 to start from 12 April until 13 September)
+#
+# 1987-09-09 http://www.gov.cn/gongbao/shuju/1987/gwyb198721.pdf p.709
+# (From 1988, summer time to start from 2 am of the first Sunday of mid-April
+# until 2 am of the first Sunday of mid-September)
+#
+# 1992-03-03 http://www.gov.cn/gongbao/shuju/1992/gwyb199205.pdf p.152
+# (To suspend summer time from 1992)
+#
+# The first page of People's Daily on 12 April 1988 stating that summer time
+# to begin on 17 April.
+# http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
-Rule   Shang   1940    only    -       Jun      3      0:00    1:00    D
-Rule   Shang   1940    1941    -       Oct      1      0:00    0       S
-Rule   Shang   1941    only    -       Mar     16      0:00    1:00    D
-Rule   PRC     1986    only    -       May      4      0:00    1:00    D
-Rule   PRC     1986    1991    -       Sep     Sun>=11 0:00    0       S
-Rule   PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
+Rule   PRC     1986    only    -       May      4       2:00   1:00    D
+Rule   PRC     1986    1991    -       Sep     Sun>=11  2:00   0       S
+Rule   PRC     1987    1991    -       Apr     Sun>=11  2:00   1:00    D
 
 # From Anthony Fok (2001-12-20):
 # BTW, I did some research on-line and found some info regarding these five
@@ -340,10 +383,11 @@ Rule      PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
 # Alois Treindl kindly sent me translations of the following two sources:
 #
 # (1)
-# Guo Qingsheng (National Time-Service Center, CAS, Xi'an 710600, China)
+# Guo Qing-sheng (National Time-Service Center, CAS, Xi'an 710600, China)
 # Beijing Time at the Beginning of the PRC
 # China Historical Materials of Science and Technology
-# (Zhongguo ke ji shi liao, 中国科技史料), Vol. 24, No. 1 (2003)
+# (Zhongguo ke ji shi liao, 中国科技史料). 2003;24(1):5-9.
+# http://oversea.cnki.net/kcms/detail/detail.aspx?filename=ZGKS200301000&dbname=CJFD2003
 # It gives evidence that at the beginning of the PRC, Beijing time was
 # officially apparent solar time!  However, Guo also says that the
 # evidence is dubious, as the relevant institute of astronomy had not
@@ -520,7 +564,7 @@ Rule        PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 # Beijing time, used throughout China; represented by Shanghai.
 Zone   Asia/Shanghai   8:05:43 -       LMT     1901
-                       8:00    Shang   C%sT    1949
+                       8:00    Shang   C%sT    1949 May 28
                        8:00    PRC     C%sT
 # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
 # / Wulumuqi.  (Please use Asia/Shanghai if you prefer Beijing time.)
@@ -749,24 +793,140 @@ Zone     Asia/Taipei     8:06:00 -       LMT     1896 Jan  1
                        8:00    Taiwan  C%sT
 
 # Macau (Macao, Aomen)
+#
+# From P Chan (2018-05-10):
+# * LegisMac
+#   http://legismac.safp.gov.mo/legismac/descqry/Descqry.jsf?lang=pt
+#   A database for searching titles of legal documents of Macau in
+#   Chinese and Portuguese.  The term "HORÁRIO DE VERÃO" can be used for
+#   searching decrees about summer time.
+# * Archives of Macao
+#   http://www.archives.gov.mo/en/bo/
+#   It contains images of old official gazettes.
+# * The Macao Meteorological and Geophysical Bureau have a page listing the
+#   summer time history.  But it is not complete and has some mistakes.
+#   http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm
+# Macau adopted GMT+8 on 30 Oct 1904 to follow Hong Kong.  Clocks were
+# advanced by 25 minutes and 50 seconds.  Which means the LMT used was
+# +7:34:10.  As stated in the "Portaria No. 204" dated 21 October 1904
+# and published in the Official Gazette on 29 October 1904.
+# http://igallery.icm.gov.mo/Images/Archives/BO/MO_AH_PUB_BO_1904_10/MO_AH_PUB_BO_1904_10_00025_Grey.JPG
+#
+# Therefore the 1911 decree of Portugal did not change time in Macau.
+#
+# From LegisMac, here is a list of decrees that changed the time ...
+# [Decree Gazette-no. date; titles omitted in this quotation]
+#      DIL 732 BOCM 51 1941.12.20
+#      DIL 764 BOCM 9S 1942.04.30
+#      DIL 781 BOCM 21 1942.10.10
+#      PT 3434 BOCM 8S 1943.04.17
+#      PT 3504 BOCM 20 1943.09.25
+#      PT 3843 BOCM 39 1945.09.29
+#      PT 3961 BOCM 17 1946.04.27
+#      PT 4026 BOCM 39 1946.09.28
+#      PT 4153 BOCM 16 1947.04.10
+#      PT 4271 BOCM 48 1947.11.29
+#      PT 4374 BOCM 18 1948.05.01
+#      PT 4465 BOCM 44 1948.10.30
+#      PT 4590 BOCM 14 1949.04.02
+#      PT 4666 BOCM 44 1949.10.29
+#      PT 4771 BOCM 12 1950.03.25
+#      PT 4838 BOCM 43 1950.10.28
+#      PT 4946 BOCM 12 1951.03.24
+#      PT 5025 BO 43 1951.10.27
+#      PT 5149 BO 14 1952.04.05
+#      PT 5251 BO 43 1952.10.25
+#      PT 5366 BO 13 1953.03.28
+#      PT 5444 BO 44 1953.10.31
+#      PT 5540 BO 12 1954.03.20
+#      PT 5589 BO 44 1954.10.30
+#      PT 5676 BO 12 1955.03.19
+#      PT 5739 BO 45 1955.11.05
+#      PT 5823 BO 11 1956.03.17
+#      PT 5891 BO 44 1956.11.03
+#      PT 5981 BO 12 1957.03.23
+#      PT 6064 BO 43 1957.10.26
+#      PT 6172 BO 12 1958.03.22
+#      PT 6243 BO 43 1958.10.25
+#      PT 6341 BO 12 1959.03.21
+#      PT 6411 BO 43 1959.10.24
+#      PT 6514 BO 11 1960.03.12
+#      PT 6584 BO 44 1960.10.29
+#      PT 6721 BO 10 1961.03.11
+#      PT 6815 BO 43 1961.10.28
+#      PT 6947 BO 10 1962.03.10
+#      PT 7080 BO 43 1962.10.27
+#      PT 7218 BO 12 1963.03.23
+#      PT 7340 BO 43 1963.10.26
+#      PT 7491 BO 11 1964.03.14
+#      PT 7664 BO 43 1964.10.24
+#      PT 7846 BO 15 1965.04.10
+#      PT 7979 BO 42 1965.10.16
+#      PT 8146 BO 15 1966.04.09
+#      PT 8252 BO 41 1966.10.08
+#      PT 8429 BO 15 1967.04.15
+#      PT 8540 BO 41 1967.10.14
+#      PT 8735 BO 15 1968.04.13
+#      PT 8860 BO 41 1968.10.12
+#      PT 9035 BO 16 1969.04.19
+#      PT 9156 BO 42 1969.10.18
+#      PT 9328 BO 15 1970.04.11
+#      PT 9418 BO 41 1970.10.10
+#      PT 9587 BO 14 1971.04.03
+#      PT 9702 BO 41 1971.10.09
+#      PT 38-A/72 BO 14 1972.04.01
+#      PT 126-A/72 BO 41 1972.10.07
+#      PT 61/73 BO 14 1973.04.07
+#      PT 182/73 BO 40 1973.10.06
+#      PT 282/73 BO 51 1973.12.22
+#      PT 177/74 BO 41 1974.10.12
+#      PT 51/75 BO 15 1975.04.12
+#      PT 173/75 BO 41 1975.10.11
+#      PT 67/76/M BO 14 1976.04.03
+#      PT 169/76/M BO 41 1976.10.09
+#      PT 78/79/M BO 19 1979.05.12
+#      PT 166/79/M BO 42 1979.10.20
+# Note that DIL 732 does not belong to "HORÁRIO DE VERÃO" according to
+# LegisMac.... Note that between 1942 and 1945, the time switched
+# between GMT+9 and GMT+10.  Also in 1965 and 1965 the DST ended at 2:30am.
+
+# From Paul Eggert (2018-05-10):
+# The 1904 decree says that Macau changed from the meridian of
+# Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT.
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
-Rule   Macau   1961    1962    -       Mar     Sun>=16 3:30    1:00    D
-Rule   Macau   1961    1964    -       Nov     Sun>=1  3:30    0       S
-Rule   Macau   1963    only    -       Mar     Sun>=16 0:00    1:00    D
-Rule   Macau   1964    only    -       Mar     Sun>=16 3:30    1:00    D
-Rule   Macau   1965    only    -       Mar     Sun>=16 0:00    1:00    D
-Rule   Macau   1965    only    -       Oct     31      0:00    0       S
-Rule   Macau   1966    1971    -       Apr     Sun>=16 3:30    1:00    D
-Rule   Macau   1966    1971    -       Oct     Sun>=16 3:30    0       S
-Rule   Macau   1972    1974    -       Apr     Sun>=15 0:00    1:00    D
-Rule   Macau   1972    1973    -       Oct     Sun>=15 0:00    0       S
-Rule   Macau   1974    1977    -       Oct     Sun>=15 3:30    0       S
-Rule   Macau   1975    1977    -       Apr     Sun>=15 3:30    1:00    D
-Rule   Macau   1978    1980    -       Apr     Sun>=15 0:00    1:00    D
-Rule   Macau   1978    1980    -       Oct     Sun>=15 0:00    0       S
-# See Europe/Lisbon for info about the 1912 transition.
+Rule   Macau   1942    1943    -       Apr     30      23:00   1:00    -
+Rule   Macau   1942    only    -       Nov     17      23:00   0       -
+Rule   Macau   1943    only    -       Sep     30      23:00   0       S
+Rule   Macau   1946    only    -       Apr     30      23:00s  1:00    D
+Rule   Macau   1946    only    -       Sep     30      23:00s  0       S
+Rule   Macau   1947    only    -       Apr     19      23:00s  1:00    D
+Rule   Macau   1947    only    -       Nov     30      23:00s  0       S
+Rule   Macau   1948    only    -       May      2      23:00s  1:00    D
+Rule   Macau   1948    only    -       Oct     31      23:00s  0       S
+Rule   Macau   1949    1950    -       Apr     Sat>=1  23:00s  1:00    D
+Rule   Macau   1949    1950    -       Oct     lastSat 23:00s  0       S
+Rule   Macau   1951    only    -       Mar     31      23:00s  1:00    D
+Rule   Macau   1951    only    -       Oct     28      23:00s  0       S
+Rule   Macau   1952    1953    -       Apr     Sat>=1  23:00s  1:00    D
+Rule   Macau   1952    only    -       Nov      1      23:00s  0       S
+Rule   Macau   1953    1954    -       Oct     lastSat 23:00s  0       S
+Rule   Macau   1954    1956    -       Mar     Sat>=17 23:00s  1:00    D
+Rule   Macau   1955    only    -       Nov      5      23:00s  0       S
+Rule   Macau   1956    1964    -       Nov     Sun>=1  03:30   0       S
+Rule   Macau   1957    1964    -       Mar     Sun>=18 03:30   1:00    D
+Rule   Macau   1965    1973    -       Apr     Sun>=16 03:30   1:00    D
+Rule   Macau   1965    1966    -       Oct     Sun>=16 02:30   0       S
+Rule   Macau   1967    1976    -       Oct     Sun>=16 03:30   0       S
+Rule   Macau   1973    only    -       Dec     30      03:30   1:00    D
+Rule   Macau   1975    1976    -       Apr     Sun>=16 03:30   1:00    D
+Rule   Macau   1979    only    -       May     13      03:30   1:00    D
+Rule   Macau   1979    only    -       Oct     Sun>=16 03:30   0       S
+
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Asia/Macau      7:34:20 -       LMT     1911 Dec 31 16:00u
+Zone   Asia/Macau      7:34:10 -       LMT     1904 Oct 30
+                       8:00    -       CST     1941 Dec 21 23:00
+                       9:00    Macau   +09/+10 1945 Sep 30 24:00
                        8:00    Macau   C%sT
 
 
@@ -1471,9 +1631,29 @@ Zone     Asia/Jerusalem  2:20:54 -       LMT     1880
 # http://www.shugiin.go.jp/internet/itdb_housei.nsf/html/houritsu/00719500331039.htm
 # ... In summary, it is written as follows.  From 24:00 on the first Saturday
 # in May, until 0:00 on the day after the second Saturday in September.
+
+# From Phake Nick (2018-09-27):
+# [T]he webpage authored by National Astronomical Observatory of Japan
+# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EF.html
+# ... mentioned that using Showa 23 (year 1948) as example, 13pm of September
+# 11 in summer time will equal to 0am of September 12 in standard time.
+# It cited a document issued by the Liaison Office which briefly existed
+# during the postwar period of Japan, where the detail on implementation
+# of the summer time is described in the document.
+# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EFB2C6BBFEB9EFA4CEBCC2BBDCA4CBA4C4A4A4A4C6.pdf
+# The text in the document do instruct a fall back to occur at
+# September 11, 13pm in summer time, while ordinary citizens can
+# change the clock before they sleep.
+#
+# From Paul Eggert (2018-09-27):
+# This instruction is equivalent to "Sat>=8 25:00", so use that.  zic treats
+# it like "Sun>=9 01:00", which is not quite the same but is the best we can
+# do in any POSIX or C platform.  The "25:00" assumes zic from 2007 or later,
+# which should be safe now.
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Japan   1948    only    -       May     Sat>=1  24:00   1:00    D
-Rule   Japan   1948    1951    -       Sep     Sun>=9   0:00   0       S
+Rule   Japan   1948    1951    -       Sep     Sat>=8  25:00   0       S
 Rule   Japan   1949    only    -       Apr     Sat>=1  24:00   1:00    D
 Rule   Japan   1950    1951    -       May     Sat>=1  24:00   1:00    D
 
@@ -1855,7 +2035,7 @@ Zone      Asia/Aqtobe     3:48:40 -       LMT     1924 May  2
                        5:00    -       +05
 # Mangghystaū (KZ-MAN)
 # Aqtau was not founded until 1963, but it represents an inhabited region,
-# so include time stamps before 1963.
+# so include timestamps before 1963.
 Zone   Asia/Aqtau      3:21:04 -       LMT     1924 May  2
                        4:00    -       +04     1930 Jun 21
                        5:00    -       +05     1981 Oct  1
@@ -1995,6 +2175,10 @@ Rule     ROK     1987    1988    -       Oct     Sun>=8  3:00    0       S
 # Assembly, as published in Rodong Sinmun.
 # From Tim Parenti (2018-04-29):
 # It appears to be the front page story at the top in the right-most column.
+#
+# From Paul Eggert (2018-05-04):
+# The BBC reported that the transition was from 23:30 to 24:00 today.
+# https://www.bbc.com/news/world-asia-44010705
 
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Seoul      8:27:52 -       LMT     1908 Apr  1
@@ -2007,7 +2191,7 @@ Zone      Asia/Pyongyang  8:23:00 -       LMT     1908 Apr  1
                        8:30    -       KST     1912 Jan  1
                        9:00    -       JST     1945 Aug 24
                        9:00    -       KST     2015 Aug 15 00:00
-                       8:30    -       KST     2018 May  5
+                       8:30    -       KST     2018 May  4 23:30
                        9:00    -       KST
 
 ###############################################################################
@@ -2757,19 +2941,35 @@ Zone    Asia/Hebron     2:20:23 -       LMT     1900 Oct
 # Philippine Star 2014-08-05
 # http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time
 
+# From Paul Goyette (2018-06-15):
+# In the Philippines, there is a national law, Republic Act No. 10535
+# which declares the official time here as "Philippine Standard Time".
+# The act [1] even specifies use of PST as the abbreviation, although
+# the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish
+# it from the Pacific Standard Time (PST)."
+# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/
+# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535
+#
+# From Paul Eggert (2018-06-19):
+# I surveyed recent news reports, and my impression is that "PST" is
+# more popular among reliable English-language news sources.  This is
+# not just a measure of Google hit counts: it's also the sizes and
+# influence of the sources.  There is no current abbreviation for DST,
+# so use "PDT", the usual American style.
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
-Rule   Phil    1936    only    -       Nov     1       0:00    1:00    -
-Rule   Phil    1937    only    -       Feb     1       0:00    0       -
-Rule   Phil    1954    only    -       Apr     12      0:00    1:00    -
-Rule   Phil    1954    only    -       Jul     1       0:00    0       -
-Rule   Phil    1978    only    -       Mar     22      0:00    1:00    -
-Rule   Phil    1978    only    -       Sep     21      0:00    0       -
+Rule   Phil    1936    only    -       Nov     1       0:00    1:00    D
+Rule   Phil    1937    only    -       Feb     1       0:00    0       S
+Rule   Phil    1954    only    -       Apr     12      0:00    1:00    D
+Rule   Phil    1954    only    -       Jul     1       0:00    0       S
+Rule   Phil    1978    only    -       Mar     22      0:00    1:00    D
+Rule   Phil    1978    only    -       Sep     21      0:00    0       S
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Manila     -15:56:00 -     LMT     1844 Dec 31
                        8:04:00 -       LMT     1899 May 11
-                       8:00    Phil    +08/+09 1942 May
-                       9:00    -       +09     1944 Nov
-                       8:00    Phil    +08/+09
+                       8:00    Phil    P%sT    1942 May
+                       9:00    -       JST     1944 Nov
+                       8:00    Phil    P%sT
 
 # Qatar
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
@@ -2780,15 +2980,34 @@ Link Asia/Qatar Asia/Bahrain
 
 # Saudi Arabia
 #
-# From Paul Eggert (2014-07-15):
+# From Paul Eggert (2018-08-29):
 # Time in Saudi Arabia and other countries in the Arabian peninsula was not
-# standardized until relatively recently; we don't know when, and possibly it
+# standardized until 1968 or so; we don't know exactly when, and possibly it
 # has never been made official.  Richard P Hunt, in "Islam city yielding to
 # modern times", New York Times (1961-04-09), p 20, wrote that only airlines
 # observed standard time, and that people in Jeddah mostly observed quasi-solar
 # time, doing so by setting their watches at sunrise to 6 o'clock (or to 12
 # o'clock for "Arab" time).
 #
+# Timekeeping differed depending on who you were and which part of Saudi
+# Arabia you were in.  In 1969, Elias Antar wrote that although a common
+# practice had been to set one's watch to 12:00 (i.e., midnight) at sunset -
+# which meant that the time on one side of a mountain could differ greatly from
+# the time on the other side - many foreigners set their watches to 6pm
+# instead, while airlines instead used UTC +03 (except in Dhahran, where they
+# used UTC +04), Aramco used UTC +03 with DST, and the Trans-Arabian Pipe Line
+# Company used Aramco time in eastern Saudi Arabia and airline time in western.
+# (The American Military Aid Advisory Group used plain UTC.)  Antar writes,
+# "A man named Higgins, so the story goes, used to run a local power
+# station. One day, the whole thing became too much for Higgins and he
+# assembled his staff and laid down the law. 'I've had enough of this,' he
+# shrieked. 'It is now 12 o'clock Higgins Time, and from now on this station is
+# going to run on Higgins Time.' And so, until last year, it did."  See:
+# Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3.
+# http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm
+# newspapers.com says a similar story about Higgins was published in the Port
+# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text.
+#
 # The TZ database cannot represent quasi-solar time; airline time is the best
 # we can do.  The 1946 foreign air news digest of the U.S. Civil Aeronautics
 # Board (OCLC 42299995) reported that the "... Arabian Government, inaugurated
@@ -2798,7 +3017,8 @@ Link Asia/Qatar Asia/Bahrain
 #
 # Shanks & Pottenger also state that until 1968-05-01 Saudi Arabia had two
 # 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.
+# the country.  Presumably this is documenting airline time.  Ignore this,
+# as it's before our 1970 cutoff.
 #
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Riyadh     3:06:52 -       LMT     1947 Mar 14
index e3e79f1..87ba620 100644 (file)
@@ -1,3 +1,5 @@
+# tzdb data for Australasia and environs, and for much of the Pacific
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -361,8 +363,15 @@ Zone       Indian/Cocos    6:27:40 -       LMT     1900
 # Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing
 # Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27),
 # [Legal Notice No. 41] of an order of the previous day by J Usamate.
+
+# From Raymond Kumar (2018-07-13):
+# http://www.fijitimes.com/government-approves-2018-daylight-saving/
+# ... The daylight saving period will end at 3am on Sunday January 13, 2019.
+#
+# From Paul Eggert (2018-07-15):
 # For now, guess DST from 02:00 the first Sunday in November to 03:00
-# the first Sunday on or after January 14.  Although ad hoc, it matches
+# the first Sunday on or after January 13.  January transitions reportedly
+# depend on when school terms start.  Although the guess is ad hoc, it matches
 # transitions since late 2014 and seems more likely to match future
 # practice than guessing no DST.
 
@@ -376,7 +385,7 @@ Rule        Fiji    2011    only    -       Mar     Sun>=1  3:00    0       -
 Rule   Fiji    2012    2013    -       Jan     Sun>=18 3:00    0       -
 Rule   Fiji    2014    only    -       Jan     Sun>=18 2:00    0       -
 Rule   Fiji    2014    max     -       Nov     Sun>=1  2:00    1:00    -
-Rule   Fiji    2015    max     -       Jan     Sun>=14 3:00    0       -
+Rule   Fiji    2015    max     -       Jan     Sun>=13 3:00    0       -
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Pacific/Fiji    11:55:44 -      LMT     1915 Oct 26 # Suva
                        12:00   Fiji    +12/+13
index 2141f0d..51e10f4 100644 (file)
--- a/backward
+++ b/backward
@@ -1,7 +1,9 @@
+# tzdb links for backward compatibility
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
-# This file provides links between current names for time zones
+# This file provides links between current names for timezones
 # and their old names.  Many names changed in late 1993.
 
 # Link TARGET                  LINK-NAME
index d1fd83b..97792b1 100644 (file)
--- a/backzone
+++ b/backzone
 # the file 'backward'.
 
 # Although zones in this file may be of some use for analyzing
-# pre-1970 time stamps, they are less reliable, cover only a tiny
+# pre-1970 timestamps, they are less reliable, cover only a tiny
 # sliver of the pre-1970 era, and cannot feasibly be improved to cover
 # most of the era.  Because the zones are out of normal scope for the
 # database, less effort is put into maintaining this file.  Many of
 # the zones were formerly in other source files, but were removed or
 # replaced by links as their data entries were questionable and/or they
-# differed from other zones only in pre-1970 time stamps.
+# differed from other zones only in pre-1970 timestamps.
 
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
diff --git a/date.1 b/date.1
index 28dc1d7..6e79cc1 100644 (file)
--- a/date.1
+++ b/date.1
@@ -146,11 +146,11 @@ should be an integer, either decimal, octal (leading 0), or
 hexadecimal (leading 0x), preceded by an optional sign.
 .SH FILES
 .ta \w'/usr/share/zoneinfo/posixrules\0\0'u
-/etc/localtime local time zone file
+/etc/localtime local timezone file
 .br
 /usr/lib/locale/\f2L\fP/LC_TIME        description of time locale \f2L\fP
 .br
-/usr/share/zoneinfo    time zone information directory
+/usr/share/zoneinfo    timezone information directory
 .br
 /usr/share/zoneinfo/posixrules used with POSIX-style TZ's
 .br
index de500a3..dde2b71 100644 (file)
@@ -95,9 +95,9 @@ DESCRIPTION
               preceded by an optional sign.
 
 FILES
-       /etc/localtime                  local time zone file
+       /etc/localtime                  local timezone file
        /usr/lib/locale/L/LC_TIME       description of time locale L
-       /usr/share/zoneinfo             time zone information directory
+       /usr/share/zoneinfo             timezone information directory
        /usr/share/zoneinfo/posixrules  used with POSIX-style TZ's
        /usr/share/zoneinfo/GMT         for UTC leap seconds
 
index 856234a..7b96927 100644 (file)
@@ -1,3 +1,5 @@
+/* Return the difference between two timestamps.  */
+
 /*
 ** This file is in the public domain, so clarified as of
 ** 1996-06-05 by Arthur David Olson.
index f5fa4c9..91ded93 100644 (file)
--- a/etcetera
+++ b/etcetera
@@ -1,9 +1,11 @@
+# tzdb data for ships at sea and other miscellany
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
 # These entries are mostly present for historical reasons, so that
 # people in areas not otherwise covered by the tz files could "zic -l"
-# to a time zone that was right for their area.  These days, the
+# to a timezone that was right for their area.  These days, the
 # tz files cover almost all the inhabited world, and the only practical
 # need now for the entries that are not on UTC are for ships at sea
 # that cannot use POSIX TZ settings.
diff --git a/europe b/europe
index 6994ed8..5b0a829 100644 (file)
--- a/europe
+++ b/europe
@@ -1,3 +1,5 @@
+# tzdb data for Europe and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -517,7 +519,7 @@ Link        Europe/London   Europe/Isle_of_Man
 #
 # To work around this problem, the build procedure can translate the
 # following data into two forms, one with negative SAVE values and the
-# other form with a traditional approximation for Irish time stamps
+# other form with a traditional approximation for Irish timestamps
 # after 1971-10-31 02:00 UTC; although this approximation has tm_isdst
 # flags that are reversed, its UTC offsets are correct and this often
 # suffices.  This source file currently uses only nonnegative SAVE
@@ -2427,6 +2429,33 @@ Zone Europe/Bucharest    1:44:24 -       LMT     1891 Oct
 # administratively part of Sakhalin oblast', they appear to have
 # remained on UTC+11 along with Magadan.
 
+# From Marat Nigametzianov (2018-07-16):
+# this is link to order from 1956 about timezone in USSR
+# http://astro.uni-altai.ru/~orion/blog/2011/11/novyie-granitsyi-chasovyih-poyasov-v-sssr/
+#
+# From Paul Eggert (2018-07-16):
+# Perhaps someone could translate the above-mentioned link and use it
+# to correct our data for the ex-Soviet Union.  It cites the following:
+# «Поясное время и новые границы часовых поясов» / сост. П.Н. Долгов,
+# отв. ред. Г.Д. Бурдун - М: Комитет стандартов, мер и измерительных
+# приборов при Совете Министров СССР, Междуведомственная комиссия
+# единой службы времени, 1956 г.
+# This book looks like it would be a helpful resource for the Soviet
+# Union through 1956.  Although a copy was in the Scientific Library
+# of Tomsk State University, I have not been able to track down a copy nearby.
+#
+# From Stepan Golosunov (2018-07-21):
+# http://astro.uni-altai.ru/~orion/blog/2015/05/center-reforma-ischisleniya-vremeni-br-na-territorii-sssr-v-1957-godu-center/
+# says that the 1956 decision to change time belts' borders was not
+# implemented as planned in 1956 and the change happened in 1957.
+# There is also the problem that actual time zones were different from
+# the official time belts (and from many time belts' maps) as there were
+# numerous exceptions to application of time belt rules.  For example,
+# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток
+# says that by 1962 there were many regions in the 3rd time belt that
+# were on Moscow time, referring to a 1962 map.  By 1989 number of such
+# exceptions grew considerably.
+
 # From Tim Parenti (2014-07-06):
 # The comments detailing the coverage of each Russian zone are meant to assist
 # with maintenance only and represent our best guesses as to which regions
@@ -2437,9 +2466,6 @@ Zone Europe/Bucharest     1:44:24 -       LMT     1891 Oct
 # future stability.  ISO 3166-2:RU codes are also listed for first-level
 # divisions where available.
 
-# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-
-
 # From Tim Parenti (2014-07-03):
 # Europe/Kaliningrad covers...
 # 39   RU-KGD  Kaliningrad Oblast
@@ -2707,6 +2733,15 @@ Zone Europe/Astrakhan     3:12:12 -      LMT     1924 May
 # 34   RU-VGG  Volgograd Oblast
 # The 1988 transition is from USSR act No. 5 (1988-01-04).
 
+# From Alexander Fetisov (2018-09-20):
+# Volgograd region in southern Russia (Europe/Volgograd) change
+# timezone from UTC+3 to UTC+4 from 28oct2018.
+# http://sozd.parliament.gov.ru/bill/452878-7
+#
+# From Stepan Golosunov (2018-10-11):
+# The law has been published today on
+# http://publication.pravo.gov.ru/Document/View/0001201810110037
+
 Zone Europe/Volgograd   2:57:40 -      LMT     1920 Jan  3
                         3:00   -       +03     1930 Jun 21
                         4:00   -       +04     1961 Nov 11
@@ -2715,7 +2750,8 @@ Zone Europe/Volgograd      2:57:40 -      LMT     1920 Jan  3
                         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
+                        3:00   -       +03     2018 Oct 28  2:00s
+                        4:00   -       +04
 
 # From Paul Eggert (2016-11-11):
 # Europe/Saratov covers:
@@ -3424,6 +3460,7 @@ Zone      Africa/Ceuta    -0:21:16 -      LMT     1900 Dec 31 23:38:44
                         0:00   1:00    WEST    1918 Oct  7 23:00
                         0:00   -       WET     1924
                         0:00   Spain   WE%sT   1929
+                        0:00   -       WET     1967 # Help zishrink.awk.
                         0:00 SpainAfrica WE%sT 1984 Mar 16
                         1:00   -       CET     1986
                         1:00   EU      CE%sT
@@ -3609,7 +3646,7 @@ Zone      Europe/Zurich   0:34:08 -       LMT     1853 Jul 16 # See above comment.
 # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2  - for 2001
 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2  - for 2002-2006
 # From Paul Eggert (2016-09-25):
-# Prefer the above sources to Shanks & Pottenger for time stamps after 1985.
+# Prefer the above sources to Shanks & Pottenger for timestamps after 1985.
 
 # From Steffen Thorsen (2007-03-09):
 # Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
@@ -3819,10 +3856,29 @@ Link    Europe/Istanbul Asia/Istanbul   # Istanbul is in both continents.
 # * Ukrainian Government's Resolution of 20.03.1992, No. 139.
 # http://www.uazakon.com/documents/date_8u/pg_grcasa.htm
 
+# From Paul Eggert (2018-10-03):
+# As is usual in tzdb, Ukrainian zones use the most common English spellings.
+# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in
+# English for Ukraine's capital, even though it is certainly wrong as a
+# transliteration of the Ukrainian "Київ".  This is similar to tzdb's use of
+# Europe/Prague, which is certainly wrong as a transliteration of the Czech
+# "Praha".  ("Kiev" came from old Slavic via Russian to English, and "Prague"
+# came from old Slavic via French to English, so the two cases have something
+# in common.)  Admittedly English-language spelling of Ukrainian names is
+# controversial, and some day "Kyiv" may become substantially more popular in
+# English; in the meantime, stick with the traditional English "Kiev" as that
+# means less disruption for our users.
+#
+# Anyway, none of the common English-language spellings (Kiev, Kyiv, Kieff,
+# Kijeff, Kijev, Kiyef, Kiyeff) do justice to the common pronunciation in
+# Ukrainian, namely [ˈkɪjiu̯] (IPA).  This pronunciation has nothing like an
+# English "v" or "f", and instead trails off with what an English-speaker
+# would call a demure "oo" sound, and it would would be better anglicized as
+# "Kuiyu".  Here's a sound file, if you would like to do as the Kuiyuvians do:
+# https://commons.wikimedia.org/wiki/File:Uk-Київ.ogg
+
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-# Most of Ukraine since 1970 has been like Kiev.
-# "Kyiv" is the transliteration of the Ukrainian name, but
-# "Kiev" is more common in English.
+# This represents most of Ukraine.  See above for the spelling of "Kiev".
 Zone Europe/Kiev       2:02:04 -       LMT     1880
                        2:02:04 -       KMT     1924 May  2 # Kiev Mean Time
                        2:00    -       EET     1930 Jun 21
diff --git a/factory b/factory
index 75fa4a1..d4e7659 100644 (file)
--- a/factory
+++ b/factory
@@ -1,8 +1,10 @@
+# tzdb data for noncommittal factory settings
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
-# For distributors who don't want to put time zone specification in
-# their installation procedures.  Users that run 'date' will get the
+# For distributors who don't want to specify a timezone in their
+# installation procedures.  Users who run 'date' will get the
 # time zone abbreviation "-00", indicating that the actual time zone
 # is unknown.
 
index eab6ab8..cf54b9a 100644 (file)
 #      current -- the update time stamp, the data and the name of the file
 #      will not change.
 #
-#      Updated through IERS Bulletin C55
-#      File expires on:  28 December 2018
+#      Updated through IERS Bulletin C56
+#      File expires on:  28 June 2019
 #
-#@     3754944000
+#@     3770668800
 #
 2272060800     10      # 1 Jan 1972
 2287785600     11      # 1 Jul 1972
 #      the hash line is also ignored in the
 #      computation.
 #
-#h     44dcf58c e28d25aa b36612c8 f3d3e8b5 a8fdf478
+#h     62ca19f6 96a4ae0a 3708451c 9f8693f4 016604eb
index 358e741..148aa8e 100644 (file)
@@ -3,21 +3,25 @@
 # This file is in the public domain.
 
 # This file is generated automatically from the data in the public-domain
-# leap-seconds.list file, which is copied from:
-# ftp://ftp.nist.gov/pub/time/leap-seconds.list
+# leap-seconds.list file, which can be copied from
+# <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
+# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>
+# or <ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list>.
 # For more about leap-seconds.list, please see
 # The NTP Timescale and Leap Seconds
-# https://www.eecis.udel.edu/~mills/leap.html
+# <https://www.eecis.udel.edu/~mills/leap.html>.
 
 # The International Earth Rotation and Reference Systems Service
 # periodically uses leap seconds to keep UTC to within 0.9 s of UT1
-# (which measures the true angular orientation of the earth in space); see
-# Levine J. Coordinated Universal Time and the leap second.
+# (which measures the true angular orientation of the earth in space)
+# and publishes leap second data in a copyrighted file
+# <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>.
+# See: Levine J. Coordinated Universal Time and the leap second.
 # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
-# http://ieeexplore.ieee.org/document/7909995/
+# <https://ieeexplore.ieee.org/document/7909995>.
 # There were no leap seconds before 1972, because the official mechanism
 # accounting for the discrepancy between atomic time and the earth's rotation
-# did not exist until the early 1970s.
+# did not exist.
 
 # The correction (+ or -) is made at the given time, so lines
 # will typically look like:
 # or
 #      Leap    YEAR    MON     DAY     23:59:59        -       R/S
 
-# If the leapsecond is Rolling (R) the given time is local time.
-# If the leapsecond is Stationary (S) the given time is UTC.
-
-# Leap YEAR    MONTH   DAY     HH:MM:SS        CORR    R/S
+# If the leap second is Rolling (R) the given time is local time (unused here).
 Leap   1972    Jun     30      23:59:60        +       S
 Leap   1972    Dec     31      23:59:60        +       S
 Leap   1973    Dec     31      23:59:60        +       S
@@ -57,5 +58,9 @@ 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 C55
-#      File expires on:  28 December 2018
+# POSIX timestamps for the data in this file:
+#updated 1467936000
+#expires 1561680000
+
+#      Updated through IERS Bulletin C56
+#      File expires on:  28 June 2019
index 66eb64d..ea0567c 100644 (file)
@@ -8,21 +8,25 @@ BEGIN {
   print "# This file is in the public domain."
   print ""
   print "# This file is generated automatically from the data in the public-domain"
-  print "# leap-seconds.list file, which is copied from:"
-  print "# ftp://ftp.nist.gov/pub/time/leap-seconds.list"
+  print "# leap-seconds.list file, which can be copied from"
+  print "# <ftp://ftp.nist.gov/pub/time/leap-seconds.list>"
+  print "# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>"
+  print "# or <ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list>."
   print "# For more about leap-seconds.list, please see"
   print "# The NTP Timescale and Leap Seconds"
-  print "# https://www.eecis.udel.edu/~mills/leap.html"
+  print "# <https://www.eecis.udel.edu/~mills/leap.html>."
   print ""
   print "# The International Earth Rotation and Reference Systems Service"
   print "# periodically uses leap seconds to keep UTC to within 0.9 s of UT1"
-  print "# (which measures the true angular orientation of the earth in space); see"
-  print "# Levine J. Coordinated Universal Time and the leap second."
+  print "# (which measures the true angular orientation of the earth in space)"
+  print "# and publishes leap second data in a copyrighted file"
+  print "# <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>."
+  print "# See: Levine J. Coordinated Universal Time and the leap second."
   print "# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995"
-  print "# http://ieeexplore.ieee.org/document/7909995/"
+  print "# <https://ieeexplore.ieee.org/document/7909995>."
   print "# There were no leap seconds before 1972, because the official mechanism"
   print "# accounting for the discrepancy between atomic time and the earth's rotation"
-  print "# did not exist until the early 1970s."
+  print "# did not exist."
   print ""
   print "# The correction (+ or -) is made at the given time, so lines"
   print "# will typically look like:"
@@ -30,18 +34,35 @@ BEGIN {
   print "# or"
   print "#     Leap    YEAR    MON     DAY     23:59:59        -       R/S"
   print ""
-  print "# If the leapsecond is Rolling (R) the given time is local time."
-  print "# If the leapsecond is Stationary (S) the given time is UTC."
-  print ""
-  print "# Leap        YEAR    MONTH   DAY     HH:MM:SS        CORR    R/S"
-}
+  print "# If the leap second is Rolling (R) the given time is local time (unused here)."
 
-/^ *$/ { next }
+  monthabbr[ 1] = "Jan"
+  monthabbr[ 2] = "Feb"
+  monthabbr[ 3] = "Mar"
+  monthabbr[ 4] = "Apr"
+  monthabbr[ 5] = "May"
+  monthabbr[ 6] = "Jun"
+  monthabbr[ 7] = "Jul"
+  monthabbr[ 8] = "Aug"
+  monthabbr[ 9] = "Sep"
+  monthabbr[10] = "Oct"
+  monthabbr[11] = "Nov"
+  monthabbr[12] = "Dec"
+  for (i in monthabbr) {
+      monthnum[monthabbr[i]] = i
+      monthlen[i] = 31
+  }
+  monthlen[2] = 28
+  monthlen[4] = monthlen[6] = monthlen[9] = monthlen[11] = 30
+}
 
 /^#\tUpdated through/ || /^#\tFile expires on:/ {
     last_lines = last_lines $0 "\n"
 }
 
+/^#[$][ \t]/ { updated = $2 }
+/^#[@][ \t]/ { expires = $2 }
+
 /^#/ { next }
 
 {
@@ -57,19 +78,28 @@ BEGIN {
        } else {
            sign = "23:59:59\t-"
        }
-       if (month == "Jan") {
+       m = monthnum[month] - 1
+       if (m == 0) {
            year--;
-           month = "Dec";
-           day = 31
-       } else if (month == "Jul") {
-           month = "Jun";
-           day = 30
+           m = 12
        }
+       month = monthabbr[m]
+       day = monthlen[m]
+       day += m == 2 && year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
        printf "Leap\t%s\t%s\t%s\t%s\tS\n", year, month, day, sign
     }
     old_TAI_minus_UTC = TAI_minus_UTC
 }
 
 END {
+    # The difference between the NTP and POSIX epochs is 70 years
+    # (including 17 leap days), each 24 hours of 60 minutes of 60
+    # seconds each.
+    epoch_minus_NTP = ((1970 - 1900) * 365 + 17) * 24 * 60 * 60
+
+    print ""
+    print "# POSIX timestamps for the data in this file:"
+    printf "#updated %s\n", updated - epoch_minus_NTP
+    printf "#expires %s\n", expires - epoch_minus_NTP
     printf "\n%s", last_lines
 }
index 5b5a5b1..6b45254 100644 (file)
@@ -1,3 +1,5 @@
+/* Convert timestamp from time_t to struct tm.  */
+
 /*
 ** This file is in the public domain, so clarified as of
 ** 1996-06-05 by Arthur David Olson.
@@ -131,7 +133,11 @@ struct state {
        char            chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, sizeof gmt),
                                (2 * (MY_TZNAME_MAX + 1)))];
        struct lsinfo   lsis[TZ_MAX_LEAPS];
-       int             defaulttype; /* for early times or if no transitions */
+
+       /* The time type to use for early times or if no transitions.
+          It is always zero for recent tzdb releases.
+          It might be nonzero for data from tzdb 2018e or earlier.  */
+       int defaulttype;
 };
 
 enum r_type {
@@ -296,7 +302,7 @@ settzname(void)
                return;
        }
        /*
-       ** And to get the latest zone names into tzname. . .
+       ** And to get the latest time zone abbreviations into tzname. . .
        */
        for (i = 0; i < sp->typecnt; ++i) {
                register const struct ttinfo * const    ttisp = &sp->ttis[i];
@@ -446,8 +452,11 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                int_fast32_t typecnt = detzcode(up->tzhead.tzh_typecnt);
                int_fast32_t charcnt = detzcode(up->tzhead.tzh_charcnt);
                char const *p = up->buf + tzheadsize;
+               /* Although tzfile(5) currently requires typecnt to be nonzero,
+                  support future formats that may allow zero typecnt
+                  in files that have a TZ string and no transitions.  */
                if (! (0 <= leapcnt && leapcnt < TZ_MAX_LEAPS
-                      && 0 < typecnt && typecnt < TZ_MAX_TYPES
+                      && 0 <= typecnt && typecnt < TZ_MAX_TYPES
                       && 0 <= timecnt && timecnt < TZ_MAX_TIMES
                       && 0 <= charcnt && charcnt < TZ_MAX_CHARS
                       && (ttisstdcnt == typecnt || ttisstdcnt == 0)
@@ -583,8 +592,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                        struct state    *ts = &lsp->u.st;
 
                        up->buf[nread - 1] = '\0';
-                       if (tzparse(&up->buf[1], ts, false)
-                           && ts->typecnt == 2) {
+                       if (tzparse(&up->buf[1], ts, false)) {
 
                          /* Attempt to reuse existing abbreviations.
                             Without this, America/Anchorage would be right on
@@ -595,7 +603,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                             stay 40 in this example.  */
                          int gotabbr = 0;
                          int charcnt = sp->charcnt;
-                         for (i = 0; i < 2; i++) {
+                         for (i = 0; i < ts->typecnt; i++) {
                            char *tsabbr = ts->chars + ts->ttis[i].tt_abbrind;
                            int j;
                            for (j = 0; j < charcnt; j++)
@@ -614,7 +622,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                              }
                            }
                          }
-                         if (gotabbr == 2) {
+                         if (gotabbr == ts->typecnt) {
                            sp->charcnt = charcnt;
 
                            /* Ignore any trailing, no-op transitions generated
@@ -626,7 +634,8 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                              sp->timecnt--;
 
                            for (i = 0; i < ts->timecnt; i++)
-                             if (sp->ats[sp->timecnt - 1] < ts->ats[i])
+                             if (sp->timecnt == 0
+                                 || sp->ats[sp->timecnt - 1] < ts->ats[i])
                                break;
                            while (i < ts->timecnt
                                   && sp->timecnt < TZ_MAX_TIMES) {
@@ -636,11 +645,13 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                              sp->timecnt++;
                              i++;
                            }
-                           sp->ttis[sp->typecnt++] = ts->ttis[0];
-                           sp->ttis[sp->typecnt++] = ts->ttis[1];
+                           for (i = 0; i < ts->typecnt; i++)
+                             sp->ttis[sp->typecnt++] = ts->ttis[i];
                          }
                        }
        }
+       if (sp->typecnt == 0)
+         return EINVAL;
        if (sp->timecnt > 1) {
                for (i = 1; i < sp->timecnt; ++i)
                        if (typesequiv(sp, sp->types[i], sp->types[0]) &&
@@ -657,6 +668,17 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                                        break;
                }
        }
+
+       /* Infer sp->defaulttype from the data.  Although this default
+          type is always zero for data from recent tzdb releases,
+          things are trickier for data from tzdb 2018e or earlier.
+
+          The first set of heuristics work around bugs in 32-bit data
+          generated by tzdb 2013c or earlier.  The workaround is for
+          zones like Australia/Macquarie where timestamps before the
+          first transition have a time type that is not the earliest
+          standard-time type.  See:
+          https://mm.icann.org/pipermail/tz/2013-May/019368.html */
        /*
        ** If type 0 is unused in transitions,
        ** it's the type to use for early times.
@@ -678,6 +700,9 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                        if (!sp->ttis[i].tt_isdst)
                                break;
        }
+       /* The next heuristics are for data generated by tzdb 2018e or
+          earlier, for zones like EST5EDT where the first transition
+          is to DST.  */
        /*
        ** If no result yet, find the first standard type.
        ** If there is none, punt to type zero.
@@ -690,7 +715,12 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                                break;
                        }
        }
+       /* A simple 'sp->defaulttype = 0;' would suffice here if we
+          didn't have to worry about 2018e-or-earlier data.  Even
+          simpler would be to remove the defaulttype member and just
+          use 0 in its place.  */
        sp->defaulttype = i;
+
        return 0;
 }
 
@@ -746,9 +776,9 @@ static const int    year_lengths[2] = {
 };
 
 /*
-** Given a pointer into a time zone string, scan until a character that is not
-** a valid character in a zone name is found. Return a pointer to that
-** character.
+** Given a pointer into a timezone string, scan until a character that is not
+** a valid character in a time zone abbreviation is found.
+** Return a pointer to that character.
 */
 
 static const char *
@@ -763,8 +793,9 @@ getzname(register const char *strp)
 }
 
 /*
-** Given a pointer into an extended time zone string, scan until the ending
-** delimiter of the zone name is located. Return a pointer to the delimiter.
+** Given a pointer into an extended timezone string, scan until the ending
+** delimiter of the time zone abbreviation is located.
+** Return a pointer to the delimiter.
 **
 ** As with getzname above, the legal character set is actually quite
 ** restricted, with other characters producing undefined results.
@@ -782,7 +813,7 @@ getqzname(register const char *strp, const int delim)
 }
 
 /*
-** Given a pointer into a time zone string, extract a number from that string.
+** Given a pointer into a timezone string, extract a number from that string.
 ** Check that the number is within a specified range; if it is not, return
 ** NULL.
 ** Otherwise, return a pointer to the first character not part of the number.
@@ -810,7 +841,7 @@ getnum(register const char *strp, int *const nump, const int min, const int max)
 }
 
 /*
-** Given a pointer into a time zone string, extract a number of seconds,
+** Given a pointer into a timezone string, extract a number of seconds,
 ** in hh[:mm[:ss]] form, from the string.
 ** If any error occurs, return NULL.
 ** Otherwise, return a pointer to the first character not part of the number
@@ -851,7 +882,7 @@ getsecs(register const char *strp, int_fast32_t *const secsp)
 }
 
 /*
-** Given a pointer into a time zone string, extract an offset, in
+** Given a pointer into a timezone string, extract an offset, in
 ** [+-]hh[:mm[:ss]] form, from the string.
 ** If any error occurs, return NULL.
 ** Otherwise, return a pointer to the first character not part of the time.
@@ -876,7 +907,7 @@ getoffset(register const char *strp, int_fast32_t *const offsetp)
 }
 
 /*
-** Given a pointer into a time zone string, extract a rule in the form
+** Given a pointer into a timezone string, extract a rule in the form
 ** date[/time]. See POSIX section 8 for the format of "date" and "time".
 ** If a valid rule is not found, return NULL.
 ** Otherwise, return a pointer to the first character not part of the rule.
@@ -1078,7 +1109,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
                } else {
                        dstname = name;
                        name = getzname(name);
-                       dstlen = name - dstname; /* length of DST zone name */
+                       dstlen = name - dstname; /* length of DST abbr. */
                }
                if (!dstlen)
                  return false;
@@ -1115,8 +1146,8 @@ tzparse(const char *name, struct state *sp, bool lastditch)
                        /*
                        ** Two transitions per year, from EPOCH_YEAR forward.
                        */
-                       init_ttinfo(&sp->ttis[0], -dstoffset, true, stdlen + 1);
-                       init_ttinfo(&sp->ttis[1], -stdoffset, false, 0);
+                       init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
+                       init_ttinfo(&sp->ttis[1], -dstoffset, true, stdlen + 1);
                        sp->defaulttype = 0;
                        timecnt = 0;
                        janfirst = 0;
@@ -1157,17 +1188,14 @@ tzparse(const char *name, struct state *sp, bool lastditch)
                                        if (! increment_overflow_time
                                            (&sp->ats[timecnt],
                                             janoffset + starttime))
-                                         sp->types[timecnt++] = reversed;
-                                       else if (janoffset)
-                                         sp->defaulttype = reversed;
+                                         sp->types[timecnt++] = !reversed;
                                        sp->ats[timecnt] = janfirst;
                                        if (! increment_overflow_time
                                            (&sp->ats[timecnt],
                                             janoffset + endtime)) {
-                                         sp->types[timecnt++] = !reversed;
+                                         sp->types[timecnt++] = reversed;
                                          yearlim = year + YEARSPERREPEAT + 1;
-                                       } else if (janoffset)
-                                         sp->defaulttype = !reversed;
+                                       }
                                }
                                if (increment_overflow_time
                                    (&janfirst, janoffset + yearsecs))
@@ -1175,9 +1203,10 @@ tzparse(const char *name, struct state *sp, bool lastditch)
                                janoffset = 0;
                        }
                        sp->timecnt = timecnt;
-                       if (! timecnt)
+                       if (! timecnt) {
+                               sp->ttis[0] = sp->ttis[1];
                                sp->typecnt = 1;        /* Perpetual DST.  */
-                       else if (YEARSPERREPEAT < year - yearbeg)
+                       else if (YEARSPERREPEAT < year - yearbeg)
                                sp->goback = sp->goahead = true;
                } else {
                        register int_fast32_t   theirstdoffset;
@@ -1424,7 +1453,7 @@ tzfree(timezone_t sp)
 **
 ** If successful and SETNAME is nonzero,
 ** set the applicable parts of tzname, timezone and altzone;
-** however, it's OK to omit this step if the time zone is POSIX-compatible,
+** however, it's OK to omit this step if the timezone is POSIX-compatible,
 ** since in that case tzset should have already done this step correctly.
 ** SETNAME's type is intfast32_t for compatibility with gmtsub,
 ** but it is actually a boolean and its value should be 0 or 1.
index d4645ad..565e89a 100644 (file)
@@ -187,7 +187,7 @@ and
 are like their unsuffixed counterparts, except that they accept an
 extra initial
 .B zone
-argument specifying the time zone to be used for conversion.
+argument specifying the timezone to be used for conversion.
 If
 .B zone
 is null, UT is used; otherwise,
@@ -252,9 +252,9 @@ There is no guarantee that these fields and this variable will
 continue to exist in this form in future releases of this code.
 .SH FILES
 .ta \w'/usr/share/zoneinfo/posixrules\0\0'u
-/usr/share/zoneinfo    time zone information directory
+/usr/share/zoneinfo    timezone information directory
 .br
-/usr/share/zoneinfo/localtime  local time zone file
+/usr/share/zoneinfo/localtime  local timezone file
 .br
 /usr/share/zoneinfo/posixrules used with POSIX-style TZ's
 .br
@@ -292,7 +292,7 @@ can be freed or overwritten by later calls to the functions
 .IR tzfree ,
 and
 .IR tzset ,
-if these functions affect the time zone information that specifies the
+if these functions affect the timezone information that specifies the
 abbreviation in question.
 The remaining functions and data are thread-safe.
 .PP
index 2957a6c..665ab14 100644 (file)
@@ -104,7 +104,7 @@ DESCRIPTION
 
        Localtime_rz and mktime_z are like their unsuffixed counterparts,
        except that they accept an extra initial zone argument specifying the
-       time zone to be used for conversion.  If zone is null, UT is used;
+       timezone to be used for conversion.  If zone is null, UT is used;
        otherwise, zone should be have been allocated by tzalloc and should not
        be freed until after all uses (e.g., by calls to strftime) of the
        filled-in tm_zone fields.
@@ -138,8 +138,8 @@ DESCRIPTION
        will continue to exist in this form in future releases of this code.
 
 FILES
-       /usr/share/zoneinfo             time zone information directory
-       /usr/share/zoneinfo/localtime   local time zone file
+       /usr/share/zoneinfo             timezone information directory
+       /usr/share/zoneinfo/localtime   local timezone file
        /usr/share/zoneinfo/posixrules  used with POSIX-style TZ's
        /usr/share/zoneinfo/GMT         for UTC leap seconds
 
@@ -155,7 +155,7 @@ NOTES
        and the tm_zone field of a returned struct tm both point to an array of
        characters that can be freed or overwritten by later calls to the
        functions localtime, tzfree, and tzset, if these functions affect the
-       time zone information that specifies the abbreviation in question.  The
+       timezone information that specifies the abbreviation in question.  The
        remaining functions and data are thread-safe.
 
        Asctime, asctime_r, ctime, and ctime_r behave strangely for years
index f1a1a6d..eee503e 100644 (file)
@@ -1,3 +1,5 @@
+.\" strftime man page
+.\"
 .\" Based on the UCB file whose corrected copyright information appears below.
 .\" Copyright 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
@@ -210,7 +212,7 @@ is replaced by the year with century as a decimal number.
 is replaced by the year without century as a decimal number (00\*(en99).
 .TP
 %Z
-is replaced by the time zone name,
+is replaced by the time zone abbreviation,
 or by the empty string if this is not determinable.
 .TP
 %z
@@ -218,7 +220,8 @@ is replaced by the offset from the Prime Meridian
 in the format +HHMM or \*-HHMM as appropriate,
 with positive values representing locations east of Greenwich,
 or by the empty string if this is not determinable.
-The numeric time zone \*-0000 is used when the time is Universal Time
+The numeric time zone abbreviation \*-0000 is used when the time is
+Universal Time
 but local time is indeterminate; by convention this is used for
 locations while uninhabited, and corresponds to a zero offset when the
 time zone abbreviation begins with
index 52daff1..84cfd70 100644 (file)
@@ -123,17 +123,17 @@ DESCRIPTION
        %y     is replaced by the year without century as a decimal number
               (00-99).
 
-       %Z     is replaced by the time zone name, or by the empty string if
-              this is not determinable.
+       %Z     is replaced by the time zone abbreviation, or by the empty
+              string if this is not determinable.
 
        %z     is replaced by the offset from the Prime Meridian in the format
               +HHMM or -HHMM as appropriate, with positive values representing
               locations east of Greenwich, or by the empty string if this is
-              not determinable.  The numeric time zone -0000 is used when the
-              time is Universal Time but local time is indeterminate; by
-              convention this is used for locations while uninhabited, and
-              corresponds to a zero offset when the time zone abbreviation
-              begins with "-".
+              not determinable.  The numeric time zone abbreviation -0000 is
+              used when the time is Universal Time but local time is
+              indeterminate; by convention this is used for locations while
+              uninhabited, and corresponds to a zero offset when the time zone
+              abbreviation begins with "-".
 
        %%     is replaced by a single %.
 
index 0eab732..29e8a21 100644 (file)
@@ -26,17 +26,17 @@ tzset \- initialize time conversion information
 \\$3\*(lq\\$1\*(rq\\$2
 ..
 .I Tzalloc
-allocates and returns a time zone object described by
+allocates and returns a timezone object described by
 .BR TZ .
 If
 .B TZ
-is not a valid time zone description, or if the object cannot be allocated,
+is not a valid timezone description, or if the object cannot be allocated,
 .I tzalloc
 returns a null pointer and sets
 .BR errno .
 .PP
 .I Tzfree
-frees a time zone object
+frees a timezone object
 .BR tz ,
 which should have been successfully allocated by
 .IR tzalloc .
@@ -49,13 +49,13 @@ was used to set.
 .I Tzset
 acts like
 .BR tzalloc(getenv("TZ")) ,
-except it saves any resulting time zone object into internal
+except it saves any resulting timezone object into internal
 storage that is accessed by
 .IR localtime ,
 .IR localtime_r ,
 and
 .IR mktime .
-The anonymous shared time zone object is freed by the next call to
+The anonymous shared timezone object is freed by the next call to
 .IR tzset .
 If the implied call to
 .B tzalloc
@@ -252,7 +252,7 @@ is not given, is
 .LP
 Here are some examples of
 .B TZ
-values that directly specify the time zone rules; they use some of the
+values that directly specify the timezone; they use some of the
 extensions to POSIX.
 .TP
 .B EST5
@@ -321,9 +321,9 @@ may be used to separate the
 from the rest of the specification.
 .SH FILES
 .ta \w'/usr/share/zoneinfo/posixrules\0\0'u
-/usr/share/zoneinfo    time zone information directory
+/usr/share/zoneinfo    timezone information directory
 .br
-/usr/share/zoneinfo/localtime  local time zone file
+/usr/share/zoneinfo/localtime  local timezone file
 .br
 /usr/share/zoneinfo/posixrules used with POSIX-style TZ's
 .br
index 765e4aa..4b0c8ce 100644 (file)
@@ -15,19 +15,19 @@ SYNOPSIS
        cc ... -ltz
 
 DESCRIPTION
-       Tzalloc allocates and returns a time zone object described by TZ.  If
-       TZ is not a valid time zone description, or if the object cannot be
+       Tzalloc allocates and returns a timezone object described by TZ.  If TZ
+       is not a valid timezone description, or if the object cannot be
        allocated, tzalloc returns a null pointer and sets errno.
 
-       Tzfree frees a time zone object tz, which should have been successfully
+       Tzfree frees a timezone object tz, which should have been successfully
        allocated by tzalloc.  This invalidates any tm_zone pointers that tz
        was used to set.
 
        Tzset acts like tzalloc(getenv("TZ")), except it saves any resulting
-       time zone object into internal storage that is accessed by localtime,
-       localtime_r, and mktime.  The anonymous shared time zone object is
-       freed by the next call to tzset.  If the implied call to tzalloc fails,
-       tzset falls back on Universal Time (UT).
+       timezone object into internal storage that is accessed by localtime,
+       localtime_r, and mktime.  The anonymous shared timezone object is freed
+       by the next call to tzset.  If the implied call to tzalloc fails, tzset
+       falls back on Universal Time (UT).
 
        If TZ is null, the best available approximation to local wall clock
        time, as specified by the tzfile(5)-format file localtime in the system
@@ -138,8 +138,8 @@ DESCRIPTION
                              before the first Sunday of March".  The default,
                              if time is not given, is 02:00:00.
 
-       Here are some examples of TZ values that directly specify the time zone
-       rules; they use some of the extensions to POSIX.
+       Here are some examples of TZ values that directly specify the timezone;
+       they use some of the extensions to POSIX.
 
        EST5   stands for US Eastern Standard Time (EST), 5 hours behind UT,
               without daylight saving.
@@ -185,8 +185,8 @@ DESCRIPTION
        used to separate the rule from the rest of the specification.
 
 FILES
-       /usr/share/zoneinfo             time zone information directory
-       /usr/share/zoneinfo/localtime   local time zone file
+       /usr/share/zoneinfo             timezone information directory
+       /usr/share/zoneinfo/localtime   local timezone file
        /usr/share/zoneinfo/posixrules  used with POSIX-style TZ's
        /usr/share/zoneinfo/GMT         for UTC leap seconds
 
index 06db1a8..88c0f6f 100644 (file)
@@ -1,3 +1,5 @@
+# tzdb data for North and Central America and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -48,7 +50,7 @@
 #
 # Most of the US soon followed suit.  See:
 # Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56.
-# http://dx.doi.org/10.2307/3105430
+# https://dx.doi.org/10.2307/3105430
 
 # From Paul Eggert (2005-04-16):
 # That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
index 7349434..0e6cf07 100644 (file)
@@ -1,3 +1,5 @@
+# tzdb data for proposed US election time (this file is obsolete)
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
index 641f905..1ead147 100644 (file)
--- a/private.h
+++ b/private.h
@@ -1,3 +1,5 @@
+/* Private header for tzdb code.  */
+
 #ifndef PRIVATE_H
 
 #define PRIVATE_H
index 9784044..b66cb88 100644 (file)
@@ -1,3 +1,5 @@
+# tzdb data for South America and environs
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -392,7 +394,7 @@ Rule        Arg     2008    only    -       Oct     Sun>=15 0:00    1:00    -
 # standard time, so let's do that here too.  This does not change UTC
 # offsets, only tm_isdst and the time zone abbreviations.  One minor
 # plus is that this silences a zic complaint that there's no POSIX TZ
-# setting for time stamps past 2038.
+# setting for timestamps past 2038.
 
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 #
@@ -925,6 +927,14 @@ Rule       Brazil  2016    2022    -       Feb     Sun>=15 0:00    0       -
 # ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html
 # From Steffen Thorsen (2017-12-20):
 # http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm
+#
+# From Fábio Gomes (2018-10-04):
+# The Brazilian president just announced a new change on this year DST.
+# It was scheduled to start on November 4th and it was changed to November 18th.
+# From Rodrigo Brüning Wessler (2018-10-15):
+# The Brazilian government just announced that the change in DST was
+# canceled....  Maybe the president Michel Temer also woke up one hour
+# earlier today. :)
 Rule   Brazil  2018    max     -       Nov     Sun>=1  0:00    1:00    -
 Rule   Brazil  2023    only    -       Feb     Sun>=22 0:00    0       -
 Rule   Brazil  2024    2025    -       Feb     Sun>=15 0:00    0       -
@@ -1231,6 +1241,24 @@ Zone America/Rio_Branco  -4:31:12 -      LMT     1914
 # they will switch from -03 to -04 one hour after Santiago does that day.
 # For now, assume that they will not revert.
 
+# From Juan Correa (2018-08-13):
+# As of moments ago, the Ministry of Energy in Chile has announced the new
+# schema for DST. ...  Announcement in video (in Spanish):
+# https://twitter.com/MinEnergia/status/1029000399129374720
+# From Yonathan Dossow (2018-08-13):
+# The video says "first Saturday of September", we all know it means Sunday at
+# midnight.
+# From Tim Parenti (2018-08-13):
+# Translating the captions on the video at 0:44-0:55, "We want to announce as
+# Government that from 2019, Winter Time will be increased to 5 months, between
+# the first Saturday of April and the first Saturday of September."
+# At 2:08-2:20, "The Magallanes region will maintain its current time, as
+# decided by the citizens during 2017, but our Government will promote a
+# regional dialogue table to gather their opinion on this matter."
+# https://twitter.com/MinEnergia/status/1029009354001973248
+# "We will keep the new time policy unchanged for at least the next 4 years."
+# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely.
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Chile   1927    1931    -       Sep      1      0:00    1:00    -
 Rule   Chile   1928    1932    -       Apr      1      0:00    0       -
@@ -1264,8 +1292,10 @@ Rule     Chile   2011    only    -       May     Sun>=2  3:00u   0       -
 Rule   Chile   2011    only    -       Aug     Sun>=16 4:00u   1:00    -
 Rule   Chile   2012    2014    -       Apr     Sun>=23 3:00u   0       -
 Rule   Chile   2012    2014    -       Sep     Sun>=2  4:00u   1:00    -
-Rule   Chile   2016    max     -       May     Sun>=9  3:00u   0       -
-Rule   Chile   2016    max     -       Aug     Sun>=9  4:00u   1:00    -
+Rule   Chile   2016    2018    -       May     Sun>=9  3:00u   0       -
+Rule   Chile   2016    2018    -       Aug     Sun>=9  4:00u   1:00    -
+Rule   Chile   2019    max     -       Apr     Sun>=2  3:00u   0       -
+Rule   Chile   2019    max     -       Sep     Sun>=2  4:00u   1:00    -
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
index e855890..ac26f4b 100644 (file)
@@ -487,7 +487,8 @@ label:
                                /*
                                ** C99 and later say that %Z must be
                                ** replaced by the empty string if the
-                               ** time zone is not determinable.
+                               ** time zone abbreviation is not
+                               ** determinable.
                                */
                                continue;
                        case 'z':
diff --git a/systemv b/systemv
index d9e2995..24c8f64 100644 (file)
--- a/systemv
+++ b/systemv
@@ -1,3 +1,5 @@
+# tzdb data for System V rules (this file is obsolete)
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
index fc2102b..8dd58db 100644 (file)
@@ -1,7 +1,11 @@
+<!DOCTYPE html>
 <html lang="en">
 <head>
   <title>Theory and pragmatics of the tz code and data</title>
   <meta charset="UTF-8">
+  <style>
+    pre {margin-left: 2em; white-space: pre-wrap;}
+  </style>
 </head>
 
 <body>
@@ -11,7 +15,7 @@
     <ul>
       <li><a href="#scope">Scope of the <code><abbr>tz</abbr></code>
          database</a></li>
-      <li><a href="#naming">Names of time zone rulesets</a></li>
+      <li><a href="#naming">Names of timezones</a></li>
       <li><a href="#abbreviations">Time zone abbreviations</a></li>
       <li><a href="#accuracy">Accuracy of the <code><abbr>tz</abbr></code>
          database</a></li>
@@ -31,13 +35,13 @@ database</a> attempts to record the history and predicted future of
 all computer-based clocks that track civil time.
 It organizes <a href="tz-link.html">time zone and daylight saving time
 data</a> by partitioning the world into <a
-href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">regions</a>
+href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"><dfn>timezones</dfn></a>
 whose clocks all agree about timestamps that occur after the <a
 href="https://en.wikipedia.org/wiki/Unix_time">POSIX Epoch</a>
 (1970-01-01 00:00:00 <a
 href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time"><abbr
 title="Coordinated Universal Time">UTC</abbr></a>).
-The database labels each such region with a notable location and
+The database labels each timezone with a notable location and
 records all known clock transitions for that location.
 Although 1970 is a somewhat-arbitrary cutoff, there are significant
 challenges to moving the cutoff earlier even by a decade or two, due
@@ -46,7 +50,24 @@ became prevalent.
 </p>
 
 <p>
-Clock transitions before 1970 are recorded for each such location,
+Each timezone typically corresponds to a geographical region that is
+smaller than a traditional time zone, because clocks in a timezone
+all agree after 1970 whereas a traditional time zone merely
+specifies current standard time. For example, applications that deal
+with current and future timestamps in the traditional North
+American mountain time zone can choose from the timezones
+<code>America/Denver</code> which observes US-style daylight saving
+time, <code>America/Mazatlan</code> which observes Mexican-style DST,
+and <code>America/Phoenix</code> which does not observe DST.
+Applications that also deal with past timestamps in the mountain time
+zone can choose from over a dozen timezones, such as
+<code>America/Boise</code>, <code>America/Edmonton</code>, and
+<code>America/Hermosillo</code>, each of which currently uses mountain
+time but differs from other timezones for some timestamps after 1970.
+</p>
+
+<p>
+Clock transitions before 1970 are recorded for each timezone,
 because most systems support timestamps before 1970 and could
 misbehave if data entries were omitted for pre-1970 transitions.
 However, the database is not designed for and does not suffice for
@@ -73,30 +94,36 @@ Edition.
 Because the database's scope encompasses real-world changes to civil
 timekeeping, its model for describing time is more complex than the
 standard and daylight saving times supported by POSIX.
-A <code><abbr>tz</abbr></code> region corresponds to a ruleset that can
+A <code><abbr>tz</abbr></code> timezone corresponds to a ruleset that can
 have more than two changes per year, these changes need not merely
 flip back and forth between two alternatives, and the rules themselves
 can change at times.
-Whether and when a <code><abbr>tz</abbr></code> region changes its
-clock, and even the region's notional base offset from UTC, are variable.
-It does not always make sense to talk about a region's
-"base offset", since it is not necessarily a single number.
+Whether and when a timezone changes its
+clock, and even the timezone's notional base offset from UTC, are variable.
+It does not always make sense to talk about a timezone's
+"base offset", which is not necessarily a single number.
 </p>
 
 </section>
 
 <section>
-  <h2 id="naming">Names of time zone rulesets</h2>
+  <h2 id="naming">Names of timezones</h2>
 <p>
-Each <code><abbr>tz</abbr></code> region has a unique name that
-corresponds to a set of time zone rules.
+Each timezone has a unique name.
 Inexperienced users are not expected to select these names unaided.
 Distributors should provide documentation and/or a simple selection
-interface that explains the names; for one example, see the
+interface that explains each name via a map or via descriptive text like
+"Ruthenia" instead of the timezone name "<code>Europe/Uzhgorod</code>".
+If geolocation information is available, a selection interface can
+locate the user on a timezone map or prioritize names that are
+geographically close. For an example selection interface, see the
 <code>tzselect</code> program in the <code><abbr>tz</abbr></code> code.
 The <a href="http://cldr.unicode.org/">Unicode Common Locale Data
 Repository</a> contains data that may be useful for other selection
-interfaces.
+interfaces; it maps timezone names like <code>Europe/Uzhgorod</code>
+to CLDR names like <code>uauzh</code> which are in turn mapped to
+locale-dependent strings like "Uzhhorod", "Ungvár", "Ужгород", and
+"乌日哥罗德".
 </p>
 
 <p>
@@ -106,12 +133,12 @@ among the following goals:
 
 <ul>
   <li>
-    Uniquely identify every region where clocks have agreed since 1970.
+    Uniquely identify every timezone where clocks have agreed since 1970.
     This is essential for the intended use: static clocks keeping local
     civil time.
   </li>
   <li>
-    Indicate to experts where that region is.
+    Indicate to experts where the timezone's clocks typically are.
   </li>
   <li>
     Be robust in the presence of political changes.
@@ -131,9 +158,8 @@ among the following goals:
 <p>
 Names normally have the form
 <var>AREA</var><code>/</code><var>LOCATION</var>, where
-<var>AREA</var> is the name of a continent or ocean, and
-<var>LOCATION</var> is the name of a specific location within that
-region.
+<var>AREA</var> is a continent or ocean, and
+<var>LOCATION</var> is a specific location within the area.
 North and South America share the same area, '<code>America</code>'.
 Typical names are '<code>Africa/Cairo</code>',
 '<code>America/New_York</code>', and '<code>Pacific/Honolulu</code>'.
@@ -144,7 +170,7 @@ Indiana from other Petersburgs in America.
 
 <p>
 Here are the general guidelines used for
-choosing <code><abbr>tz</abbr></code> region names,
+choosing timezone names,
 in decreasing order of importance:
 </p>
 
@@ -196,9 +222,9 @@ in decreasing order of importance:
     country or territory.
   </li>
   <li>
-    If all the clocks in a region have agreed since 1970,
-    do not bother to include more than one location
-    even if subregions' clocks disagreed before 1970.
+    If all the clocks in a timezone have agreed since 1970,
+    do not bother to include more than one timezone
+    even if some of the clocks disagreed before 1970.
     Otherwise these tables would become annoyingly large.
   </li>
   <li>
@@ -212,7 +238,7 @@ in decreasing order of importance:
     Keep locations compact.
     Use cities or small islands, not countries or regions, so that any
     future changes do not split individual locations into different
-    <code><abbr>tz</abbr></code> regions.
+    timezones.
     E.g., prefer <code>Europe/Paris</code> to <code>Europe/France</code>,
     since
     <a href="https://en.wikipedia.org/wiki/Time_in_France#History">France
@@ -220,10 +246,10 @@ in decreasing order of importance:
   </li>
   <li>
     Use mainstream English spelling, e.g., prefer
-    <code>Europe/Rome</code> to <code>Europe/Roma</code>, and
+    <code>Europe/Rome</code> to <code>Europa/Roma</code>, and
     prefer <code>Europe/Athens</code> to the Greek
-    <code>Europe/Αθήνα</code> or the Romanized
-    <code>Europe/Athína</code>.
+    <code>Ευρώπη/Αθήνα</code> or the Romanized
+    <code>Evrópi/Athína</code>.
     The POSIX file name restrictions encourage this guideline.
   </li>
   <li>
@@ -274,9 +300,9 @@ in decreasing order of importance:
 
 <p>
 The file '<code>zone1970.tab</code>' lists geographical locations used
-to name <code><abbr>tz</abbr></code> regions.
+to name timezones.
 It is intended to be an exhaustive list of names for geographic
-regions as described above; this is a subset of the names in the data.
+regions as described above; this is a subset of the timezones in the data.
 Although a '<code>zone1970.tab</code>' location's
 <a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
 corresponds to
@@ -398,6 +424,7 @@ in decreasing order of importance:
       NZST/NZDT New Zealand 1946&ndash;present,
       PKT/PKST Pakistan,
       PST/PDT/PWT/PPT/PDDT Pacific,
+      PST/PDT Philippine,
       SAST South Africa,
       SST Samoa,
       WAT/WAST West Africa,
@@ -453,7 +480,7 @@ in decreasing order of importance:
 
     <p>
     <small>A few abbreviations also follow the pattern that
-    <abbr>GMT<abbr>/<abbr>BST</abbr> established for time in the UK.
+    <abbr>GMT</abbr>/<abbr>BST</abbr> established for time in the UK.
     They are:
       CMT/BST for Calamarca Mean Time and Bolivian Summer Time
        1890&ndash;1932,
@@ -473,7 +500,7 @@ in decreasing order of importance:
   </li>
   <li>
     If there is no common English abbreviation, use numeric offsets like
-    <code>-</code>05 and <code>+</code>0830 that are generated
+    <code>-</code>05 and <code>+</code>0530 that are generated
     by <code>zic</code>'s <code>%z</code> notation.
   </li>
   <li>
@@ -488,8 +515,8 @@ in decreasing order of importance:
     usage.
   </li>
   <li>
-    Use a consistent style in a <code><abbr>tz</abbr></code> region's history.
-    For example, if history tends to use numeric
+    Use a consistent style in a timezone's history.
+    For example, if history tends to use numeric
     abbreviations and a particular entry could go either way, use a
     numeric abbreviation.
   </li>
@@ -501,7 +528,7 @@ in decreasing order of importance:
     The leading '<code>-</code>' is a flag that the <abbr>UT</abbr> offset is in
     some sense undefined; this notation is derived
     from <a href="https://tools.ietf.org/html/rfc3339">Internet
-    <abbr title="Request For Comments">RFC 3339</a>.
+    <abbr title="Request For Comments">RFC</abbr> 3339</a>.
   </li>
 </ul>
 
@@ -543,7 +570,7 @@ Errors in the <code><abbr>tz</abbr></code> database arise from many sources:
     The pre-1970 entries in this database cover only a tiny sliver of how
     clocks actually behaved; the vast majority of the necessary
     information was lost or never recorded.
-    Thousands more <code><abbr>tz</abbr></code> regions would be needed if
+    Thousands more timezones would be needed if
     the <code><abbr>tz</abbr></code> database's scope were extended to
     cover even just the known or guessed history of standard time; for
     example, the current single entry for France would need to split
@@ -608,19 +635,19 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
   </li>
   <li>
     The <code><abbr>tz</abbr></code> database does not record the
-    earliest time for which a <code><abbr>tz</abbr></code> region's
+    earliest time for which a timezone's
     data entries are thereafter valid for every location in the region.
     For example, <code>Europe/London</code> is valid for all locations
     in its region after <abbr>GMT</abbr> was made the standard time,
     but the date of standardization (1880-08-02) is not in the
     <code><abbr>tz</abbr></code> database, other than in commentary.
-    For many <code><abbr>tz</abbr></code> regions the earliest time of
+    For many timezones the earliest time of
     validity is unknown.
   </li>
   <li>
     The <code><abbr>tz</abbr></code> database does not record a
     region's boundaries, and in many cases the boundaries are not known.
-    For example, the <code><abbr>tz</abbr></code> region
+    For example, the timezone
     <code>America/Kentucky/Louisville</code> represents a region
     around the city of Louisville, the boundaries of which are
     unclear.
@@ -664,19 +691,39 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
     way to specify Easter, these exceptional years are entered as
     separate <code><abbr>tz</abbr> Rule</code> lines, even though the
     legal rules did not change.
+    When transitions are known but the historical rules behind them are not,
+    the database contains <code>Zone</code> and <code>Rule</code>
+    entries that are intended to represent only the generated
+    transitions, not any underlying historical rules; however, this
+    intent is recorded at best only in commentary.
   </li>
   <li>
-    The <code><abbr>tz</abbr></code> database models pre-standard time
+    The <code><abbr>tz</abbr></code> database models time
     using the <a
     href="https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar">proleptic
-    Gregorian calendar</a> and local mean time, but many people used
-    other calendars and other timescales.
+    Gregorian calendar</a> with days containing 24 equal-length hours
+    numbered 00 through 23, except when clock transitions occur.
+    Pre-standard time is modeled as local mean time.
+    However, historically many people used other calendars and other timescales.
     For example, the Roman Empire used
     the <a href="https://en.wikipedia.org/wiki/Julian_calendar">Julian
     calendar</a>,
     and <a href="https://en.wikipedia.org/wiki/Roman_timekeeping">Roman
     timekeeping</a> had twelve varying-length daytime hours with a
     non-hour-based system at night.
+    And even today, some local practices diverge from the Gregorian
+    calendar with 24-hour days. These divergences range from
+    relatively minor, such as Japanese bars giving times like "24:30" for the
+    wee hours of the morning, to more-significant differences such as <a
+    href="https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time">the
+    east African practice of starting the day at dawn</a>, renumbering
+    the Western 06:00 to be 12:00. These practices are largely outside
+    the scope of the <code><abbr>tz</abbr></code> code and data, which
+    provide only limited support for date and time localization
+    such as that required by POSIX. If DST is not used a different time zone
+    can often do the trick; for example, in Kenya a <code>TZ</code> setting
+    like <code>&lt;-03&gt;3</code> or <code>America/Cayenne</code> starts
+    the day six hours later than <code>Africa/Nairobi</code> does.
   </li>
   <li>
     Early clocks were less reliable, and data entries do not represent
@@ -710,7 +757,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
     historical <a href="https://en.wikipedia.org/wiki/Solar_time">solar time</a>
     to more than about one-hour accuracy.
     See: Stephenson FR, Morrison LV, Hohenkerk CY.
-    <a href="http://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
+    <a href="https://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
     the Earth's rotation: 720 BC to AD 2015</a>.
     <cite>Proc Royal Soc A</cite>. 2016 Dec 7;472:20160404.
     Also see: Espenak F. <a
@@ -746,7 +793,7 @@ Any attempt to pass the
 should be unacceptable to anybody who cares about the facts.
 In particular, the <code><abbr>tz</abbr></code> database's
 <abbr>LMT</abbr> offsets should not be considered meaningful, and
-should not prompt creation of <code><abbr>tz</abbr></code> regions
+should not prompt creation of timezones
 merely because two locations
 differ in <abbr>LMT</abbr> or transitioned to standard time at
 different dates.
@@ -798,7 +845,7 @@ an older <code>zic</code>.
     <dl>
       <dt><var>std</var> and <var>dst</var></dt><dd>
        are 3 or more characters specifying the standard
-       and daylight saving time (<abbr>DST</abbr>) zone names.
+       and daylight saving time (<abbr>DST</abbr>) zone abbreviations.
        Starting with POSIX.1-2001, <var>std</var> and <var>dst</var>
        may also be in a quoted form like '<code>&lt;+09&gt;</code>';
        this allows "<code>+</code>" and "<code>-</code>" in the names.
@@ -870,38 +917,38 @@ an older <code>zic</code>.
     <pre><code>TZ='Pacific/Auckland'</code></pre>
   </li>
   <li>
-    POSIX does not define the exact meaning of <code>TZ</code> values like
+    POSIX does not define the <abbr>DST</abbr> transitions
+    for <code>TZ</code> values like
     "<code>EST5EDT</code>".
-    Typically the current <abbr>US</abbr> <abbr>DST</abbr> rules
-    are used to interpret such values, but this means that the
-    <abbr>US</abbr> <abbr>DST</abbr> rules are compiled into each
-    program that does time conversion.
-    This means that when
-    <abbr>US</abbr> time conversion rules change (as in the United
-    States in 1987), all programs that do time conversion must be
+    Traditionally the current <abbr>US</abbr> <abbr>DST</abbr> rules
+    were used to interpret such values, but this meant that the
+    <abbr>US</abbr> <abbr>DST</abbr> rules were compiled into each
+    program that did time conversion. This meant that when
+    <abbr>US</abbr> time conversion rules changed (as in the United
+    States in 1987), all programs that did time conversion had to be
     recompiled to ensure proper results.
   </li>
   <li>
     The <code>TZ</code> environment variable is process-global, which
     makes it hard to write efficient, thread-safe applications that
-    need access to multiple time zone rulesets.
+    need access to multiple timezones.
   </li>
   <li>
     In POSIX, there is no tamper-proof way for a process to learn the
     system's best idea of local wall clock.
-    (This is important for applications that an administrator wants
+    This is important for applications that an administrator wants
     used only at certain times &ndash; without regard to whether the
     user has fiddled the
     <code>TZ</code> environment variable.
     While an administrator can "do everything in <abbr>UT</abbr>" to
     get around the problem, doing so is inconvenient and precludes
-    handling daylight saving time shifts - as might be required to
-    limit phone calls to off-peak hours.)
+    handling daylight saving time shifts &ndash; as might be required to
+    limit phone calls to off-peak hours.
   </li>
   <li>
     POSIX provides no convenient and efficient way to determine
     the <abbr>UT</abbr> offset and time zone abbreviation of arbitrary
-    timestamps, particularly for <code><abbr>tz</abbr></code> regions
+    timestamps, particularly for timezones
     that do not fit into the POSIX model.
   </li>
   <li>
@@ -919,7 +966,7 @@ an older <code>zic</code>.
     Unsigned 32-bit integers are used on one or two platforms, and 36-bit
     and 40-bit integers are also used occasionally.
     Although earlier POSIX versions allowed <code>time_t</code> to be a
-    floating-point type, this was not supported by any practical systems,
+    floating-point type, this was not supported by any practical system,
     and POSIX.1-2013 and the <code><abbr>tz</abbr></code> code both
     require <code>time_t</code> to be an integer type.
   </li>
@@ -931,15 +978,16 @@ an older <code>zic</code>.
   <li>
     <p>
     The <code>TZ</code> environment variable is used in generating
-    the name of a binary file from which time-related information is read
+    the name of a file from which time-related information is read
     (or is interpreted à la POSIX); <code>TZ</code> is no longer
-    constrained to be a three-letter time zone
-    abbreviation followed by a number of hours and an optional three-letter
-    daylight time zone abbreviation.
+    constrained to be a string containing abbreviations
+    and numeric data as described <a href="#POSIX">above</a>.
+    The file's format is <dfn><abbr>TZif</abbr></dfn>,
+    a timezone information format that contains binary data.
     The daylight saving time rules to be used for a
-    particular <code><abbr>tz</abbr></code> region are encoded in the
-    binary file; the format of the file
-    allows U.S., Australian, and other rules to be encoded, and
+    particular timezone are encoded in the
+    <abbr>TZif</abbr> file; the format of the file allows <abbr>US</abbr>,
+    Australian, and other rules to be encoded, and
     allows for situations where more than two time zone
     abbreviations are used.
     </p>
@@ -949,15 +997,15 @@ an older <code>zic</code>.
     might cause "old" programs (that expect <code>TZ</code> to have a
     certain form) to operate incorrectly; consideration was given to using
     some other environment variable (for example, <code>TIMEZONE</code>)
-    to hold the string used to generate the binary file's name.
+    to hold the string used to generate the <abbr>TZif</abbr> file's name.
     In the end, however, it was decided to continue using
     <code>TZ</code>: it is widely used for time zone purposes;
     separately maintaining both <code>TZ</code>
     and <code>TIMEZONE</code> seemed a nuisance; and systems where
     "new" forms of <code>TZ</code> might cause problems can simply
-    use <code>TZ</code> values such as "<code>EST5EDT</code>" which
-    can be used both by "new" programs (à la POSIX) and "old"
-    programs (as zone names and offsets).
+    use legacy <code>TZ</code> values such as "<code>EST5EDT</code>" which
+    can be used by "new" programs as well as by "old" programs that
+    assume pre-POSIX <code>TZ</code> values.
     </p>
   </li>
   <li>
@@ -972,7 +1020,7 @@ an older <code>zic</code>.
     Functions <code>tzalloc</code>, <code>tzfree</code>,
     <code>localtime_rz</code>, and <code>mktime_z</code> for
     more-efficient thread-safe applications that need to use multiple
-    time zone rulesets.
+    timezones.
     The <code>tzalloc</code> and <code>tzfree</code> functions
     allocate and free objects of type <code>timezone_t</code>,
     and <code>localtime_rz</code> and <code>mktime_z</code> are
@@ -1093,8 +1141,9 @@ The vestigial <abbr>API</abbr>s are:
     standardization proposals.
   </li>
   <li>
-    Other time conversion proposals, in particular the one developed
-    by folks at Hewlett Packard, offer a wider selection of functions
+    Other time conversion proposals, in particular those supported by the
+    <a href="https://howardhinnant.github.io/date/tz.html">Time Zone
+    Database Parser</a>, offer a wider selection of functions
     that provide capabilities beyond those provided here.
     The absence of such functions from this package is not meant to
     discourage the development, standardization, or use of such
@@ -1116,8 +1165,8 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces:
 
 <ul>
   <li>
-    A set of <code><abbr>tz</abbr></code> region names as per
-      "<a href="#naming">Names of time zone rulesets</a>" above.
+    A set of timezone names as per
+      "<a href="#naming">Names of timezones</a>" above.
   </li>
   <li>
     Library functions described in "<a href="#functions">Time and date
@@ -1186,7 +1235,7 @@ They sometimes disagree.
   <h2 id="planets">Time and time zones on other planets</h2>
 <p>
 Some people's work schedules
-use <a href="https://en.wikipedia.org/wiki/Timekeeping on Mars">Mars time</a>.
+use <a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.
 Jet Propulsion Laboratory (JPL) coordinators kept Mars time on
 and off during the
 <a href="https://en.wikipedia.org/wiki/Mars_Pathfinder#End_of_mission">Mars
@@ -1218,7 +1267,7 @@ Coordinated Time (<abbr>MTC</abbr>)</a>.
 
 <p>
 Each landed mission on Mars has adopted a different reference for
-solar time keeping, so there is no real standard for Mars time zones.
+solar timekeeping, so there is no real standard for Mars time zones.
 For example, the
 <a href="https://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars
 Exploration Rover</a> project (2004) defined two time zones "Local
@@ -1290,7 +1339,7 @@ Sources for time on other planets:
     Matt Williams,
     "<a href="https://www.universetoday.com/37481/days-of-the-planets/">How
     long is a day on the other planets of the solar system?</a>"
-    (2017-04-27).
+    (2016-01-20).
   </li>
 </ul>
 </section>
index 9624d8c..c98e9c4 100644 (file)
@@ -160,6 +160,11 @@ time I've ever been early for work. Except for all those daylight
 savings days. Lousy farmers."
 </li>
 <li>
+<em>Last Week Tonight with John Oliver</em>, season 2, episode 5, 2015-03-08,
+asked, "<a href="https://www.youtube.com/watch?v=br0NW9ufUUw">Daylight Saving
+Time &ndash; How Is This Still A Thing?</a>"
+</li>
+<li>
 "Tracks", <em>The Good Wife</em>, season 7, episode 12,
 CBS, 2016-01-17.
 The applicability of a contract hinges on the
@@ -466,8 +471,9 @@ The webcomic <em>xkcd</em> has the strip
 "<a href='https://xkcd.com/1335/'>Now</a>" (2014-02-26),
 "<a href='https://xkcd.com/1655/'>Doomsday Clock</a>" (2016-03-14),
 "<a href='https://xkcd.com/1799/'>Bad Map Projection: Time Zones</a>"
-(2017-02-15), and
-"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30).
+(2017-02-15),
+"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30),
+and "<a href='https://xkcd.com/2050/'>6/6 Time</a>" (2018-09-24).
 The related book <em>What If?</em> has an entry
 "<a href='https://what-if.xkcd.com/26/'>Leap Seconds</a>" (2012-12-31).
 </li>
index a54f54a..159ed89 100644 (file)
@@ -5,6 +5,9 @@
 <head>
 <title>How to Read the tz Database</title>
 <meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
+<style type="text/css">
+pre {margin-left: 2em; white-space: pre-wrap;}
+</style>
 </head>
 <body>
 <h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
@@ -517,7 +520,7 @@ a <code>SAVE</code> of zero.
 <ul>
 
 <li>The <a href="https://en.wikipedia.org/wiki/Tz_database">tz
-database</a> gives abbreviations for time zone names in <i>popular
+database</a> gives abbreviations for time zones in <i>popular
 usage</i>, which is not necessarily &ldquo;correct&rdquo; by law. For
 example, the last line in
 <code>Zone</code> <code>Pacific/Honolulu</code> (shown below) gives
index 13a824d..8593ba6 100644 (file)
@@ -3,6 +3,9 @@
 <head>
 <title>Sources for time zone and daylight saving time data</title>
 <meta charset="UTF-8">
+<style>
+pre {margin-left: 2em; white-space: pre-wrap;}
+</style>
 </head>
 <body>
 <h1>Sources for time zone and daylight saving time data</h1>
@@ -32,8 +35,6 @@ including
 C Library</a> (used in
 <a href="https://en.wikipedia.org/wiki/Linux"><abbr>GNU</abbr>/Linux</a>),
 <a href="https://www.android.com">Android</a>,
-<a href="https://developer.mozilla.org/en-US/docs/Mozilla/B2G_OS">B2G
-<abbr title="Operating System">OS</abbr></a>,
 <a href="https://www.freebsd.org">Free<abbr
 title="Berkeley Software Distribution">BSD</abbr></a>,
 <a href="https://netbsd.org">Net<abbr>BSD</abbr></a>,
@@ -58,15 +59,14 @@ title="Virtual Memory System">VMS</abbr></a>,
 <a href="https://www.oracle.com/database/index.html">Oracle Database</a>, and
 <a href="https://www.oracle.com/solaris">Oracle Solaris</a>.</p>
 <p>
-Each location in the database represents a region where all
-clocks keeping local time have agreed since 1970.
-Locations are identified by continent or ocean and then by the name of
-the location, which is typically the largest city within the region.
+Each main entry in the database represents a <dfn>timezone</dfn>
+for a set of civil-time clocks that have all agreed since 1970.
+Timezones are typically identified by continent or ocean and then by the
+name of the largest city within the region containing the clocks.
 For example, <code>America/New_York</code>
 represents most of the <abbr title="United States">US</abbr> eastern time zone;
 <code>America/Phoenix</code> represents most of Arizona, which
-uses mountain time without daylight saving time (<abbr
-title="daylight saving time">DST</abbr>);
+uses mountain time without daylight saving time (<abbr>DST</abbr>);
 <code>America/Detroit</code> represents most of Michigan, which uses
 eastern time but with different <abbr>DST</abbr> rules in 1975;
 and other entries represent smaller regions like Starke County,
@@ -79,12 +79,12 @@ implementation set the <code><abbr>TZ</abbr></code>
 environment variable to the location's full name,
 e.g., <code><abbr>TZ</abbr>="America/New_York"</code>.</p>
 <p>
-Associated with each region is a history of offsets from
+Associated with each timezone is a history of offsets from
 <a href="https://en.wikipedia.org/wiki/Universal_Time">Universal
 Time</a> (<abbr>UT</abbr>), which is <a
 href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean
 Time</a> (<abbr>GMT</abbr>) with days beginning at midnight;
-for time stamps after 1960 this is more precisely <a
+for timestamps after 1960 this is more precisely <a
 href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated
 Universal Time</a> (<abbr>UTC</abbr>).
 The database also records when daylight saving time was in use,
@@ -97,7 +97,7 @@ href="https://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
 the latest release's two
 <a href="https://en.wikipedia.org/wiki/Tar_(computing)">tarballs</a>
 to a <abbr>GNU</abbr>/Linux or similar host.</p>
-<pre style="margin-left: 2em"><code>mkdir tzdb
+<pre><code>mkdir tzdb
 cd tzdb
 <a href="https://www.gnu.org/software/wget/">wget</a> https://www.iana.org/time-zones/repository/tzcode-latest.tar.gz
 wget https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
@@ -107,7 +107,7 @@ gzip -dc tzdata-latest.tar.gz | tar -xf -
 <p>Alternatively, the following shell commands download the same
 release in a single-tarball format containing extra data
 useful for regression testing:</p>
-<pre style="margin-left: 2em"><code>wget <a href="https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz">https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz</a>
+<pre><code>wget <a href="https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz">https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz</a>
 <a href="https://www.nongnu.org/lzip/">lzip</a> -dc tzdb-latest.tar.lz | tar -xf -
 </code></pre>
 <p>These commands use convenience links to the latest release
@@ -133,7 +133,7 @@ less-secure protocol.</p>
 <p>Alternatively, a development repository of code and data can be
 retrieved from <a href="https://github.com">GitHub</a> via the shell
 command:</p>
-<pre style="margin-left: 2em"><code><a href="https://git-scm.com">git</a> clone <a href="https://github.com/eggert/tz">https://github.com/eggert/tz</a>
+<pre><code><a href="https://git-scm.com">git</a> clone <a href="https://github.com/eggert/tz">https://github.com/eggert/tz</a>
 </code></pre>
 <p>
 Since version 2012e, each release has been tagged in development repositories.
@@ -143,8 +143,10 @@ more errors.</p>
 After obtaining the code and data files, see the
 <code>README</code> file for what to do next.
 The code lets you compile the <code><abbr>tz</abbr></code> source files into
-machine-readable binary files, one for each location. It also lets
-you read a <code><abbr>tz</abbr></code> binary file and interpret time stamps for that
+machine-readable binary files, one for each location. The binary files
+are in a special timezone information format (<dfn><abbr>TZif</abbr></dfn>).
+The code also lets
+you read a <abbr>TZif</abbr> file and interpret timestamps for that
 location.</p>
 <h2 id="changes">Changes to the <code><abbr>tz</abbr></code> database</h2>
 <p>
@@ -217,6 +219,8 @@ For further information about updates, please see
 Maintaining the Time Zone Database</a> (Internet <abbr
 title="Request For Comments">RFC</abbr> 6557). More detail can be
 found in <a href="theory.html">Theory and pragmatics of the tz code and data</a>.
+<a href="https://a0.github.io/a0-tzmigration/">A0 TimeZone Migration</a>
+displays changes between recent <code><abbr>tzdb</abbr></code> versions.
 </p>
 <h2 id="commentary">Commentary on the <code><abbr>tz</abbr></code> database</h2>
 <ul>
@@ -272,12 +276,17 @@ href="https://tools.ietf.org/html/rfc7808">TZDIST</a>
 (Internet <abbr>RFC</abbr> 7808), a time zone data distribution service,
 along with <a href="https://tools.ietf.org/html/rfc7809">CalDAV</a>
 (Internet <abbr>RFC</abbr> 7809), a calendar access protocol for
-transferring time zone data by reference. The draft <a
+transferring time zone data by reference.
+The <a href="https://www.ietf.org/mailman/listinfo/tzdist-bis">tzdist-bis
+mailing list</a> discusses two Internet drafts: <a
 id="TZDIST-Geolocate"
-href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-01">TZDIST
-Geolocate Extension</a> lets a client determine its time zone region
+href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate">TZDIST
+Geolocate Extension</a> lets a client determine its timezone
 from its geographic location using a <a
-href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>.</li>
+href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>, and
+<a href="https://tools.ietf.org/html/draft-murchison-tzdist-tzif">The
+Time Zone Information Format (<abbr>TZif</abbr>)</a> specifies the format of
+<abbr>TZif</abbr> data.</li>
 <li>The <a href="https://tools.ietf.org/html/rfc5545">
 Internet Calendaring and Scheduling Core Object Specification
 (iCalendar)</a> (Internet <abbr>RFC</abbr> 5445)
@@ -404,6 +413,14 @@ the <abbr>MIT</abbr> license.</li>
 compiler from <code><abbr>tz</abbr></code> source into
 <a href="https://julialang.org/">Julia</a>. It is freely available
 under the <abbr>MIT</abbr> license.</li>
+<li><a href="https://github.com/pavkam/tzdb">Delphi/<abbr
+title="Free Pascal Compiler">FPC</abbr> Time Zone Database</a>
+compiles from <code><abbr>tz</abbr></code> source into
+<a href="https://en.wikipedia.org/wiki/Object_Pascal">Object Pascal</a>
+as compiled by <a href="https://en.wikipedia.org/wiki/Delphi_(IDE)">Delphi</a>
+and <a
+href="https://en.wikipedia.org/wiki/Free_Pascal"><abbr>FPC</abbr></a>.
+It is freely available under a <abbr>BSD</abbr>-style license.</li>
 <li><a href="http://pytz.sourceforge.net">pytz &ndash; World Timezone
 Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
 <a href="https://www.python.org">Python</a>.
@@ -426,36 +443,36 @@ source into text files, along with a runtime that can read those
 files. Tcl is freely available under a <abbr>BSD</abbr>-style
 license.</li>
 </ul>
-<h2 id="binary">Other <code><abbr>tz</abbr></code> binary file readers</h2>
+<h2 id="TZif">Other <abbr>TZif</abbr> readers</h2>
 <ul>
 <li>The <a
 href="https://www.gnu.org/software/libc/"><abbr>GNU</abbr> C
 Library</a>
 has an independent, thread-safe implementation of
-a <code><abbr>tz</abbr></code> binary file reader.
+a <abbr>TZif</abbr> file reader.
 This library is freely available under the LGPL
 and is widely used in <abbr>GNU</abbr>/Linux systems.</li>
 <li><a href="https://www.gnome.org">GNOME</a>'s
 <a href="https://developer.gnome.org/glib/">GLib</a> has
-a <code><abbr>tz</abbr></code> binary file reader written in C that
+a <abbr>TZif</abbr> file reader written in C that
 creates a <code>GTimeZone</code> object representing sets
 of <abbr>UT</abbr> offsets.
 It is freely available under the <abbr>LGPL</abbr>.</li>
 <li>The
 <a href="https://github.com/bloomberg/bde/wiki">BDE Standard Library</a>'s
 <code>baltzo::TimeZoneUtil</code> component contains a C++
-implementation of a binary file reader. It is freely available under
+implementation of a <abbr>TZif</abbr> file reader. It is freely available under
 the Apache License.</li>
 <li><a href="https://github.com/google/cctz">CCTZ</a> is a simple C++
 library that translates between <abbr>UT</abbr> and civil time and
-can read binary files. It is freely available under the Apache
+can read <abbr>TZif</abbr> files. It is freely available under the Apache
 License.</li>
 <li><a href="http://bmsi.com/java/#TZ">ZoneInfo.java</a>
-is a <code><abbr>tz</abbr></code> binary file reader written in Java.
+is a <abbr>TZif</abbr> file reader written in Java.
 It is freely available under the <abbr>LGPL</abbr>.</li>
 <li><a href="https://github.com/derickr/timelib">Timelib</a> is a C
-library that reads tz binary files and converts
-time stamps from one time zone or format to another.
+library that reads <abbr>TZif</abbr> files and converts
+timestamps from one time zone or format to another.
 It is used by <a href="https://secure.php.net"><abbr
 title="PHP: Hypertext Preprocessor">PHP</abbr></a>,
 <a href="https://hhvm.com"><abbr title="HipHop Virtual Machine">HHVM</abbr></a>,
@@ -465,23 +482,23 @@ It is freely available under the <abbr>MIT</abbr> license.</li>
 JavaScript library that supports date arithmetic that is time zone
 aware. It is freely available under the <abbr>MIT</abbr> license.</li>
 <li>Tcl, mentioned <a href="#Tcl">above</a>, also contains a
-<code><abbr>tz</abbr></code> binary file reader.</li>
+<abbr>TZif</abbr> file reader.</li>
 <li><a href="http://search.cpan.org/perldoc?DateTime::TimeZone::Tzfile">
 DateTime::TimeZone::Tzfile</a>
-is a <code><abbr>tz</abbr></code> binary file reader written in Perl.
+is a <abbr>TZif</abbr> file reader written in Perl.
 It is freely available under the same terms as Perl
 (dual <abbr>GPL</abbr> and Artistic license).</li>
 <li>The
 public-domain <a href="https://github.com/dbaron/tz.js">tz.js</a>
 library contains a Python tool that
-converts <code><abbr>tz</abbr></code> binary data into
+converts <abbr>TZif</abbr> data into
 <abbr>JSON</abbr>-format data suitable for use
 in its JavaScript library for time zone conversion. Dates before 1970
 are not supported.</li>
 <li>The <a
 href="https://hackage.haskell.org/package/timezone-olson">timezone-olson</a>
 package contains <a href="https://www.haskell.org">Haskell</a> code that
-parses and uses <code><abbr>tz</abbr></code> binary data. It is freely
+parses and uses <abbr>TZif</abbr> data. It is freely
 available under a <abbr>BSD</abbr>-style license.</li>
 </ul>
 <h2 id="software">Other <code><abbr>tz</abbr></code>-based time zone software</h2>
@@ -528,7 +545,7 @@ href="https://www.oracle.com/java/index.html">Oracle
 Java</a> contains a copy of a subset of a recent
 <code><abbr>tz</abbr></code> database in a
 Java-specific format.</li>
-<li><a href="https://www.relativedata.com/time-zone-master">Time Zone
+<li><a href="https://relativedata.com/page/Time-Zone-Master">Time Zone
 Master</a> is a Microsoft Windows clock program that can automatically
 download, compile and use <code>tz</code> releases. The Basic version
 is free.</li>
@@ -554,9 +571,6 @@ its own <code>tztab</code>(4) format.</li>
 <a href="#System.TimeZoneInfo">above</a>.</li>
 <li><a href="https://www.worldtimeserver.com">World Time Server</a>
 is another time zone database.</li>
-<li><a href="http://tycho.usno.navy.mil/tzones.html">World Time Zones</a>
-contains data from the Time Service Department of the
-<abbr>US</abbr> Naval Observatory.</li>
 <li>The <a
 href="https://www.iata.org/publications/store/Pages/standard-schedules-information.aspx">Standard
 Schedules Information Manual</a> of the
@@ -591,7 +605,7 @@ mean solar and standard time, highlighting areas such as western China
 where the two differ greatly. It's a bit out of date, unfortunately.</li>
 </ul>
 <h2 id="boundaries">Time zone boundaries</h2>
-<p>Geographical boundaries between time zone regions are available
+<p>Geographical boundaries between timezones are available
 from several <a href="https://en.wikipedia.org/wiki/Geolocation">geolocation</a>
 services and other sources.</p>
 <ul>
@@ -600,7 +614,7 @@ services and other sources.</p>
 <li><a href="https://github.com/evansiroky/timezone-boundary-builder">Timezone
 Boundary Builder</a> extracts
 <a href="https://www.openstreetmap.org">Open Street Map</a> data to build
-boundaries of <code><abbr>tz</abbr></code> regions.
+boundaries of <code><abbr>tzdb</abbr></code> timezones.
 Its code is freely available under the <abbr>MIT</abbr> license, and
 its data entries are freely available under the
 <a href="https://opendatacommons.org/licenses/odbl/">Open Data Commons
@@ -608,9 +622,9 @@ Open Database License</a>. The maps' borders appear to be quite accurate.</li>
 <li><a href="http://efele.net/maps/tz/"><abbr>TZ</abbr> timezones
 maps</a> contains <a
 href="https://en.wikipedia.org/wiki/Shapefile">shapefiles</a> of
-sets of <code><abbr>tz</abbr></code> regions. This includes
+sets of <code><abbr>tzdb</abbr></code> timezones. This includes
 <a href="http://efele.net/maps/tz/world/">tz_world</a>, a shapefile
-for all the world's regions. These maps are no longer maintained and
+for all the world's timezones. These maps are no longer maintained and
 are superseded by the Timezone Boundary Builder.</li>
 <li><a
 href="https://github.com/straup/whereonearth-timezone">Whereonearth-timezone</a>
@@ -621,7 +635,7 @@ the tz_world shapefiles with the
 dataset.</li>
 </ul></li>
 <li>Programmatic interfaces that map geographical coordinates via tz_world to
-<code><abbr>tz</abbr></code> regions include:
+<code><abbr>tzdb</abbr></code> timezones include:
 <ul>
 <li><a href="https://github.com/mj1856/GeoTimeZone">GeoTimeZone</a> is
 written in <a
@@ -742,15 +756,19 @@ href="ftp://ftp.cs.huji.ac.il/pub/tz/announcements"
 hreflang="he">announcements (in Hebrew)</a>.</dd>
 <dt>Italy</dt>
 <dd>The National Institute of Metrological Research maintains a
-<a href="http://www.nanospin.eu/res/tf/ora_legale_i.shtml">table of civil time
+<a href="http://oldsite.inrim.it/res/tf/ora_legale_i.shtml">table of civil time
 (in Italian)</a>.</dd>
+<dt>Macau</dt>
+<dd>The Meteorological and Geophysical Bureau maintains a
+<a href="http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm">history
+of summer time</a>. Unfortunately it is incomplete and has errors.</dd>
+<dt>Malaysia</dt>
+<dd>See Singapore <a href="#Singapore">below</a>.</dd>
 <dt>Mexico</dt>
 <dd>The Investigation and Analysis Service of the Mexican Library of
 Congress has published a <a
 href="http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm"
 hreflang="es">history of Mexican local time (in Spanish)</a>.</dd>
-<dt>Malaysia</dt>
-<dd>See Singapore <a href="#Singapore">below</a>.</dd>
 <dt>Netherlands</dt>
 <dd><a href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
 hreflang="nl">Legal time in the Netherlands (in Dutch)</a>
@@ -797,11 +815,15 @@ title="Network Time Protocol">NTP</abbr>: The Network
 Time Protocol</a> (Internet <abbr>RFC</abbr> 5905)
 discusses how to synchronize clocks of
 Internet hosts.</li>
+<li>The <a href="https://www.usenix.org/system/files/conference/nsdi18/nsdi18-geng.pdf"><span style="font-variant: small-caps">Huygens</span></a>
+family of software algorithms can achieve accuracy to a few tens of
+nanoseconds in scalable server farms without special hardware.</li>
 <li>The <a
 href="https://www.nist.gov/intelligent-systems-division/ieee-1588">Precision
 Time Protocol</a> (<abbr
 title="Institute of Electrical and Electronics Engineers">IEEE</abbr> 1588)
-can achieve submicrosecond clock accuracy on a local area network.</li>
+can achieve submicrosecond clock accuracy on a local area network
+with special-purpose hardware.</li>
 <li><a
 href="https://tools.ietf.org/html/rfc4833">Timezone
 Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a>
@@ -915,7 +937,7 @@ but in China it denotes 8 hours ahead of <abbr>UT</abbr>,
 and French-speaking North Americans prefer
 "<abbr title="Heure Normale du Centre">HNC</abbr>" to
 "<abbr>CST</abbr>". The <code><abbr>tz</abbr></code>
-database contains English abbreviations for many time stamps;
+database contains English abbreviations for many timestamps;
 unfortunately some of these abbreviations were merely the database maintainers'
 inventions, and these have been removed when possible.</li>
 <li>Numeric time zone abbreviations typically count hours east of
@@ -929,7 +951,7 @@ for Japan and Hawaii, respectively. If the
 <code><abbr>tz</abbr></code> database is available, it is usually better to use
 settings like <code><abbr>TZ</abbr>="Asia/Tokyo"</code> and
 <code><abbr>TZ</abbr>="Pacific/Honolulu"</code> instead, as this should avoid
-confusion, handle old time stamps better, and insulate you better from
+confusion, handle old timestamps better, and insulate you better from
 any future changes to the rules. One should never set
 <abbr>POSIX</abbr> <code><abbr>TZ</abbr></code> to a value like
 <code>"GMT-9"</code>, though, since this would incorrectly imply that
index 530397f..79b19bf 100644 (file)
--- a/tzfile.5
+++ b/tzfile.5
@@ -1,6 +1,6 @@
 .TH TZFILE 5
 .SH NAME
-tzfile \- time zone information
+tzfile \- timezone information
 .SH DESCRIPTION
 .ie '\(lq'' .ds lq \&"\"
 .el .ds lq \(lq\"
@@ -9,7 +9,7 @@ tzfile \- time zone information
 .de q
 \\$3\*(lq\\$1\*(rq\\$2
 ..
-The time zone information files used by
+The timezone information files used by
 .BR tzset (3)
 are typically found under a directory with a name like
 .IR /usr/share/zoneinfo .
@@ -17,7 +17,7 @@ These files begin with a 44-byte header containing the following fields:
 .IP * 2
 The magic four-byte ASCII sequence
 .q "TZif"
-identifies the file as a time zone information file.
+identifies the file as a timezone information file.
 .IP *
 A byte identifying the version of the file's format
 (as of 2017, either an ASCII NUL, or
@@ -68,9 +68,12 @@ at which the rules for computing local time change.
 .IP *
 .I tzh_timecnt
 one-byte unsigned integer values;
-each one tells which of the different types of local time types
+each one but the last tells which of the different types of local time types
 described in the file is associated with the time period
-starting with the same-indexed transition time.
+starting with the same-indexed transition time
+and continuing up to but not including the next transition time.
+(The last time type is present only for consistency checking with the
+POSIX-style TZ string described below.)
 These values serve as indices into the next field.
 .IP *
 .I tzh_typecnt
@@ -127,15 +130,15 @@ transitions always separated by at least 28 days minus 1 second.
 standard/wall indicators, each stored as a one-byte value;
 they tell whether the transition times associated with local time types
 were specified as standard time or wall clock time,
-and are used when a time zone file is used in handling POSIX-style
-time zone environment variables.
+and are used when a timezone file is used in handling POSIX-style
+timezone environment variables.
 .IP *
 .I tzh_ttisgmtcnt
 UT/local indicators, each stored as a one-byte value;
 they tell whether the transition times associated with local time types
 were specified as UT or local time,
-and are used when a time zone file is used in handling POSIX-style
-time zone environment variables.
+and are used when a timezone file is used in handling POSIX-style
+timezone environment variables.
 .PP
 The
 .BR localtime (3)
@@ -151,7 +154,7 @@ if either
 is zero or the time argument is less than the first transition time recorded
 in the file.
 .SS Version 2 format
-For version-2-format time zone files,
+For version-2-format timezone files,
 the above header and data are followed by a second header and data,
 identical in format except that
 eight bytes are used for each transition time or leap second time.
@@ -159,22 +162,28 @@ eight bytes are used for each transition time or leap second time.
 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).
-The POSIX-style string must agree with the local time type after
-both data's last transition times; for example, given the string
+or for all instants if the file has no transitions.
+The POSIX-style TZ string is empty (i.e., nothing between the newlines)
+if there is no POSIX representation for such instants.
+If nonempty, the POSIX-style TZ string must agree with the local time
+type after the last transition time if present in the eight-byte data;
+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.
+Also, if there is at least one transition, time type 0 is associated
+with the time period from the indefinite past up to but not including
+the earliest transition time.
 .SS Version 3 format
-For version-3-format time zone files, the POSIX-TZ-style string may
+For version-3-format timezone files, the POSIX-TZ-style string may
 use two minor extensions to the POSIX TZ format, as described in
 .BR newtzset (3).
 First, the hours part of its transition times may be signed and range from
 \*-167 through 167 instead of the POSIX-required unsigned values
-from 0 through 24.  Second, DST is in effect all year if it starts
+from 0 through 24.
+Second, DST is in effect all year if it starts
 January 1 at 00:00 and ends December 31 at 24:00 plus the difference
 between daylight saving and standard time.
 .PP
index d55ac47..cf22c49 100644 (file)
@@ -1,15 +1,15 @@
 TZFILE(5)                     File Formats Manual                    TZFILE(5)
 
 NAME
-       tzfile - time zone information
+       tzfile - timezone information
 
 DESCRIPTION
-       The time zone information files used by tzset(3) are typically found
+       The timezone information files used by tzset(3) are typically found
        under a directory with a name like /usr/share/zoneinfo.  These files
        begin with a 44-byte header containing the following fields:
 
        * The magic four-byte ASCII sequence "TZif" identifies the file as a
-         time zone information file.
+         timezone information file.
 
        * A byte identifying the version of the file's format (as of 2017,
          either an ASCII NUL, or "2", or "3").
@@ -50,10 +50,13 @@ DESCRIPTION
          used as a transition time (as returned by time(2)) at which the rules
          for computing local time change.
 
-       * tzh_timecnt one-byte unsigned integer values; each one tells which of
-         the different types of local time types described in the file is
-         associated with the time period starting with the same-indexed
-         transition time.  These values serve as indices into the next field.
+       * tzh_timecnt one-byte unsigned integer values; each one but the last
+         tells which of the different types of local time types described in
+         the file is associated with the time period starting with the same-
+         indexed transition time and continuing up to but not including the
+         next transition time.  (The last time type is present only for
+         consistency checking with the POSIX-style TZ string described below.)
+         These values serve as indices into the next field.
 
        * tzh_typecnt ttinfo entries, each defined as follows:
 
@@ -83,13 +86,13 @@ DESCRIPTION
        * tzh_ttisstdcnt standard/wall indicators, each stored as a one-byte
          value; they tell whether the transition times associated with local
          time types were specified as standard time or wall clock time, and
-         are used when a time zone file is used in handling POSIX-style time
-         zone environment variables.
+         are used when a timezone file is used in handling POSIX-style
+         timezone environment variables.
 
        * tzh_ttisgmtcnt UT/local indicators, each stored as a one-byte value;
          they tell whether the transition times associated with local time
-         types were specified as UT or local time, and are used when a time
-         zone file is used in handling POSIX-style time zone environment
+         types were specified as UT or local time, and are used when a
+         timezone file is used in handling POSIX-style timezone environment
          variables.
 
        The localtime(3) function uses the first standard-time ttinfo structure
@@ -98,22 +101,26 @@ DESCRIPTION
        argument is less than the first transition time recorded in the file.
 
    Version 2 format
-       For version-2-format time zone files, the above header and data are
+       For version-2-format timezone files, the above header and data are
        followed by a second header and data, identical in format except that
        eight bytes are used for each transition time or leap second time.
        (Leap second counts remain four bytes.)  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).  The POSIX-style string 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.
+       stored in the file or for all instants if the file has no transitions.
+       The POSIX-style TZ string is empty (i.e., nothing between the newlines)
+       if there is no POSIX representation for such instants.  If nonempty,
+       the POSIX-style TZ string must agree with the local time type after the
+       last transition time if present in the eight-byte data; 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.
+       Also, if there is at least one transition, time type 0 is associated
+       with the time period from the indefinite past up to but not including
+       the earliest transition time.
 
    Version 3 format
-       For version-3-format time zone files, the POSIX-TZ-style string may use
+       For version-3-format timezone files, the POSIX-TZ-style string may use
        two minor extensions to the POSIX TZ format, as described in
        newtzset(3).  First, the hours part of its transition times may be
        signed and range from 167 through 167 instead of the POSIX-required
index f7f5caf..27a38cc 100644 (file)
--- a/tzfile.h
+++ b/tzfile.h
@@ -1,3 +1,5 @@
+/* Layout and location of TZif files.  */
+
 #ifndef TZFILE_H
 
 #define TZFILE_H
index 847d6dd..51f751c 100644 (file)
@@ -1,6 +1,6 @@
 .TH TZSELECT 8
 .SH NAME
-tzselect \- select a time zone
+tzselect \- select a timezone
 .SH SYNOPSIS
 .ie \n(.g .ds - \f(CW-\fP
 .el ds - \-
@@ -20,7 +20,7 @@ tzselect \- select a time zone
 The
 .B tzselect
 program asks the user for information about the current location,
-and outputs the resulting time zone description to standard output.
+and outputs the resulting timezone to standard output.
 The output is suitable as a value for the TZ environment variable.
 .PP
 All interaction with the user is done via standard input and standard error.
@@ -87,7 +87,7 @@ program (default:
 .BR awk ).
 .TP
 \f3TZDIR\fP
-Name of the directory containing time zone data files (default:
+Name of the directory containing timezone data files (default:
 .BR /usr/share/zoneinfo ).
 .SH FILES
 .TP
@@ -95,13 +95,13 @@ Name of the directory containing time zone data files (default:
 Table of ISO 3166 2-letter country codes and country names.
 .TP
 \f2TZDIR\fP\f3/zone1970.tab\fP
-Table of country codes, latitude and longitude, zone names, and
+Table of country codes, latitude and longitude, timezones, and
 descriptive comments.
 .TP
 \f2TZDIR\fP\f3/\fP\f2TZ\fP
-Time zone data file for time zone \f2TZ\fP.
+Timezone data file for timezone \f2TZ\fP.
 .SH "EXIT STATUS"
-The exit status is zero if a time zone was successfully obtained from the user,
+The exit status is zero if a timezone was successfully obtained from the user,
 nonzero otherwise.
 .SH "SEE ALSO"
 newctime(3), tzfile(5), zdump(8), zic(8)
index 9914750..af0a9fd 100644 (file)
@@ -1,16 +1,15 @@
 TZSELECT(8)                 System Manager's Manual                TZSELECT(8)
 
 NAME
-       tzselect - select a time zone
+       tzselect - select a timezone
 
 SYNOPSIS
        tzselect [ -c coord ] [ -n limit ] [ --help ] [ --version ]
 
 DESCRIPTION
        The tzselect program asks the user for information about the current
-       location, and outputs the resulting time zone description to standard
-       output.  The output is suitable as a value for the TZ environment
-       variable.
+       location, and outputs the resulting timezone to standard output.  The
+       output is suitable as a value for the TZ environment variable.
 
        All interaction with the user is done via standard input and standard
        error.
@@ -49,7 +48,7 @@ OPTIONS
 ENVIRONMENT VARIABLES
        AWK    Name of a Posix-compliant awk program (default: awk).
 
-       TZDIR  Name of the directory containing time zone data files (default:
+       TZDIR  Name of the directory containing timezone data files (default:
               /usr/share/zoneinfo).
 
 FILES
@@ -57,14 +56,14 @@ FILES
               Table of ISO 3166 2-letter country codes and country names.
 
        TZDIR/zone1970.tab
-              Table of country codes, latitude and longitude, zone names, and
+              Table of country codes, latitude and longitude, timezones, and
               descriptive comments.
 
        TZDIR/TZ
-              Time zone data file for time zone TZ.
+              Timezone data file for timezone TZ.
 
 EXIT STATUS
-       The exit status is zero if a time zone was successfully obtained from
+       The exit status is zero if a timezone was successfully obtained from
        the user, nonzero otherwise.
 
 SEE ALSO
index cde80d1..18fce27 100644 (file)
@@ -1,12 +1,11 @@
 #!/bin/bash
+# Ask the user about the time zone, and output the resulting TZ value to stdout.
+# Interact with the user via stderr and stdin.
 
 PKGVERSION='(tzcode) '
 TZVERSION=see_Makefile
 REPORT_BUGS_TO=tz@iana.org
 
-# Ask the user about the time zone, and output the resulting TZ value to stdout.
-# Interact with the user via stderr and stdin.
-
 # Contributed by Paul Eggert.  This file is in the public domain.
 
 # Porting notes:
@@ -55,7 +54,7 @@ location_limit=10
 zonetabtype=zone1970
 
 usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
-Select a time zone interactively.
+Select a timezone interactively.
 
 Options:
 
@@ -327,7 +326,7 @@ while
        eval '
            doselect '"$quoted_continents"' \
                "coord - I want to use geographical coordinates." \
-               "TZ - I want to specify the time zone using the Posix TZ format."
+               "TZ - I want to specify the timezone using the Posix TZ format."
            continent=$select_result
            case $continent in
            Americas) continent=America;;
@@ -342,8 +341,8 @@ while
                while
                        echo >&2 'Please enter the desired value' \
                                'of the TZ environment variable.'
-                       echo >&2 'For example, AEST-10 is a zone named AEST' \
-                               'that is 10 hours'
+                       echo >&2 'For example, AEST-10 is abbreviated' \
+                               'AEST and is 10 hours'
                        echo >&2 'ahead (east) of Greenwich,' \
                                'with no daylight saving time.'
                        read TZ
@@ -362,7 +361,7 @@ while
                                exit 0
                        }'
                do
-                   say >&2 "'$TZ' is not a conforming Posix time zone string."
+                   say >&2 "'$TZ' is not a conforming Posix timezone string."
                done
                TZ_for_date=$TZ;;
        *)
@@ -388,8 +387,7 @@ while
                      BEGIN { FS = "\t" }
                      { print $NF }
                    '`
-                   echo >&2 'Please select one of the following' \
-                           'time zone regions,'
+                   echo >&2 'Please select one of the following timezones,' \
                    echo >&2 'listed roughly in increasing order' \
                            "of distance from $coord".
                    doselect $regions
@@ -439,7 +437,7 @@ while
                esac
 
 
-               # Get list of names of time zone rule regions in the country.
+               # Get list of timezones in the country.
                regions=`$AWK \
                        -v country="$country" \
                        -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
@@ -462,8 +460,7 @@ while
                # If there's more than one region, ask the user which one.
                case $regions in
                *"$newline"*)
-                       echo >&2 'Please select one of the following' \
-                               'time zone regions.'
+                       echo >&2 'Please select one of the following timezones.'
                        doselect $regions
                        region=$select_result;;
                *)
diff --git a/version b/version
index cc61cea..78d5ebf 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-2018e
+2018f
index 4b3b64a..8fb18a4 100644 (file)
@@ -1,4 +1,5 @@
 #! /bin/sh
+# Convert manual page troff stdin to formatted .txt stdout.
 
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
index dfdcdf0..d674175 100644 (file)
@@ -1,4 +1,5 @@
 #! /bin/sh
+: 'Determine whether year is of appropriate type (this file is obsolete).'
 
 : 'This file is in the public domain, so clarified as of'
 : '2006-07-17 by Arthur David Olson.'
diff --git a/zdump.8 b/zdump.8
index ef611db..f369056 100644 (file)
--- a/zdump.8
+++ b/zdump.8
@@ -1,12 +1,12 @@
 .TH ZDUMP 8
 .SH NAME
-zdump \- time zone dumper
+zdump \- timezone dumper
 .SH SYNOPSIS
 .B zdump
 [
 .I option
 \&... ] [
-.I zonename
+.I timezone
 \&... ]
 .SH DESCRIPTION
 .ie '\(lq'' .ds lq \&"\"
@@ -18,29 +18,31 @@ zdump \- time zone dumper
 ..
 .ie \n(.g .ds - \f(CW-\fP
 .el ds - \-
-.I Zdump
-prints the current time in each
-.I zonename
+The
+.B zdump
+program prints the current time in each
+.I timezone
 named on the command line.
-.PP
-These options are available:
+.SH OPTIONS
 .TP
-.BI "\*-\*-version"
+.B \*-\*-version
 Output version information and exit.
 .TP
+.B \*-\*-help
+Output short usage message 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
+.I timezone
 on the command line, output an interval-format description of the
-zone.  See
+timezone.  See
 .q "INTERVAL FORMAT"
 below.
 .TP
 .B \*-v
 Output a verbose description of time intervals.
 For each
-.I zonename
+.I timezone
 on the command line,
 print the time at the lowest possible time value,
 the time one day after the lowest possible time value,
@@ -68,7 +70,7 @@ 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.
 .TP
-.BI "\*-c " [loyear,]hiyear
+.BI "\*-c " \fR[\fIloyear , \fR]\fIhiyear
 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.
@@ -80,26 +82,24 @@ of 1970 includes the transition.
 The default cutoff is
 .BR \*-500,2500 .
 .TP
-.BI "\*-t " [lotime,]hitime
+.BI "\*-t " \fR[\fIlotime , \fR]\fIhitime
 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
-.I zonename
+.I timezone
 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
+is a double-quoted string giving the timezone, a second line
 .q "\*- \*- \fIinterval\fP"
 describing the time interval before the first transition if any, and
 zero or more following lines
@@ -212,15 +212,16 @@ 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.
+which uses UTC for modern timestamps and some other UT flavor for
+timestamps that predate the introduction of UTC.
 No attempt is currently made to have the output use
 .q "UTC"
 for newer and
 .q "UT"
-for older time stamps, partly because the exact date of the
+for older timestamps, partly because the exact date of the
 introduction of UTC is problematic.
-.SH "SEE ALSO"
-newctime(3), tzfile(5), zic(8)
+.SH SEE ALSO
+.BR tzfile (5),
+.BR zic (8)
 .\" This file is in the public domain, so clarified as of
 .\" 2009-05-17 by Arthur David Olson.
index a24d652..016b903 100644 (file)
@@ -1,27 +1,27 @@
 ZDUMP(8)                    System Manager's Manual                   ZDUMP(8)
 
 NAME
-       zdump - time zone dumper
+       zdump - timezone dumper
 
 SYNOPSIS
-       zdump [ option ... ] [ zonename ... ]
+       zdump [ option ... ] [ timezone ... ]
 
 DESCRIPTION
-       Zdump prints the current time in each zonename named on the command
-       line.
-
-       These options are available:
+       The zdump program prints the current time in each timezone named on the
+       command line.
 
+OPTIONS
        --version
               Output version information and exit.
 
-       -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.
+       --help Output short usage message and exit.
+
+       -i     Output a description of time intervals.  For each timezone on
+              the command line, output an interval-format description of the
+              timezone.  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
+              timezone 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
@@ -48,20 +48,18 @@ DESCRIPTION
        -t [lotime,]hitime
               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
+              (UTC).  The timezone 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.
+       the timezone, 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.
@@ -132,13 +130,13 @@ LIMITATIONS
        cases; one can construct artificial time zones for which this fails.
 
        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.
+       which uses UTC for modern timestamps and some other UT flavor for
+       timestamps that predate the introduction of UTC.  No attempt is
+       currently made to have the output use "UTC" for newer and "UT" for
+       older timestamps, partly because the exact date of the introduction of
+       UTC is problematic.
 
 SEE ALSO
-       newctime(3), tzfile(5), zic(8)
+       tzfile(5), zic(8)
 
                                                                       ZDUMP(8)
diff --git a/zdump.c b/zdump.c
index a4d9108..608f288 100644 (file)
--- a/zdump.c
+++ b/zdump.c
@@ -1,3 +1,5 @@
+/* Dump time zone data in a textual format.  */
+
 /*
 ** This file is in the public domain, so clarified as of
 ** 2009-05-17 by Arthur David Olson.
@@ -382,7 +384,7 @@ static void
 usage(FILE * const stream, const int status)
 {
        fprintf(stream,
-_("%s: usage: %s OPTIONS ZONENAME ...\n"
+_("%s: usage: %s OPTIONS TIMEZONE ...\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"
diff --git a/zic.8 b/zic.8
index d105b24..c277d9c 100644 (file)
--- a/zic.8
+++ b/zic.8
@@ -1,6 +1,6 @@
 .TH ZIC 8
 .SH NAME
-zic \- time zone compiler
+zic \- timezone compiler
 .SH SYNOPSIS
 .B zic
 [
@@ -28,36 +28,43 @@ zic \- time zone compiler
 .  ds :
 .  ds - \-
 .\}
-.I Zic
-reads text from the file(s) named on the command line
+The
+.B zic
+program reads text from the file(s) named on the command line
 and creates the time conversion information files specified in this input.
 If a
 .I filename
 is
 .q "\*-" ,
-the standard input is read.
-.PP
-These options are available:
+standard input is read.
+.SH OPTIONS
 .TP
-.BI "\*-\*-version"
+.B "\*-\*-version"
 Output version information and exit.
 .TP
+.B \*-\*-help
+Output short usage message and exit.
+.TP
 .BI "\*-d " directory
 Create time conversion information files in the named directory rather than
 in the standard directory named below.
 .TP
 .BI "\*-l " timezone
-Use the given time zone as local time.
-.I Zic
+Use
+.I timezone
+as local time.
+.B zic
 will act as if the input contained a link line of the form
 .sp
 .ti +.5i
 Link   \fItimezone\fP          localtime
 .TP
 .BI "\*-p " timezone
-Use the given time zone's rules when handling POSIX-format
-time zone environment variables.
-.I Zic
+Use
+.IR timezone 's
+rules when handling POSIX-format
+timezone environment variables.
+.B zic
 will act as if the input contained a link line of the form
 .sp
 .ti +.5i
@@ -80,21 +87,21 @@ The input specifies a link to a link.
 .PP
 A year that appears in a data file is outside the range
 of years representable by
-.IR time (2)
+.BR time (2)
 values.
 .PP
 A time of 24:00 or more appears in the input.
 Pre-1998 versions of
-.I zic
+.B zic
 prohibit 24:00, and pre-2007 versions prohibit times greater than 24:00.
 .PP
 A rule goes past the start or end of the month.
 Pre-2004 versions of
-.I zic
+.B zic
 prohibit this.
 .PP
 The output file does not contain all the information about the
-long-term future of a zone, because the future cannot be summarized as
+long-term future of a timezone, because the future cannot be summarized as
 an extended POSIX TZ string.  For example, as of 2013 this problem
 occurs for Iran's daylight-saving rules for the predicted future, as
 these rules are based on the Iranian calendar, which cannot be
@@ -102,8 +109,8 @@ represented.
 .PP
 The output contains data that may not be handled properly by client
 code designed for older
-.I zic
-output formats.  These compatibility issues affect only time stamps
+.B zic
+output formats.  These compatibility issues affect only timestamps
 before 1970 or after the start of 2038.
 .PP
 A time zone abbreviation has fewer than 3 characters.
@@ -148,7 +155,7 @@ to the end of the line the sharp character appears on.
 White space characters and sharp characters may be enclosed in double quotes
 (") if they're to be used as part of a field.
 Any line that is blank (after comment stripping) is ignored.
-Non-blank lines are expected to be of one of three types:
+Nonblank lines are expected to be of one of three types:
 rule lines, zone lines, and link lines.
 .PP
 Names must be in English and are case insensitive.
@@ -165,20 +172,28 @@ abbreviation must be unambiguous in context.
 A rule line has the form
 .nf
 .ti +.5i
-.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00s\0\0'u +\w'1:00d\0\0'u
+.ta \w'Rule\0\0'u +\w'NAME\0\0'u +\w'FROM\0\0'u +\w'1973\0\0'u +\w'TYPE\0\0'u +\w'Apr\0\0'u +\w'lastSun\0\0'u +\w'2:00w\0\0'u +\w'1:00d\0\0'u
 .sp
 Rule   NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 .sp
 For example:
 .ti +.5i
 .sp
-Rule   US      1967    1973    \*-     Apr     lastSun 2:00s   1:00d   D
+Rule   US      1967    1973    \*-     Apr     lastSun 2:00w   1:00d   D
 .sp
 .fi
 The fields that make up a rule line are:
 .TP "\w'LETTER/S'u"
 .B NAME
-Gives the (arbitrary) name of the set of rules this rule is part of.
+Gives the name of the rule set that contains this line.
+The name must start with a character that is neither
+an ASCII digit nor
+.q \*-
+nor
+.q + .
+To allow for future extensions,
+an unquoted name should not contain characters from the set
+.q !$%&'()*,/:;<=>?@[\e]^`{|}~ .
 .TP
 .B FROM
 Gives the first year in which the rule applies.
@@ -212,7 +227,7 @@ field.
 should be
 .q \*-
 and is present for compatibility with older versions of
-.I zic
+.B zic
 in which it could contain year types.
 .TP
 .B IN
@@ -246,7 +261,8 @@ Note that there must be no spaces within the
 field.
 .TP
 .B AT
-Gives the time of day at which the rule takes effect.
+Gives the time of day at which the rule takes effect,
+relative to 00:00, the start of a calendar day.
 Recognized forms include:
 .nf
 .in +.5i
@@ -256,17 +272,17 @@ Recognized forms include:
 2:00   time in hours and minutes
 01:28:14       time in hours, minutes, and seconds
 00:19:32.13    time with fractional seconds
-15:00  24-hour format time (for times after noon)
+12:00  midday, 12 hours after 00:00
+15:00  3 PM, 15 hours after 00:00
+24:00  end of day, 24 hours after 00:00
 260:00 260 hours after 00:00
 \*-2:30        2.5 hours before 00:00
 \*-    equivalent to 0
 .fi
 .in -.5i
 .sp
-where hour 0 is midnight at the start of the day,
-and hour 24 is midnight at the end of the day.
 Although
-.I zic
+.B zic
 rounds times to the nearest integer second
 (breaking ties to the even integer), the fractions may be useful
 to other applications requiring greater precision.
@@ -313,7 +329,7 @@ Negative offsets are allowed; in Ireland, for example, daylight saving
 time is observed in winter and has a negative offset relative to
 Irish Standard Time.
 The offset is merely added to standard time; for example,
-.I zic
+.B zic
 does not distinguish a 10:30 standard time plus an 0:30
 .B SAVE
 from a 10:00 standard time plus a 1:00
@@ -339,8 +355,8 @@ A zone line has the form
 .sp
 .nf
 .ti +.5i
-.ta \w'Zone\0\0'u +\w'Asia/Amman\0\0'u +\w'GMTOFF\0\0'u +\w'Jordan\0\0'u +\w'FORMAT\0\0'u
-Zone   NAME    GMTOFF  RULES   FORMAT  [UNTIL]
+.ta \w'Zone\0\0'u +\w'Asia/Amman\0\0'u +\w'UTOFF\0\0'u +\w'Jordan\0\0'u +\w'FORMAT\0\0'u
+Zone   NAME    UTOFF   RULES   FORMAT  [UNTIL]
 .sp
 For example:
 .sp
@@ -349,11 +365,11 @@ Zone      Asia/Amman      2:00    Jordan  EE%sT   2017 Oct 27 01:00
 .sp
 .fi
 The fields that make up a zone line are:
-.TP "\w'GMTOFF'u"
+.TP "\w'UTOFF'u"
 .B NAME
-The name of the time zone.
+The name of the timezone.
 This is the name used in creating the time conversion information file for the
-zone.
+timezone.
 It should not contain a file name component
 .q ".\&"
 or
@@ -361,8 +377,8 @@ or
 a file name component is a maximal substring that does not contain
 .q "/" .
 .TP
-.B GMTOFF
-The amount of time to add to UT to get standard time in this zone.
+.B UTOFF
+The amount of time to add to UT to get standard time.
 This field has the same format as the
 .B AT
 and
@@ -371,18 +387,18 @@ fields of rule lines;
 begin the field with a minus sign if time must be subtracted from UT.
 .TP
 .B RULES
-The name of the rules that apply in the time zone or,
+The name of the rules that apply in the timezone or,
 alternatively, a field in the same format as a rule-line SAVE column,
 giving of the amount of time to be added to local standard time
 effect, and whether the resulting time is standard or daylight saving.
 If this field is
 .B \*-
-then standard time always applies in the time zone.
+then standard time always applies.
 When an amount of time is given, only the sum of standard time and
 this amount matters.
 .TP
 .B FORMAT
-The format for time zone abbreviations in this time zone.
+The format for time zone abbreviations.
 The pair of characters
 .B %s
 is used to show where the
@@ -405,7 +421,10 @@ Alternatively,
 a slash (/)
 separates standard and daylight abbreviations.
 To conform to POSIX, a time zone abbreviation should contain only
-alphanumeric ASCII characters, "+" and "\*-".
+alphanumeric ASCII characters,
+.q "+"
+and
+.q "\*-".
 .TP
 .B UNTIL
 The time at which the UT offset or the rule(s) change for a location.
@@ -510,7 +529,7 @@ if the leap second time given by the other fields should be interpreted as
 local wall clock time.
 .SH "EXTENDED EXAMPLE"
 Here is an extended example of
-.I zic
+.B zic
 input, intended to illustrate many of its features.
 In this example, the EU rules are for the European Union
 and for its predecessor organization, the European Communities.
@@ -531,8 +550,8 @@ Rule        EU      1979    1995    \*-     Sep     lastSun 1:00u   0       \*-
 Rule   EU      1981    max     \*-     Mar     lastSun 1:00u   1:00    S
 Rule   EU      1996    max     \*-     Oct     lastSun 1:00u   0       \*-
 .sp
-.ta \w'# Zone\0\0'u +\w'Europe/Zurich\0\0'u +\w'GMTOFF\0\0'u +\w'0:34:08\0\0'u +\w'FORMAT\0\0'u
-# Zone NAME    GMTOFF  RULES   FORMAT  [UNTIL]
+.ta \w'# Zone\0\0'u +\w'Europe/Zurich\0\0'u +\w'0:34:08\0\0'u +\w'RULES\0\0'u +\w'FORMAT\0\0'u
+# Zone NAME    UTOFF   RULES   FORMAT  [UNTIL]
 Zone   Europe/Zurich   0:34:08 \*-     LMT     1853 Jul 16
                0:29:46 \*-     BMT     1894 Jun
                1:00    Swiss   CE%sT   1981
@@ -542,14 +561,15 @@ Link      Europe/Zurich   Europe/Vaduz
 .sp
 .in
 .fi
-In this example, the zone is named Europe/Zurich but it has an alias
+In this example, the timezone is named Europe/Zurich but it has an alias
 as Europe/Vaduz.  This example says that Zurich was 34 minutes and 8
 seconds east of UT until 1853-07-16 at 00:00, when the legal offset
 was changed to 7\(de\|26\(fm\|22.50\(sd; although this works out to
 0:29:45.50, the input format cannot represent fractional seconds so it
 is rounded here.  After 1894-06-01 at 00:00 the UT offset became one hour
-and Swiss daylight saving rules (defined with lines beginning with "Rule
-Swiss") apply.  From 1981 to the present, EU daylight saving rules have
+and Swiss daylight saving rules (defined with lines beginning with
+.q "Rule Swiss")
+apply.  From 1981 to the present, EU daylight saving rules have
 applied, and the UTC offset has remained at one hour.
 .PP
 In 1941 and 1942, daylight saving time applied from the first Monday
@@ -560,11 +580,21 @@ saving has begun on the last Sunday in March at 01:00 UTC.
 Until 1995 it ended the last Sunday in September at 01:00 UTC,
 but this changed to the last Sunday in October starting in 1996.
 .PP
-For purposes of
-display, "LMT" and "BMT" were initially used, respectively.  Since
-Swiss rules and later EU rules were applied, the display name for the
-time zone has been CET for standard time and CEST for daylight saving
+For purposes of display,
+.q "LMT"
+and
+.q "BMT"
+were initially used, respectively.  Since
+Swiss rules and later EU rules were applied, the time zone abbreviation
+has been CET for standard time and CEST for daylight saving
 time.
+.SH FILES
+.TP
+.I /etc/localtime
+Default local timezone file.
+.TP
+.I /usr/share/zoneinfo
+Default timezone information directory.
 .SH NOTES
 For areas with more than two types of local time,
 you may need to use local standard time in the
@@ -573,27 +603,18 @@ field of the earliest transition time's rule to ensure that
 the earliest transition time recorded in the compiled file is correct.
 .PP
 If,
-for a particular zone,
+for a particular timezone,
 a clock advance caused by the start of daylight saving
 coincides with and is equal to
 a clock retreat caused by a change in UT offset,
-.IR zic
+.B zic
 produces a single transition to daylight saving at the new UT offset
 (without any change in wall clock time).
 To get separate transitions
 use multiple zone continuation lines
 specifying transition instants using universal time.
-.PP
-Time stamps well before the Big Bang are silently omitted from the output.
-This works around bugs in software that mishandles large negative time
-stamps.  Call it sour grapes, but pre-Big-Bang time stamps are
-physically suspect anyway.  The pre-Big-Bang cutoff time is
-approximate and may change in future versions.
-.SH FILES
-.ta \w'/usr/share/zoneinfo\0\0'u
-/etc/localtime default local time zone file
-/usr/share/zoneinfo    default time zone information directory
-.SH "SEE ALSO"
-newctime(3), tzfile(5), zdump(8)
+.SH SEE ALSO
+.BR tzfile (5),
+.BR zdump (8)
 .\" This file is in the public domain, so clarified as of
 .\" 2009-05-17 by Arthur David Olson.
index fc91cb2..40335b7 100644 (file)
--- a/zic.8.txt
+++ b/zic.8.txt
@@ -1,35 +1,36 @@
 ZIC(8)                      System Manager's Manual                     ZIC(8)
 
 NAME
-       zic - time zone compiler
+       zic - timezone compiler
 
 SYNOPSIS
        zic [ option ... ] [ filename ... ]
 
 DESCRIPTION
-       Zic reads text from the file(s) named on the command line and creates
-       the time conversion information files specified in this input.  If a
-       filename is "-", the standard input is read.
-
-       These options are available:
+       The zic program reads text from the file(s) named on the command line
+       and creates the time conversion information files specified in this
+       input.  If a filename is "-", standard input is read.
 
+OPTIONS
        --version
               Output version information and exit.
 
+       --help Output short usage message and exit.
+
        -d directory
               Create time conversion information files in the named directory
               rather than in the standard directory named below.
 
        -l timezone
-              Use the given time zone as local time.  Zic will act as if the
-              input contained a link line of the form
+              Use timezone as local time.  zic will act as if the input
+              contained a link line of the form
 
                    Link timezone       localtime
 
        -p timezone
-              Use the given time zone's rules when handling POSIX-format time
-              zone environment variables.  Zic will act as if the input
-              contained a link line of the form
+              Use timezone's rules when handling POSIX-format timezone
+              environment variables.  zic will act as if the input contained a
+              link line of the form
 
                    Link timezone       posixrules
 
@@ -57,7 +58,7 @@ DESCRIPTION
               versions of zic prohibit this.
 
               The output file does not contain all the information about the
-              long-term future of a zone, because the future cannot be
+              long-term future of a timezone, because the future cannot be
               summarized as an extended POSIX TZ string.  For example, as of
               2013 this problem occurs for Iran's daylight-saving rules for
               the predicted future, as these rules are based on the Iranian
@@ -65,8 +66,8 @@ DESCRIPTION
 
               The output contains data that may not be handled properly by
               client code designed for older zic output formats.  These
-              compatibility issues affect only time stamps before 1970 or
-              after the start of 2038.
+              compatibility issues affect only timestamps before 1970 or after
+              the start of 2038.
 
               A time zone abbreviation has fewer than 3 characters.  POSIX
               requires at least 3.
@@ -99,7 +100,7 @@ DESCRIPTION
        comment which extends to the end of the line the sharp character
        appears on.  White space characters and sharp characters may be
        enclosed in double quotes (") if they're to be used as part of a field.
-       Any line that is blank (after comment stripping) is ignored.  Non-blank
+       Any line that is blank (after comment stripping) is ignored.  Nonblank
        lines are expected to be of one of three types: rule lines, zone lines,
        and link lines.
 
@@ -115,12 +116,15 @@ DESCRIPTION
 
        For example:
 
-            Rule  US    1967  1973  -     Apr  lastSun  2:00s  1:00d  D
+            Rule  US    1967  1973  -     Apr  lastSun  2:00w  1:00d  D
 
        The fields that make up a rule line are:
 
-       NAME    Gives the (arbitrary) name of the set of rules this rule is
-               part of.
+       NAME    Gives the name of the rule set that contains this line.  The
+               name must start with a character that is neither an ASCII digit
+               nor "-" nor "+".  To allow for future extensions, an unquoted
+               name should not contain characters from the set
+               "!$%&'()*,/:;<=>?@[\]^`{|}~".
 
        FROM    Gives the first year in which the rule applies.  Any signed
                integer year can be supplied; the proleptic Gregorian calendar
@@ -155,31 +159,33 @@ DESCRIPTION
                "last" (e.g., lastSunday) may be abbreviated or spelled out in
                full.  Note that there must be no spaces within the ON field.
 
-       AT      Gives the time of day at which the rule takes effect.
-               Recognized forms include:
+       AT      Gives the time of day at which the rule takes effect, relative
+               to 00:00, the start of a calendar day.  Recognized forms
+               include:
 
                     2            time in hours
                     2:00         time in hours and minutes
                     01:28:14     time in hours, minutes, and seconds
                     00:19:32.13  time with fractional seconds
-                    15:00        24-hour format time (for times after noon)
+                    12:00        midday, 12 hours after 00:00
+                    15:00        3 PM, 15 hours after 00:00
+                    24:00        end of day, 24 hours after 00:00
                     260:00       260 hours after 00:00
                     -2:30        2.5 hours before 00:00
                     -            equivalent to 0
 
-               where hour 0 is midnight at the start of the day, and hour 24
-               is midnight at the end of the day.  Although zic rounds times
-               to the nearest integer second (breaking ties to the even
-               integer), the fractions may be useful to other applications
-               requiring greater precision.  The source format does not
-               specify any maximum precision.  Any of these forms may be
-               followed by the letter w if the given time is local "wall
-               clock" time, s if the given time is local "standard" time, or u
-               (or g or z) if the given time is universal time; in the absence
-               of an indicator, wall clock time is assumed.  The intent is
-               that a rule line describes the instants when a clock/calendar
-               set to the type of time specified in the AT field would show
-               the specified date and time of day.
+               Although zic rounds times to the nearest integer second
+               (breaking ties to the even integer), the fractions may be
+               useful to other applications requiring greater precision.  The
+               source format does not specify any maximum precision.  Any of
+               these forms may be followed by the letter w if the given time
+               is local "wall clock" time, s if the given time is local
+               "standard" time, or u (or g or z) if the given time is
+               universal time; in the absence of an indicator, wall clock time
+               is assumed.  The intent is that a rule line describes the
+               instants when a clock/calendar set to the type of time
+               specified in the AT field would show the specified date and
+               time of day.
 
        SAVE    Gives the amount of time to be added to local standard time
                when the rule is in effect, and whether the resulting time is
@@ -201,63 +207,62 @@ DESCRIPTION
 
        A zone line has the form
 
-            Zone  NAME        GMTOFF  RULES   FORMAT  [UNTIL]
+            Zone  NAME        UTOFF  RULES   FORMAT  [UNTIL]
 
        For example:
 
-            Zone  Asia/Amman  2:00    Jordan  EE%sT   2017 Oct 27 01:00
+            Zone  Asia/Amman  2:00   Jordan  EE%sT   2017 Oct 27 01:00
 
        The fields that make up a zone line are:
 
-       NAME  The name of the time zone.  This is the name used in creating the
-             time conversion information file for the zone.  It should not
-             contain a file name component "." or ".."; a file name component
-             is a maximal substring that does not contain "/".
-
-       GMTOFF
-             The amount of time to add to UT to get standard time in this
-             zone.  This field has the same format as the AT and SAVE fields
-             of rule lines; begin the field with a minus sign if time must be
-             subtracted from UT.
-
-       RULES The name of the rules that apply in the time zone or,
-             alternatively, a field in the same format as a rule-line SAVE
-             column, giving of the amount of time to be added to local
-             standard time effect, and whether the resulting time is standard
-             or daylight saving.  If this field is - then standard time always
-             applies in the time zone.  When an amount of time is given, only
-             the sum of standard time and this amount matters.
+       NAME The name of the timezone.  This is the name used in creating the
+            time conversion information file for the timezone.  It should not
+            contain a file name component "." or ".."; a file name component
+            is a maximal substring that does not contain "/".
+
+       UTOFF
+            The amount of time to add to UT to get standard time.  This field
+            has the same format as the AT and SAVE fields of rule lines; begin
+            the field with a minus sign if time must be subtracted from UT.
+
+       RULES
+            The name of the rules that apply in the timezone or,
+            alternatively, a field in the same format as a rule-line SAVE
+            column, giving of the amount of time to be added to local standard
+            time effect, and whether the resulting time is standard or
+            daylight saving.  If this field is - then standard time always
+            applies.  When an amount of time is given, only the sum of
+            standard time and this amount matters.
 
        FORMAT
-             The format for time zone abbreviations in this time zone.  The
-             pair of characters %s is used to show where the "variable part"
-             of the time zone abbreviation goes.  Alternatively, a format can
-             use the pair of characters %z to stand for the UT offset in the
-             form +-hh, +-hhmm, or +-hhmmss, using the shortest form that does
-             not lose information, where hh, mm, and ss are the hours,
-             minutes, and seconds east (+) or west (-) of UT.  Alternatively,
-             a slash (/) separates standard and daylight abbreviations.  To
-             conform to POSIX, a time zone abbreviation should contain only
-             alphanumeric ASCII characters, "+" and "-".
-
-       UNTIL The time at which the UT offset or the rule(s) change for a
-             location.  It takes the form of YEAR [MONTH [DAY [TIME]]].  If
-             this is specified, the time zone information is generated from
-             the given UT offset and rule change until the time specified,
-             which is interpreted using the rules in effect just before the
-             transition.  The month, day, and time of day have the same format
-             as the IN, ON, and AT fields of a rule; trailing fields can be
-             omitted, and default to the earliest possible value for the
-             missing fields.
-
-             The next line must be a "continuation" line; this has the same
-             form as a zone line except that the string "Zone" and the name
-             are omitted, as the continuation line will place information
-             starting at the time specified as the "until" information in the
-             previous line in the file used by the previous line.
-             Continuation lines may contain "until" information, just as zone
-             lines do, indicating that the next line is a further
-             continuation.
+            The format for time zone abbreviations.  The pair of characters %s
+            is used to show where the "variable part" of the time zone
+            abbreviation goes.  Alternatively, a format can use the pair of
+            characters %z to stand for the UT offset in the form +-hh, +-hhmm,
+            or +-hhmmss, using the shortest form that does not lose
+            information, where hh, mm, and ss are the hours, minutes, and
+            seconds east (+) or west (-) of UT.  Alternatively, a slash (/)
+            separates standard and daylight abbreviations.  To conform to
+            POSIX, a time zone abbreviation should contain only alphanumeric
+            ASCII characters, "+" and "-".
+
+       UNTIL
+            The time at which the UT offset or the rule(s) change for a
+            location.  It takes the form of YEAR [MONTH [DAY [TIME]]].  If
+            this is specified, the time zone information is generated from the
+            given UT offset and rule change until the time specified, which is
+            interpreted using the rules in effect just before the transition.
+            The month, day, and time of day have the same format as the IN,
+            ON, and AT fields of a rule; trailing fields can be omitted, and
+            default to the earliest possible value for the missing fields.
+
+            The next line must be a "continuation" line; this has the same
+            form as a zone line except that the string "Zone" and the name are
+            omitted, as the continuation line will place information starting
+            at the time specified as the "until" information in the previous
+            line in the file used by the previous line.  Continuation lines
+            may contain "until" information, just as zone lines do, indicating
+            that the next line is a further continuation.
 
        If a zone changes at the same instant that a rule would otherwise take
        effect in the earlier zone or continuation line, the rule is ignored.
@@ -312,23 +317,23 @@ EXTENDED EXAMPLE
          Rule    EU    1981  max   -     Mar  lastSun  1:00u 1:00  S
          Rule    EU    1996  max   -     Oct  lastSun  1:00u 0     -
 
-         # Zone  NAME           GMTOFF  RULES    FORMAT  [UNTIL]
-         Zone    Europe/Zurich  0:34:08 -        LMT     1853 Jul 16
-                                0:29:46 -        BMT     1894 Jun
-                                1:00    Swiss    CE%sT   1981
-                                1:00    EU       CE%sT
+         # Zone  NAME           UTOFF    RULES  FORMAT  [UNTIL]
+         Zone    Europe/Zurich  0:34:08  -      LMT     1853 Jul 16
+                                0:29:46  -      BMT     1894 Jun
+                                1:00     Swiss  CE%sT   1981
+                                1:00     EU     CE%sT
 
          Link    Europe/Zurich  Europe/Vaduz
 
-       In this example, the zone is named Europe/Zurich but it has an alias as
-       Europe/Vaduz.  This example says that Zurich was 34 minutes and 8
-       seconds east of UT until 1853-07-16 at 00:00, when the legal offset was
-       changed to 7o26'22.50''; although this works out to 0:29:45.50, the
-       input format cannot represent fractional seconds so it is rounded here.
-       After 1894-06-01 at 00:00 the UT offset became one hour and Swiss
-       daylight saving rules (defined with lines beginning with "Rule Swiss")
-       apply.  From 1981 to the present, EU daylight saving rules have
-       applied, and the UTC offset has remained at one hour.
+       In this example, the timezone is named Europe/Zurich but it has an
+       alias as Europe/Vaduz.  This example says that Zurich was 34 minutes
+       and 8 seconds east of UT until 1853-07-16 at 00:00, when the legal
+       offset was changed to 7o26'22.50''; although this works out to
+       0:29:45.50, the input format cannot represent fractional seconds so it
+       is rounded here.  After 1894-06-01 at 00:00 the UT offset became one
+       hour and Swiss daylight saving rules (defined with lines beginning with
+       "Rule Swiss") apply.  From 1981 to the present, EU daylight saving
+       rules have applied, and the UTC offset has remained at one hour.
 
        In 1941 and 1942, daylight saving time applied from the first Monday in
        May at 01:00 to the first Monday in October at 02:00.  The pre-1981 EU
@@ -340,8 +345,15 @@ EXTENDED EXAMPLE
 
        For purposes of display, "LMT" and "BMT" were initially used,
        respectively.  Since Swiss rules and later EU rules were applied, the
-       display name for the time zone has been CET for standard time and CEST
-       for daylight saving time.
+       time zone abbreviation has been CET for standard time and CEST for
+       daylight saving time.
+
+FILES
+       /etc/localtime
+              Default local timezone file.
+
+       /usr/share/zoneinfo
+              Default timezone information directory.
 
 NOTES
        For areas with more than two types of local time, you may need to use
@@ -349,24 +361,14 @@ NOTES
        rule to ensure that the earliest transition time recorded in the
        compiled file is correct.
 
-       If, for a particular zone, a clock advance caused by the start of
+       If, for a particular timezone, a clock advance caused by the start of
        daylight saving coincides with and is equal to a clock retreat caused
        by a change in UT offset, zic produces a single transition to daylight
        saving at the new UT offset (without any change in wall clock time).
        To get separate transitions use multiple zone continuation lines
        specifying transition instants using universal time.
 
-       Time stamps well before the Big Bang are silently omitted from the
-       output.  This works around bugs in software that mishandles large
-       negative time stamps.  Call it sour grapes, but pre-Big-Bang time
-       stamps are physically suspect anyway.  The pre-Big-Bang cutoff time is
-       approximate and may change in future versions.
-
-FILES
-       /etc/localtime       default local time zone file
-       /usr/share/zoneinfo  default time zone information directory
-
 SEE ALSO
-       newctime(3), tzfile(5), zdump(8)
+       tzfile(5), zdump(8)
 
                                                                         ZIC(8)
diff --git a/zic.c b/zic.c
index 31f1092..06becc2 100644 (file)
--- a/zic.c
+++ b/zic.c
@@ -1,3 +1,5 @@
+/* Compile .zi time zone data into TZif binary files.  */
+
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -154,8 +156,7 @@ static void adjleap(void);
 static void    associate(void);
 static void    dolink(const char *, const char *, bool);
 static char ** getfields(char * buf);
-static zic_t   gethms(const char * string, const char * errstring,
-                      bool);
+static zic_t   gethms(const char * string, const char * errstring);
 static zic_t   getstdoff(char *, bool *);
 static void    infile(const char * filename);
 static void    inleap(char ** fields, int nfields);
@@ -184,7 +185,7 @@ static bool yearistype(zic_t 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
-   tz binary files whose POSIX-TZ-style strings contain '<'; see
+   TZif files whose POSIX-TZ-style strings contain '<'; see
    QTBUG-53071 <https://bugreports.qt.io/browse/QTBUG-53071>.  This
    workaround will no longer be needed when Qt 5.6.1 and earlier are
    obsolete, say in the year 2021.  */
@@ -948,44 +949,6 @@ dolink(char const *fromfield, char const *tofield, bool staysymlink)
 static zic_t const min_time = MINVAL(zic_t, TIME_T_BITS_IN_FILE);
 static zic_t const max_time = MAXVAL(zic_t, TIME_T_BITS_IN_FILE);
 
-/* Estimated time of the Big Bang, in seconds since the POSIX epoch.
-   rounded downward to the negation of a power of two that is
-   comfortably outside the error bounds.
-
-   For the time of the Big Bang, see:
-
-   Ade PAR, Aghanim N, Armitage-Caplan C et al.  Planck 2013 results.
-   I. Overview of products and scientific results.
-   arXiv:1303.5062 2013-03-20 20:10:01 UTC
-   <https://arxiv.org/pdf/1303.5062v1> [PDF]
-
-   Page 36, Table 9, row Age/Gyr, column Planck+WP+highL+BAO 68% limits
-   gives the value 13.798 plus-or-minus 0.037 billion years.
-   Multiplying this by 1000000000 and then by 31557600 (the number of
-   seconds in an astronomical year) gives a value that is comfortably
-   less than 2**59, so BIG_BANG is - 2**59.
-
-   BIG_BANG is approximate, and may change in future versions.
-   Please do not rely on its exact value.  */
-
-#ifndef BIG_BANG
-#define BIG_BANG (- (1LL << 59))
-#endif
-
-/* If true, work around GNOME bug 730332
-   <https://bugzilla.gnome.org/show_bug.cgi?id=730332>
-   by refusing to output time stamps before BIG_BANG.
-   Such time stamps are physically suspect anyway.
-
-   The GNOME bug is scheduled to be fixed in GNOME 3.22, and if so
-   this workaround will no longer be needed when GNOME 3.21 and
-   earlier are obsolete, say in the year 2021.  */
-enum { WORK_AROUND_GNOME_BUG_730332 = true };
-
-static const zic_t early_time = (WORK_AROUND_GNOME_BUG_730332
-                                ? BIG_BANG
-                                : MINVAL(zic_t, TIME_T_BITS_IN_FILE));
-
 /* Return true if NAME is a directory.  */
 static bool
 itsdir(char const *name)
@@ -1196,7 +1159,7 @@ _("%s: panic: Invalid l_value %d\n"),
 */
 
 static zic_t
-gethms(char const *string, char const *errstring, bool signable)
+gethms(char const *string, char const *errstring)
 {
        zic_t   hh;
        int sign, mm = 0, ss = 0;
@@ -1206,9 +1169,7 @@ gethms(char const *string, char const *errstring, bool signable)
 
        if (string == NULL || *string == '\0')
                return 0;
-       if (!signable)
-               sign = 1;
-       else if (*string == '-') {
+       if (*string == '-') {
                sign = -1;
                ++string;
        } else  sign = 1;
@@ -1264,7 +1225,7 @@ getstdoff(char *field, bool *isdst)
       case 's': dst = 0; *ep = '\0'; break;
     }
   }
-  stdoff = gethms(field, _("invalid saved time"), true);
+  stdoff = gethms(field, _("invalid saved time"));
   *isdst = dst < 0 ? stdoff != 0 : dst;
   return stdoff;
 }
@@ -1278,8 +1239,13 @@ inrule(char **fields, int nfields)
                error(_("wrong number of fields on Rule line"));
                return;
        }
-       if (*fields[RF_NAME] == '\0') {
-               error(_("nameless rule"));
+       switch (*fields[RF_NAME]) {
+         case '\0':
+         case ' ': case '\f': case '\n': case '\r': case '\t': case '\v':
+         case '+': case '-':
+         case '0': case '1': case '2': case '3': case '4':
+         case '5': case '6': case '7': case '8': case '9':
+               error(_("Invalid rule name \"%s\""), fields[RF_NAME]);
                return;
        }
        r.r_filename = filename;
@@ -1373,7 +1339,7 @@ inzsub(char **fields, int nfields, bool iscont)
        }
        z.z_filename = filename;
        z.z_linenum = linenum;
-       z.z_gmtoff = gethms(fields[i_gmtoff], _("invalid UT offset"), true);
+       z.z_gmtoff = gethms(fields[i_gmtoff], _("invalid UT offset"));
        if ((cp = strchr(fields[i_format], '%')) != 0) {
                if ((*++cp != 's' && *cp != 'z') || strchr(cp, '%')
                    || strchr(fields[i_format], '/')) {
@@ -1495,7 +1461,7 @@ inleap(char **fields, int nfields)
                return;
        }
        t = dayoff * SECSPERDAY;
-       tod = gethms(fields[LP_TIME], _("invalid time of day"), false);
+       tod = gethms(fields[LP_TIME], _("invalid time of day"));
        cp = fields[LP_CORR];
        {
                register bool   positive;
@@ -1590,7 +1556,7 @@ rulesub(struct rule *rp, const char *loyearp, const char *hiyearp,
                                break;
                }
        }
-       rp->r_tod = gethms(dp, _("invalid time of day"), false);
+       rp->r_tod = gethms(dp, _("invalid time of day"));
        free(dp);
        /*
        ** Year work.
@@ -1755,7 +1721,19 @@ is32(const zic_t x)
 }
 
 static void
-writezone(const char *const name, const char *const string, char version)
+swaptypes(int i, int j)
+{
+  { zic_t t = gmtoffs[i]; gmtoffs[i] = gmtoffs[j]; gmtoffs[j] = t; }
+  { char t = isdsts[i]; isdsts[i] = isdsts[j]; isdsts[j] = t; }
+  { unsigned char t = abbrinds[i]; abbrinds[i] = abbrinds[j];
+    abbrinds[j] = t; }
+  { bool t = ttisstds[i]; ttisstds[i] = ttisstds[j]; ttisstds[j] = t; }
+  { bool t = ttisgmts[i]; ttisgmts[i] = ttisgmts[j]; ttisgmts[j] = t; }
+}
+
+static void
+writezone(const char *const name, const char *const string, char version,
+         int defaulttype)
 {
        register FILE *                 fp;
        register ptrdiff_t              i, j;
@@ -1785,13 +1763,11 @@ writezone(const char *const name, const char *const string, char version)
 
                toi = 0;
                fromi = 0;
-               while (fromi < timecnt && attypes[fromi].at < early_time)
-                       ++fromi;
                for ( ; fromi < timecnt; ++fromi) {
-                       if (toi > 1 && ((attypes[fromi].at +
+                       if (toi != 0 && ((attypes[fromi].at +
                                gmtoffs[attypes[toi - 1].type]) <=
-                               (attypes[toi - 1].at +
-                               gmtoffs[attypes[toi - 2].type]))) {
+                               (attypes[toi - 1].at + gmtoffs[toi == 1 ? 0
+                               attypes[toi - 2].type]))) {
                                        attypes[toi - 1].type =
                                                attypes[fromi].type;
                                        continue;
@@ -1821,7 +1797,7 @@ writezone(const char *const name, const char *const string, char version)
                types[i] = attypes[i].type;
        }
 
-       /* Work around QTBUG-53071 for time stamps less than y2038_boundary - 1,
+       /* Work around QTBUG-53071 for timestamps less than y2038_boundary - 1,
           by inserting a no-op transition at time y2038_boundary - 1.
           This works only for timestamps before the boundary, which
           should be good enough in practice as QTBUG-53071 should be
@@ -1899,7 +1875,8 @@ writezone(const char *const name, const char *const string, char version)
        for (pass = 1; pass <= 2; ++pass) {
                register ptrdiff_t thistimei, thistimecnt, thistimelim;
                register int    thisleapi, thisleapcnt, thisleaplim;
-               int             writetype[TZ_MAX_TYPES];
+               int old0;
+               char            omittype[TZ_MAX_TYPES];
                int             typemap[TZ_MAX_TYPES];
                register int    thistypecnt;
                char            thischars[TZ_MAX_CHARS];
@@ -1924,25 +1901,18 @@ writezone(const char *const name, const char *const string, char version)
                  error(_("too many transition times"));
                thistimelim = thistimei + thistimecnt;
                thisleaplim = thisleapi + thisleapcnt;
-               for (i = 0; i < typecnt; ++i)
-                       writetype[i] = thistimecnt == timecnt;
-               if (thistimecnt == 0) {
-                       /*
-                       ** No transition times fall in the current
-                       ** (32- or 64-bit) window.
-                       */
-                       if (typecnt != 0)
-                               writetype[typecnt - 1] = true;
-               } else {
-                       for (i = thistimei - 1; i < thistimelim; ++i)
-                               if (i >= 0)
-                                       writetype[types[i]] = true;
-                       /*
-                       ** For America/Godthab and Antarctica/Palmer
-                       */
-                       if (thistimei == 0)
-                               writetype[0] = true;
-               }
+               memset(omittype, true, typecnt);
+               omittype[defaulttype] = false;
+               for (i = thistimei; i < thistimelim; i++)
+                 omittype[types[i]] = false;
+
+               /* Reorder types to make DEFAULTTYPE type 0.
+                  Use TYPEMAP to swap OLD0 and DEFAULTTYPE so that
+                  DEFAULTTYPE appears as type 0 in the output instead
+                  of OLD0.  TYPEMAP also omits unused types.  */
+               old0 = strlen(omittype);
+               swaptypes(old0, defaulttype);
+
 #ifndef LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH
                /*
                ** For some pre-2011 systems: if the last-to-be-written
@@ -1960,8 +1930,8 @@ writezone(const char *const name, const char *const string, char version)
                                if (isdsts[types[i]])
                                        mrudst = types[i];
                                else    mrustd = types[i];
-                       for (i = 0; i < typecnt; ++i)
-                               if (writetype[i]) {
+                       for (i = old0; i < typecnt; i++)
+                               if (!omittype[i]) {
                                        if (isdsts[i])
                                                hidst = i;
                                        else    histd = i;
@@ -1975,7 +1945,7 @@ writezone(const char *const name, const char *const string, char version)
                                                ttisstds[mrudst],
                                                ttisgmts[mrudst]);
                                        isdsts[mrudst] = 1;
-                                       writetype[type] = true;
+                                       omittype[type] = false;
                        }
                        if (histd >= 0 && mrustd >= 0 && histd != mrustd &&
                                gmtoffs[histd] != gmtoffs[mrustd]) {
@@ -1986,20 +1956,24 @@ writezone(const char *const name, const char *const string, char version)
                                                ttisstds[mrustd],
                                                ttisgmts[mrustd]);
                                        isdsts[mrustd] = 0;
-                                       writetype[type] = true;
+                                       omittype[type] = false;
                        }
                }
 #endif /* !defined LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH */
                thistypecnt = 0;
-               for (i = 0; i < typecnt; ++i)
-                       typemap[i] = writetype[i] ?  thistypecnt++ : -1;
+               for (i = old0; i < typecnt; i++)
+                 if (!omittype[i])
+                   typemap[i == old0 ? defaulttype
+                           : i == defaulttype ? old0 : i]
+                     = thistypecnt++;
+
                for (i = 0; i < sizeof indmap / sizeof indmap[0]; ++i)
                        indmap[i] = -1;
                thischarcnt = 0;
-               for (i = 0; i < typecnt; ++i) {
+               for (i = old0; i < typecnt; i++) {
                        register char * thisabbr;
 
-                       if (!writetype[i])
+                       if (omittype[i])
                                continue;
                        if (indmap[abbrinds[i]] >= 0)
                                continue;
@@ -2048,8 +2022,8 @@ writezone(const char *const name, const char *const string, char version)
                        uc = typemap[types[i]];
                        fwrite(&uc, sizeof uc, 1, fp);
                }
-               for (i = 0; i < typecnt; ++i)
-                       if (writetype[i]) {
+               for (i = old0; i < typecnt; i++)
+                       if (!omittype[i]) {
                                puttzcode(gmtoffs[i], fp);
                                putc(isdsts[i], fp);
                                putc((unsigned char) indmap[abbrinds[i]], fp);
@@ -2082,12 +2056,13 @@ writezone(const char *const name, const char *const string, char version)
                        else    puttzcode64(todo, fp);
                        puttzcode(corr[i], fp);
                }
-               for (i = 0; i < typecnt; ++i)
-                       if (writetype[i])
+               for (i = old0; i < typecnt; i++)
+                       if (!omittype[i])
                                putc(ttisstds[i], fp);
-               for (i = 0; i < typecnt; ++i)
-                       if (writetype[i])
+               for (i = old0; i < typecnt; i++)
+                       if (!omittype[i])
                                putc(ttisgmts[i], fp);
+               swaptypes(old0, defaulttype);
        }
        fprintf(fp, "\n%s\n", string);
        close_file(fp, directory, name);
@@ -2441,6 +2416,7 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
        zic_t one = 1;
        zic_t y2038_boundary = one << 31;
        zic_t max_year0;
+       int defaulttype = -1;
 
        max_abbr_len = 2 + max_format_len + max_abbrvar_len;
        max_envvar_len = 2 * max_abbr_len + 5 * 9;
@@ -2549,9 +2525,9 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
                */
                stdoff = 0;
                zp = &zpfirst[i];
-               usestart = i > 0 && (zp - 1)->z_untiltime > early_time;
+               usestart = i > 0 && (zp - 1)->z_untiltime > min_time;
                useuntil = i < (zonecount - 1);
-               if (useuntil && zp->z_untiltime <= early_time)
+               if (useuntil && zp->z_untiltime <= min_time)
                        continue;
                gmtoff = zp->z_gmtoff;
                eat(zp->z_filename, zp->z_linenum);
@@ -2566,7 +2542,8 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
                        if (usestart) {
                                addtt(starttime, type);
                                usestart = false;
-                       } else  addtt(early_time, type);
+                       } else
+                               defaulttype = type;
                } else for (year = min_year; year <= max_year; ++year) {
                        if (useuntil && year > zp->z_untilrule.r_hiyear)
                                break;
@@ -2680,6 +2657,8 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
                                offset = oadd(zp->z_gmtoff, rp->r_stdoff);
                                type = addtype(offset, ab, rp->r_isdst,
                                        rp->r_todisstd, rp->r_todisgmt);
+                               if (defaulttype < 0 && !rp->r_isdst)
+                                 defaulttype = type;
                                if (rp->r_hiyear == ZIC_MAX
                                    && ! (0 <= lastatmax
                                          && ktime < attypes[lastatmax].at))
@@ -2696,11 +2675,14 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
                        eat(zp->z_filename, zp->z_linenum);
                        if (*startbuf == '\0')
 error(_("can't determine time zone abbreviation to use just after until time"));
-                       else    addtt(starttime,
-                                       addtype(startoff, startbuf,
-                                               startoff != zp->z_gmtoff,
-                                               startttisstd,
-                                               startttisgmt));
+                       else {
+                         bool isdst = startoff != zp->z_gmtoff;
+                         type = addtype(startoff, startbuf, isdst,
+                                        startttisstd, startttisgmt);
+                         if (defaulttype < 0 && !isdst)
+                           defaulttype = type;
+                         addtt(starttime, type);
+                       }
                }
                /*
                ** Now we may get to set starttime for the next zone line.
@@ -2715,6 +2697,8 @@ error(_("can't determine time zone abbreviation to use just after until time"));
                                starttime = tadd(starttime, -gmtoff);
                }
        }
+       if (defaulttype < 0)
+         defaulttype = 0;
        if (0 <= lastatmax)
          attypes[lastatmax].dontmerge = true;
        if (do_extend) {
@@ -2742,7 +2726,7 @@ error(_("can't determine time zone abbreviation to use just after until time"));
                        attypes[timecnt - 1].dontmerge = true;
                }
        }
-       writezone(zpfirst->z_name, envvar, version);
+       writezone(zpfirst->z_name, envvar, version, defaulttype);
        free(startbuf);
        free(ab);
        free(envvar);
@@ -2751,20 +2735,6 @@ error(_("can't determine time zone abbreviation to use just after until time"));
 static void
 addtt(zic_t starttime, int type)
 {
-       if (starttime <= early_time
-           || (timecnt == 1 && attypes[0].at < early_time)) {
-               gmtoffs[0] = gmtoffs[type];
-               isdsts[0] = isdsts[type];
-               ttisstds[0] = ttisstds[type];
-               ttisgmts[0] = ttisgmts[type];
-               if (abbrinds[type] != 0)
-                       strcpy(chars, &chars[abbrinds[type]]);
-               abbrinds[0] = 0;
-               charcnt = strlen(chars) + 1;
-               typecnt = 1;
-               timecnt = 0;
-               type = 0;
-       }
        attypes = growalloc(attypes, sizeof *attypes, timecnt, &timecnt_alloc);
        attypes[timecnt].at = starttime;
        attypes[timecnt].dontmerge = false;
@@ -3136,6 +3106,15 @@ rpytime(const struct rule *rp, zic_t wantedy)
        dayoff = 0;
        m = TM_JANUARY;
        y = EPOCH_YEAR;
+       if (y < wantedy) {
+         wantedy -= y;
+         dayoff = (wantedy / YEARSPERREPEAT) * (SECSPERREPEAT / SECSPERDAY);
+         wantedy %= YEARSPERREPEAT;
+         wantedy += y;
+       } else if (wantedy < 0) {
+         dayoff = (wantedy / YEARSPERREPEAT) * (SECSPERREPEAT / SECSPERDAY);
+         wantedy %= YEARSPERREPEAT;
+       }
        while (wantedy != y) {
                if (wantedy > y) {
                        i = len_years[isleap(y)];
index d617644..74e0de9 100644 (file)
 # 'zic' should treat this script's output as if it were identical to
 # this script's input.
 
+# Record a hash N for the new name NAME, checking for collisions.
 
-# Return a new rule name.
-# N_RULE_NAMES keeps track of how many rule names have been generated.
+function record_hash(n, name)
+{
+  if (used_hashes[n]) {
+    printf "# ! collision: %s %s\n", used_hashes[n], name
+    exit 1
+  }
+  used_hashes[n] = name
+}
+
+# Return a shortened rule name representing NAME,
+# and record this relationship to the hash table.
+
+function gen_rule_name(name, n)
+{
+  # Use a simple memonic: the first two letters.
+  n = substr(name, 1, 2)
+  record_hash(n, name)
+  # printf "# %s = %s\n", n, name
+  return n
+}
 
-function gen_rule_name(alphabet, base, rule_name, n, digit)
+function prehash_rule_names(name)
 {
-  alphabet = ""
-  alphabet = alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-  alphabet = alphabet "abcdefghijklmnopqrstuvwxyz"
-  alphabet = alphabet "!$%&'()*+,./:;<=>?@[\\]^_`{|}~"
-  base = length(alphabet)
-  rule_name = ""
-  n = n_rule_names++
-
-  do {
-    n -= rule_name && n <= base
-    digit = n % base
-    rule_name = substr(alphabet, digit + 1, 1) rule_name
-    n = (n - digit) / base
-  } while (n);
-
-  return rule_name
+  # Rule names are not part of the tzdb API, so substitute shorter
+  # ones.  Shortening them consistently from one release to the next
+  # simplifies comparison of the output.  That being said, the
+  # 1-letter names below are not standardized in any way, and can
+  # change arbitrarily from one release to the next, as the main goal
+  # here is compression not comparison.
+
+  # Abbreviating these rules names to one letter saved the most space
+  # circa 2018e.
+  rule["Arg"] = "A"
+  rule["Brazil"] = "B"
+  rule["Canada"] = "C"
+  rule["Denmark"] = "D"
+  rule["EU"] = "E"
+  rule["France"] = "F"
+  rule["GB-Eire"] = "G"
+  rule["Halifax"] = "H"
+  rule["Italy"] = "I"
+  rule["Jordan"] = "J"
+  rule["Egypt"] = "K" # "Kemet" in ancient Egyptian
+  rule["Libya"] = "L"
+  rule["Morocco"] = "M"
+  rule["Neth"] = "N"
+  rule["Poland"] = "O" # arbitrary
+  rule["Palestine"] = "P"
+  rule["Cuba"] = "Q" # Its start sounds like "Q".
+  rule["Russia"] = "R"
+  rule["Syria"] = "S"
+  rule["Turkey"] = "T"
+  rule["Uruguay"] = "U"
+  rule["Vincennes"] = "V"
+  rule["Winn"] = "W"
+  rule["Mongol"] = "X" # arbitrary
+  rule["NT_YK"] = "Y"
+  rule["Zion"] = "Z"
+  rule["Austria"] = "a"
+  rule["Belgium"] = "b"
+  rule["C-Eur"] = "c"
+  rule["Algeria"] = "d" # country code DZ
+  rule["E-Eur"] = "e"
+  rule["Taiwan"] = "f" # Formosa
+  rule["Greece"] = "g"
+  rule["Hungary"] = "h"
+  rule["Iran"] = "i"
+  rule["StJohns"] = "j"
+  rule["Chatham"] = "k" # arbitrary
+  rule["Lebanon"] = "l"
+  rule["Mexico"] = "m"
+  rule["Tunisia"] = "n" # country code TN
+  rule["Moncton"] = "o" # arbitrary
+  rule["Port"] = "p"
+  rule["Albania"] = "q" # arbitrary
+  rule["Regina"] = "r"
+  rule["Spain"] = "s"
+  rule["Toronto"] = "t"
+  rule["US"] = "u"
+  rule["Louisville"] = "v" # ville
+  rule["Iceland"] = "w" # arbitrary
+  rule["Chile"] = "x" # arbitrary
+  rule["Para"] = "y" # country code PY
+  rule["Romania"] = "z" # arbitrary
+  rule["Macau"] = "_" # arbitrary
+
+  # Use ISO 3166 alpha-2 country codes for remaining names that are countries.
+  # This is more systematic, and avoids collisions (e.g., Malta and Moldova).
+  rule["Armenia"] = "AM"
+  rule["Aus"] = "AU"
+  rule["Azer"] = "AZ"
+  rule["Barb"] = "BB"
+  rule["Dhaka"] = "BD"
+  rule["Bulg"] = "BG"
+  rule["Bahamas"] = "BS"
+  rule["Belize"] = "BZ"
+  rule["Swiss"] = "CH"
+  rule["Cook"] = "CK"
+  rule["PRC"] = "CN"
+  rule["Cyprus"] = "CY"
+  rule["Czech"] = "CZ"
+  rule["Germany"] = "DE"
+  rule["DR"] = "DO"
+  rule["Ecuador"] = "EC"
+  rule["Finland"] = "FI"
+  rule["Fiji"] = "FJ"
+  rule["Falk"] = "FK"
+  rule["Ghana"] = "GH"
+  rule["Guat"] = "GT"
+  rule["Hond"] = "HN"
+  rule["Haiti"] = "HT"
+  rule["Eire"] = "IE"
+  rule["Iraq"] = "IQ"
+  rule["Japan"] = "JP"
+  rule["Kyrgyz"] = "KG"
+  rule["ROK"] = "KR"
+  rule["Latvia"] = "LV"
+  rule["Lux"] = "LX"
+  rule["Moldova"] = "MD"
+  rule["Malta"] = "MT"
+  rule["Mauritius"] = "MU"
+  rule["Namibia"] = "NA"
+  rule["Nic"] = "NI"
+  rule["Norway"] = "NO"
+  rule["Peru"] = "PE"
+  rule["Phil"] = "PH"
+  rule["Pakistan"] = "PK"
+  rule["Sudan"] = "SD"
+  rule["Salv"] = "SV"
+  rule["Tonga"] = "TO"
+  rule["Vanuatu"] = "VU"
+
+  # Avoid collisions.
+  rule["Detroit"] = "Dt" # De = Denver
+
+  for (name in rule) {
+    record_hash(rule[name], name)
+  }
 }
 
 # Process an input line and save it for later output.
@@ -54,6 +172,11 @@ function process_input_line(line, field, end, i, n, startdef)
     if (line ~ /^R /) return
     line = substr(line, 1, RSTART) substr(line, RSTART + 5)
   }
+  # Replace SpainAfrica rules with Morocco, as they are duplicates.
+  if (match(line, / SpainAfrica /)) {
+    if (line ~ /^R /) return
+    line = substr(line, 1, RSTART) "Morocco" substr(line, RSTART + RLENGTH - 1)
+  }
 
   # Abbreviate times.
   while (match(line, /[: ]0+[0-9]/))
@@ -106,7 +229,7 @@ function process_input_line(line, field, end, i, n, startdef)
   i = field[1] == "Z" ? 4 : field[1] == "Li" ? 0 : 2
   if (i && field[i] ~ /^[^-+0-9]/) {
     if (!rule[field[i]])
-      rule[field[i]] = gen_rule_name()
+      rule[field[i]] = gen_rule_name(field[i])
     field[i] = rule[field[i]]
   }
 
@@ -144,8 +267,53 @@ function output_saved_lines(i)
 }
 
 BEGIN {
+  # Files that the output normally depends on.
+  default_dep["africa"] = 1
+  default_dep["antarctica"] = 1
+  default_dep["asia"] = 1
+  default_dep["australasia"] = 1
+  default_dep["backward"] = 1
+  default_dep["etcetera"] = 1
+  default_dep["europe"] = 1
+  default_dep["factory"] = 1
+  default_dep["northamerica"] = 1
+  default_dep["southamerica"] = 1
+  default_dep["systemv"] = 1
+  default_dep["ziguard.awk"] = 1
+  default_dep["zishrink.awk"] = 1
+
+  # Output a version string from 'version' and related configuration variables
+  # supported by tzdb's Makefile.  If you change the makefile or any other files
+  # that affect the output of this script, you should append '-SOMETHING'
+  # to the contents of 'version', where SOMETHING identifies what was changed.
+
+  ndeps = split(deps, dep)
+  ddeps = ""
+  for (i = 1; i <= ndeps; i++) {
+    if (default_dep[dep[i]]) {
+      default_dep[dep[i]]++
+    } else {
+      ddeps = ddeps " " dep[i]
+    }
+  }
+  for (d in default_dep) {
+    if (default_dep[d] == 1) {
+      ddeps = ddeps " !" d
+    }
+  }
   print "# version", version
+  if (dataform != "main") {
+    print "# dataform", dataform
+  }
+  if (redo != "posix_right") {
+    print "# redo " redo
+  }
+  if (ddeps) {
+    print "# ddeps" ddeps
+  }
   print "# This zic input file is in the public domain."
+
+  prehash_rule_names()
 }
 
 /^[\t ]*[^#\t ]/ {
index f92c919..dcb6e1d 100644 (file)
--- a/zone.tab
+++ b/zone.tab
@@ -1,9 +1,9 @@
-# tz zone descriptions (deprecated version)
+# tzdb timezone descriptions (deprecated version)
 #
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# From Paul Eggert (2014-07-31):
+# From Paul Eggert (2018-06-27):
 # This file is intended as a backward-compatibility aid for older programs.
 # New programs should use zone1970.tab.  This file is like zone1970.tab (see
 # zone1970.tab's comments), but with the following additional restrictions:
 # 2.  The first data column contains exactly one country code.
 #
 # Because of (2), each row stands for an area that is the intersection
-# of a region identified by a country code and of a zone where civil
+# of a region identified by a country code and of a timezone where civil
 # clocks have agreed since 1970; this is a narrower definition than
 # that of zone1970.tab.
 #
-# This table is intended as an aid for users, to help them select time
-# zone data entries appropriate for their practical needs.  It is not
-# intended to take or endorse any position on legal or territorial claims.
+# This table is intended as an aid for users, to help them select timezones
+# appropriate for their practical needs.  It is not intended to take or
+# endorse any position on legal or territorial claims.
 #
 #country-
 #code  coordinates     TZ                      comments
@@ -268,7 +268,7 @@ 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
-MO     +2214+11335     Asia/Macau
+MO     +221150+1133230 Asia/Macau
 MP     +1512+14545     Pacific/Saipan
 MQ     +1436-06105     America/Martinique
 MR     +1806-01557     Africa/Nouakchott
index 2d90ed7..7c86fb6 100644 (file)
@@ -1,35 +1,35 @@
-# tz zone descriptions
+# tzdb timezone descriptions
 #
 # This file is in the public domain.
 #
-# From Paul Eggert (2017-10-01):
-# This file contains a table where each row stands for a zone where
-# civil time stamps have agreed since 1970.  Columns are separated by
+# From Paul Eggert (2018-06-27):
+# This file contains a table where each row stands for a timezone where
+# civil timestamps have agreed since 1970.  Columns are separated by
 # a single tab.  Lines beginning with '#' are comments.  All text uses
 # UTF-8 encoding.  The columns of the table are as follows:
 #
-# 1.  The countries that overlap the zone, as a comma-separated list
+# 1.  The countries that overlap the timezone, as a comma-separated list
 #     of ISO 3166 2-character country codes.  See the file 'iso3166.tab'.
-# 2.  Latitude and longitude of the zone's principal location
+# 2.  Latitude and longitude of the timezone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either ±DDMM±DDDMM or ±DDMMSS±DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
-# 3.  Zone name used in value of TZ environment variable.
-#     Please see the theory.html file for how zone names are chosen.
-#     If multiple zones overlap a country, each has a row in the
+# 3.  Timezone name used in value of TZ environment variable.
+#     Please see the theory.html file for how these names are chosen.
+#     If multiple timezones overlap a country, each has a row in the
 #     table, with each column 1 containing the country code.
-# 4.  Comments; present if and only if a country has multiple zones.
+# 4.  Comments; present if and only if a country has multiple timezones.
 #
-# If a zone covers multiple countries, the most-populous city is used,
+# If a timezone covers multiple countries, the most-populous city is used,
 # and that country is listed first in column 1; any other countries
 # are listed alphabetically by country code.  The table is sorted
 # first by country code, then (if possible) by an order within the
 # country that (1) makes some geographical sense, and (2) puts the
-# most populous zones first, where that does not contradict (1).
+# most populous timezones first, where that does not contradict (1).
 #
-# This table is intended as an aid for users, to help them select time
-# zone data entries appropriate for their practical needs.  It is not
-# intended to take or endorse any position on legal or territorial claims.
+# This table is intended as an aid for users, to help them select timezones
+# appropriate for their practical needs.  It is not intended to take or
+# endorse any position on legal or territorial claims.
 #
 #country-
 #codes coordinates     TZ      comments
@@ -231,7 +231,7 @@ 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
-MO     +2214+11335     Asia/Macau
+MO     +221150+1133230 Asia/Macau
 MQ     +1436-06105     America/Martinique
 MT     +3554+01431     Europe/Malta
 MU     -2010+05730     Indian/Mauritius
old mode 100644 (file)
new mode 100755 (executable)
index e05ec01..c8c5591
@@ -1,4 +1,5 @@
 #! /usr/bin/perl -w
+# Summarize .zi input in a .zi-like format.
 
 # Courtesy Ken Pizzini.