Imported Upstream version 2017c 44/165844/2 upstream/2017c
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 4 Jan 2018 08:52:24 +0000 (17:52 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Thu, 4 Jan 2018 21:47:09 +0000 (06:47 +0900)
Change-Id: I633e3a1ed7834a661093b87ccdebb53bc0485000
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
42 files changed:
CONTRIBUTING
LICENSE
Makefile
NEWS
Theory [deleted file]
africa
antarctica
asctime.c
asia
australasia
backward
backzone
calendars [new file with mode: 0644]
checklinks.awk
date.c
difftime.c
europe
leap-seconds.list
leapseconds
leapseconds.awk
localtime.c
newctime.3
newctime.3.txt
northamerica
private.h
southamerica
strftime.c
theory.html [new file with mode: 0644]
tz-art.htm
tz-how-to.html
tz-link.htm
tzfile.5
tzfile.5.txt
tzselect.ksh
version
zdump.c
zic.8
zic.8.txt
zic.c
zishrink.awk [new file with mode: 0644]
zone.tab
zone1970.tab

index 22addd2..716f32b 100644 (file)
@@ -5,20 +5,26 @@ change timekeeping rules erratically and sometimes with little
 warning, the data entries do not cover all of civil time before
 1970, and undoubtedly errors remain in the code and data.  Feel
 free to fill gaps or fix mistakes, and please email improvements
-to tz@iana.org for use in the future.
+to tz@iana.org for use in the future.  In your email, please give
+reliable sources that reviewers can check.
+
+-----
+
+Developers can contribute technical changes to the source code and
+data as follows.
 
 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 file and browse
-the mailing list archives <http://mm.icann.org/pipermail/tz/> for
-examples of patches that tend to work well.  Ideally, additions to
+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.
+justification.  Citations should use https: URLs if available.
 
 Please submit changes against either the latest release in
-<ftp://ftp.iana.org/tz/> or the master branch of the development
+<https://www.iana.org/time-zones> or the master branch of the development
 repository.  If you use Git the following workflow may be helpful:
 
   * Copy the development repository.
diff --git a/LICENSE b/LICENSE
index 148eb23..8ba4399 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,5 @@
-With a few exceptions, all files in the tz code and data (including
-this one) are in the public domain.  The exceptions are date.c,
-newstrftime.3, and strftime.c, which contain material derived from BSD
-and which use the BSD 3-clause license.
+Unless specified below, all files in the tz code and data (including
+this LICENSE file) are in the public domain.
+
+If the files date.c, newstrftime.3, and strftime.c are present, they
+contain material derived from BSD and use the BSD 3-clause license.
index 8067ba0..c92edc0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ TOPDIR=               /usr/local
 # "Compiled" time zone information is placed in the "TZDIR" directory
 # (and subdirectories).
 # Use an absolute path name for TZDIR unless you're just testing the software.
+# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
 
 TZDIR_BASENAME=        zoneinfo
 TZDIR=         $(TOPDIR)/etc/$(TZDIR_BASENAME)
@@ -75,7 +76,7 @@ LIBDIR=               $(TOPDIR)/lib
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
 #      REDO=           posix_only
-# below.  If you want want only "right" time, with values interpreted
+# below.  If you want only "right" time, with values interpreted
 # as seconds since the epoch (counting leap seconds), use
 #      REDO=           right_only
 # below.  If you want both sets of data available, with leap seconds not
@@ -92,6 +93,24 @@ LIBDIR=              $(TOPDIR)/lib
 
 REDO=          posix_right
 
+# To install data in text form that has all the information of the binary data,
+# (optionally incorporating leap second information), use
+#      TZDATA_TEXT=    tzdata.zi leapseconds
+# To install text data without leap second information (e.g., because
+# REDO='posix_only'), use
+#      TZDATA_TEXT=    tzdata.zi
+# To avoid installing text data, use
+#      TZDATA_TEXT=
+
+TZDATA_TEXT=   leapseconds tzdata.zi
+
+# For backward-compatibility links for old zone names, use
+#      BACKWARD=       backward pacificnew
+# To omit these links, use
+#      BACKWARD=
+
+BACKWARD=      backward pacificnew
+
 # If you want out-of-scope and often-wrong data from the file 'backzone', use
 #      PACKRATDATA=    backzone
 # To omit this data, use
@@ -99,6 +118,11 @@ REDO=               posix_right
 
 PACKRATDATA=
 
+# The name of a locale using the UTF-8 encoding, used during self-tests.
+# The tests are skipped if the name does not appear to work on this system.
+
+UTF8_LOCALE=   en_US.utf8
+
 # Since "." may not be in PATH...
 
 YEARISTYPE=    ./yearistype
@@ -106,50 +130,53 @@ YEARISTYPE=       ./yearistype
 # Non-default libraries needed to link.
 LDLIBS=
 
-# Add the following to the end of the "CFLAGS=" line as needed.
+# 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
+#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
+#      than what POSIX specifies, assuming local time is UT.
+#      For example, N is 252460800 on AmigaOS.
 #  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
+#  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
 #  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
-#  -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
-#  -DHAVE_GETTEXT=1 if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
-#  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
+#  -DHAVE_GENERIC=0 if _Generic does not work
+#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
+#  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
 #      ctime_r and asctime_r incompatibly with the POSIX standard
 #      (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
-#  -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
+#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
 #  -DHAVE_LINK=0 if your system lacks a link function
 #  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
 #  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
-#      This defaults to 1 if a working localtime_rz seems to be available.
 #      localtime_rz can make zdump significantly faster, but is nonstandard.
 #  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
 #      functions like 'link' or variables like 'tzname' required by POSIX
-#  -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
-#  -DHAVE_STRFTIME_L=1 if <time.h> declares locale_t and strftime_l
-#      This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
+#  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
+#  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
+#  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
+#  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
 #  -DHAVE_STRDUP=0 if your system lacks the strdup function
 #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
-#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
-#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
+#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
+#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
 #  -DHAVE_TZSET=0 if your system lacks a tzset function
-#  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
-#  -DEPOCH_LOCAL=1 if the 'time' function returns local time not UT
-#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
-#      than what POSIX specifies, assuming local time is UT.
-#      For example, N is 252460800 on AmigaOS.
-#  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
-#      if you do not want run time warnings about formats that may cause
-#      year 2000 grief
-#  -Dssize_t=long on ancient hosts that lack ssize_t
-#  -DTHREAD_SAFE=1 to make localtime.c thread-safe, as POSIX requires;
+#  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
+#  -Dlocale_t=XXX if your system uses XXX instead of locale_t
+#  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
+#  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
 #      not needed by the main-program tz code, which is single-threaded.
 #      Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
 #  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
+#      This is intended for internal use only; it mangles external names.
 #  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
 #  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
 #      the default is system-supplied, typically "/usr/lib/locale"
 #  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
 #      DST transitions if the time zone files cannot be accessed
-#  -DUNINIT_TRAP=1 if reading uninitialized storage can cause problems
+#  -DUNINIT_TRAP if reading uninitialized storage can cause problems
 #      other than simply getting garbage data
 #  -DUSE_LTZ=0 to build zdump with the system time zone library
 #      Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
@@ -157,26 +184,27 @@ LDLIBS=
 #      (or some other number) to set the maximum time zone abbreviation length
 #      that zic will accept without a warning (the default is 6)
 #  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
-GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
-       -Wall -Wextra \
-       -Wbad-function-cast -Wcast-align -Wdate-time \
-       -Wdeclaration-after-statement \
-       -Wdouble-promotion \
-       -Wformat=2 -Winit-self -Wjump-misses-init \
-       -Wlogical-op -Wmissing-prototypes -Wnested-externs \
-       -Wold-style-definition -Woverlength-strings -Wpointer-arith \
-       -Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \
-       -Wsuggest-attribute=format -Wsuggest-attribute=noreturn \
-       -Wsuggest-attribute=pure -Wtrampolines \
-       -Wundef -Wunused -Wwrite-strings \
-       -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
-       -Wno-type-limits -Wno-unused-parameter
-#
-# If you want to use System V compatibility code, add
-#      -DUSG_COMPAT
-# to the end of the "CFLAGS=" line.  This arrange for "timezone" and "daylight"
-# variables to be kept up-to-date by the time conversion functions.  Neither
-# "timezone" nor "daylight" is described in X3J11's work.
+# Select instrumentation via "make GCC_INSTRUMENT='whatever'".
+GCC_INSTRUMENT = \
+  -fsanitize=undefined -fsanitize-address-use-after-scope \
+  -fsanitize-undefined-trap-on-error -fstack-protector
+GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
+  $(GCC_INSTRUMENT) \
+  -Wall -Wextra \
+  -Walloc-size-larger-than=100000 -Warray-bounds=2 \
+  -Wbad-function-cast -Wcast-align -Wdate-time \
+  -Wdeclaration-after-statement -Wdouble-promotion \
+  -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
+  -Winit-self -Wjump-misses-init -Wlogical-op \
+  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
+  -Wold-style-definition -Woverlength-strings -Wpointer-arith \
+  -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=5 \
+  -Wsuggest-attribute=const -Wsuggest-attribute=format \
+  -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
+  -Wtrampolines -Wundef -Wuninitialized -Wunused \
+  -Wvariadic-macros -Wvla -Wwrite-strings \
+  -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
+  -Wno-type-limits -Wno-unused-parameter
 #
 # If your system has a "GMT offset" field in its "struct tm"s
 # (or if you decide to add such a field in your system's "time.h" file),
@@ -189,6 +217,31 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
 # and define NO_TM_ZONE to suppress any guessing.  These two fields are not
 # required by POSIX, but are widely available on GNU/Linux and BSD systems.
 #
+# The next batch of options control support for external variables
+# exported by tzcode.  In practice these variables are less useful
+# than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
+# #
+# # To omit or support the external variable "tzname", add one of:
+# #    -DHAVE_TZNAME=0
+# #    -DHAVE_TZNAME=1
+# # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
+# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
+# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
+# # crashes when combined with some platforms' standard libraries,
+# # presumably due to memory allocation issues.
+# #
+# # To omit or support the external variables "timezone" and "daylight", add
+# #    -DUSG_COMPAT=0
+# #    -DUSG_COMPAT=1
+# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
+# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
+# # If not defined, the code attempts to guess USG_COMPAT from other macros.
+# #
+# # To support the external variable "altzone", add
+# #    -DALTZONE
+# # to the end of the "CFLAGS=" line; although "altzone" appeared in
+# # System V Release 3.1 it has not been standardized.
+#
 # If you want functions that were inspired by early versions of X3J11's work,
 # add
 #      -DSTD_INSPIRED
@@ -226,11 +279,6 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
 #      -DALL_STATE
 # to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
 #
-# If you want an "altzone" variable (a la System V Release 3.1), add
-#      -DALTZONE
-# to the end of the "CFLAGS=" line.
-# This variable is not described in X3J11's work.
-#
 # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
 # out by the National Institute of Standards and Technology
 # which claims to test C and Posix conformance.  If you want to pass PCTS, add
@@ -240,8 +288,8 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
 # If you want strict compliance with XPG4 as of 1994-04-09, add
 #      -DXPG4_1994_04_09
 # to the end of the "CFLAGS=" line.  This causes "strftime" to always return
-# 53 as a week number (rather than 52 or 53) for those days in January that
-# before the first Monday in January when a "%V" format is used and January 1
+# 53 as a week number (rather than 52 or 53) for January days before
+# January's first Monday when a "%V" format is used and January 1
 # falls on a Friday, Saturday, or Sunday.
 
 CFLAGS=
@@ -265,7 +313,7 @@ ZFLAGS=
 
 # How to use zic to install tz binary files.
 
-ZIC_INSTALL=   $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
+ZIC_INSTALL=   $(ZIC) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
 
 # The name of a Posix-compliant 'awk' on your system.
 AWK=           awk
@@ -289,6 +337,7 @@ SGML_CATALOG_FILES= \
 # The name, arguments and environment of a program to validate your web pages.
 # See <http://openjade.sourceforge.net/doc/> for a validator, and
 # <https://validator.w3.org/source/> for a validation library.
+# Set VALIDATE=':' if you do not have such a program.
 VALIDATE = nsgmls
 VALIDATE_FLAGS = -s -B -wall -wno-unused-param
 VALIDATE_ENV = \
@@ -355,7 +404,7 @@ AR=         ar
 RANLIB=                :
 
 TZCOBJS=       zic.o
-TZDOBJS=       zdump.o localtime.o asctime.o
+TZDOBJS=       zdump.o localtime.o asctime.o strftime.o
 DATEOBJS=      date.o localtime.o strftime.o asctime.o
 LIBSRCS=       localtime.c asctime.c difftime.c
 LIBOBJS=       localtime.o asctime.o difftime.o
@@ -370,33 +419,35 @@ MANTXTS=  newctime.3.txt newstrftime.3.txt newtzset.3.txt \
                        time2posix.3.txt \
                        tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
                        date.1.txt
-COMMON=                CONTRIBUTING LICENSE Makefile NEWS README Theory version
+COMMON=                calendars CONTRIBUTING LICENSE Makefile \
+                       NEWS README theory.html version
 WEB_PAGES=     tz-art.htm tz-how-to.html tz-link.htm
 DOCS=          $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
 PRIMARY_YDATA= africa antarctica asia australasia \
                europe northamerica southamerica
-YDATA=         $(PRIMARY_YDATA) pacificnew etcetera backward
+YDATA=         $(PRIMARY_YDATA) etcetera $(BACKWARD)
 NDATA=         systemv factory
 TDATA=         $(YDATA) $(NDATA)
 ZONETABLES=    zone1970.tab zone.tab
-TABDATA=       iso3166.tab leapseconds $(ZONETABLES)
+TABDATA=       iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
 LEAP_DEPS=     leapseconds.awk leap-seconds.list
-DATA=          $(YDATA) $(NDATA) backzone $(TABDATA) \
-                       leap-seconds.list yearistype.sh
-AWK_SCRIPTS=   checklinks.awk checktab.awk leapseconds.awk
+TZDATA_ZI_DEPS=        zishrink.awk $(TDATA) $(PACKRATDATA)
+DATA=          $(YDATA) $(NDATA) backzone iso3166.tab leap-seconds.list \
+                       leapseconds yearistype.sh $(ZONETABLES)
+AWK_SCRIPTS=   checklinks.awk checktab.awk leapseconds.awk zishrink.awk
 MISC=          $(AWK_SCRIPTS) zoneinfo2tdf.pl
 TZS_YEAR=      2050
 TZS=           to$(TZS_YEAR).tzs
 TZS_NEW=       to$(TZS_YEAR)new.tzs
 TZS_DEPS=      $(PRIMARY_YDATA) asctime.c localtime.c \
                        private.h tzfile.h zdump.c zic.c
-ENCHILADA=     $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS)
+ENCHILADA=     $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi
 
 # Consult these files when deciding whether to rebuild the 'version' file.
 # This list is not the same as the output of 'git ls-files', since
 # .gitignore is not distributed.
 VERSION_DEPS= \
-               CONTRIBUTING LICENSE Makefile NEWS README Theory \
+               calendars CONTRIBUTING LICENSE Makefile NEWS README \
                africa antarctica asctime.c asia australasia \
                backward backzone \
                checklinks.awk checktab.awk \
@@ -405,7 +456,7 @@ VERSION_DEPS= \
                leap-seconds.list leapseconds.awk localtime.c \
                newctime.3 newstrftime.3 newtzset.3 northamerica \
                pacificnew private.h \
-               southamerica strftime.c systemv \
+               southamerica strftime.c systemv theory.html \
                time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \
                tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
                workman.sh yearistype.sh \
@@ -427,7 +478,7 @@ install:    all $(DATA) $(REDO) $(MANS)
                        $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
                        $(DESTDIR)$(MANDIR)/man8
                $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
-               cp -f iso3166.tab $(ZONETABLES) $(DESTDIR)$(TZDIR)/.
+               cp -f $(TABDATA) $(DESTDIR)$(TZDIR)/.
                cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
                cp libtz.a $(DESTDIR)$(LIBDIR)/.
                $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
@@ -448,6 +499,11 @@ version:   $(VERSION_DEPS)
                printf '%s\n' "$$V" >$@.out
                mv $@.out $@
 
+# This file can be tailored by setting BACKWARD, PACKRATDATA, etc.
+tzdata.zi:     $(TZDATA_ZI_DEPS)
+               LC_ALL=C $(AWK) -f zishrink.awk $(TDATA) $(PACKRATDATA) >$@.out
+               mv $@.out $@
+
 version.h:     version
                VERSION=`cat version` && printf '%s\n' \
                  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
@@ -473,6 +529,7 @@ leapseconds:        $(LEAP_DEPS)
 # Arguments to pass to submakes of install_data.
 # They can be overridden by later submake arguments.
 INSTALLARGS = \
+ BACKWARD=$(BACKWARD) \
  DESTDIR=$(DESTDIR) \
  LEAPSECONDS='$(LEAPSECONDS)' \
  PACKRATDATA='$(PACKRATDATA)' \
@@ -481,10 +538,8 @@ INSTALLARGS = \
  ZIC='$(ZIC)'
 
 # 'make install_data' installs one set of tz binary files.
-# It can be tailored by setting LEAPSECONDS, PACKRATDATA, etc.
-install_data:  zic leapseconds yearistype $(PACKRATDATA) $(TDATA)
-               $(ZIC_INSTALL) $(TDATA)
-               $(AWK) '/^Rule/' $(TDATA) | $(ZIC_INSTALL) - $(PACKRATDATA)
+install_data:  zic leapseconds yearistype tzdata.zi
+               $(ZIC_INSTALL) tzdata.zi
 
 posix_only:
                $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
@@ -521,14 +576,14 @@ posix_packrat:
 
 zones:         $(REDO)
 
-$(TZS_NEW):    $(TDATA) zdump zic
+$(TZS_NEW):    tzdata.zi zdump zic
                mkdir -p tzs.dir
-               $(zic) -d tzs.dir $(TDATA)
-               $(AWK) '/^Link/{print $$1 "\t" $$2 "\t" $$3}' \
-                  $(TDATA) | LC_ALL=C sort >$@.out
+               $(zic) -d tzs.dir tzdata.zi
+               $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
+                  tzdata.zi | LC_ALL=C sort >$@.out
                wd=`pwd` && \
                zones=`$(AWK) -v wd="$$wd" \
-                               '/^Zone/{print wd "/tzs.dir/" $$2}' $(TDATA) \
+                               '/^Z/{print wd "/tzs.dir/" $$2}' tzdata.zi \
                         | LC_ALL=C sort` && \
                ./zdump -i -c $(TZS_YEAR) $$zones >>$@.out
                sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@.sed.out
@@ -564,24 +619,37 @@ tzselect: tzselect.ksh version
                chmod +x $@.out
                mv $@.out $@
 
-check:         check_character_set check_white_space check_links check_sorted \
-                 check_tables check_tzs check_web
+check:         check_character_set check_white_space check_links \
+                 check_name_lengths check_sorted \
+                 check_tables check_web check_zishrink check_tzs
 
 check_character_set: $(ENCHILADA)
-               LC_ALL=en_US.utf8 && export LC_ALL && \
+       test ! '$(UTF8_LOCALE)' || \
+       ! printf 'A\304\200B\n' | \
+         LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
+               LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
                sharp='#' && \
                ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
                        $(MISC) $(SOURCES) $(WEB_PAGES) \
-                       CONTRIBUTING LICENSE Makefile README version && \
+                       CONTRIBUTING LICENSE Makefile README \
+                       version tzdata.zi && \
                ! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \
                        leapseconds yearistype.sh zone.tab && \
-               ! grep -Env $(OK_LINE) $(ENCHILADA)
+               ! grep -Env $(OK_LINE) $(ENCHILADA); \
+       }
 
 check_white_space: $(ENCHILADA)
                patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
                ! grep -En "$$pat" $(ENCHILADA)
                ! grep -n '[[:space:]]$$' $(ENCHILADA)
 
+PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
+FILE_NAME_COMPONENT_TOO_LONG = \
+  $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
+
+check_name_lengths: $(TDATA) backzone
+               ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' $(TDATA) backzone
+
 CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
 
 check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
@@ -596,6 +664,7 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
 
 check_links:   checklinks.awk $(TDATA)
                $(AWK) -f checklinks.awk $(TDATA)
+               $(AWK) -f checklinks.awk tzdata.zi
 
 check_tables:  checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
                for tab in $(ZONETABLES); do \
@@ -606,14 +675,32 @@ check_tables:     checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
 check_tzs:     $(TZS) $(TZS_NEW)
                diff -u $(TZS) $(TZS_NEW)
 
-check_web:     $(WEB_PAGES)
-               $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
+# 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
+
+# Check that tzdata.zi generates the same binary data that its sources do.
+check_zishrink: tzdata.zi zic leapseconds $(PACKRATDATA) $(TDATA)
+               for type in posix right; do \
+                 mkdir -p time_t.dir/$$type time_t.dir/$$type-shrunk && \
+                 case $$type in \
+                   right) leap='-L leapseconds';; \
+                   *) leap=;; \
+                 esac && \
+                 $(ZIC) $$leap -d time_t.dir/$$type $(TDATA) && \
+                 $(AWK) '/^Rule/' $(TDATA) | \
+                   $(ZIC) $$leap -d time_t.dir/$$type - $(PACKRATDATA) && \
+                 $(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
 
 clean_misc:
                rm -f core *.o *.out \
                  date tzselect version.h zdump zic yearistype libtz.a
 clean:         clean_misc
-               rm -fr *.dir tzdb-*/ $(TZS_NEW)
+               rm -fr *.dir tzdata.zi tzdb-*/ $(TZS_NEW)
 
 maintainer-clean: clean
                @echo 'This command is intended for maintainers to use; it'
@@ -667,6 +754,7 @@ set-timestamps.out: $(ENCHILADA)
                  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
                    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 $@
@@ -678,7 +766,7 @@ check_public:
                $(MAKE) maintainer-clean
                $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
                mkdir -p public.dir
-               for i in $(TDATA) ; do \
+               for i in $(TDATA) tzdata.zi; do \
                  $(zic) -v -d public.dir $$i 2>&1 || exit; \
                done
                $(zic) -v -d public.dir $(TDATA)
@@ -772,8 +860,8 @@ typecheck:
                        $(MAKE) clean ; \
                done
 
-zonenames:     $(TDATA)
-               @$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA)
+zonenames:     tzdata.zi
+               @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
 
 asctime.o:     private.h tzfile.h
 date.o:                private.h
@@ -789,6 +877,7 @@ zic.o:              private.h tzfile.h version.h
 .PHONY: check check_character_set check_links
 .PHONY: check_public check_sorted check_tables
 .PHONY: check_time_t_alternatives check_tzs check_web check_white_space
+.PHONY: check_zishrink
 .PHONY: clean clean_misc force_tzs
 .PHONY: install install_data maintainer-clean names
 .PHONY: posix_only posix_packrat posix_right
diff --git a/NEWS b/NEWS
index f986cf6..bd2bec2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,169 @@
 News for the tz database
 
+Release 2017c - 2017-10-20 14:49:34 -0700
+
+  Briefly:
+  Northern Cyprus switches from +03 to +02/+03 on 2017-10-29.
+  Fiji ends DST 2018-01-14, not 2018-01-21.
+  Namibia switches from +01/+02 to +02 on 2018-04-01.
+  Sudan switches from +03 to +02 on 2017-11-01.
+  Tonga likely switches from +13/+14 to +13 on 2017-11-05.
+  Turks & Caicos switches from -04 to -05/-04 on 2018-11-04.
+  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
+
+    Northern Cyprus has decided to resume EU rules starting
+    2017-10-29, thus reinstituting winter time.
+
+    Fiji ends DST 2018-01-14 instead of the 2018-01-21 previously
+    predicted.  (Thanks to Dominic Fok.)  Adjust future predictions
+    accordingly.
+
+    Namibia will switch from +01 with DST to +02 all year on
+    2017-09-03 at 02:00.  This affects UT offsets starting 2018-04-01
+    at 02:00.  (Thanks to Steffen Thorsen.)
+
+    Sudan will switch from +03 to +02 on 2017-11-01.  (Thanks to Ahmed
+    Atyya and Yahia Abdalla.)  South Sudan is not switching, so
+    Africa/Juba is no longer a link to Africa/Khartoum.
+
+    Tonga has likely ended its experiment with DST, and will not
+    adjust its clocks on 2017-11-05.  Although Tonga has not announced
+    whether it will continue to observe DST, the IATA is assuming that
+    it will not.  (Thanks to David Wade.)
+
+    Turks & Caicos will switch from -04 all year to -05 with US DST on
+    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
+
+    Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03.
+    (Thanks to Arthur David Olson.)
+
+    Detroit did not observe DST in 1967.
+
+    Use railway time for Asia/Kolkata before 1941, by switching to
+    Madras local time (UT +052110) in 1870, then to IST (UT +0530) in
+    1906.  Also, treat 1941-2's +0630 as DST, like 1942-5.
+
+    Europe/Dublin's 1946 and 1947 fallback transitions occurred at
+    02:00 standard time, not 02:00 DST.  (Thanks to Michael Deckers.)
+
+    Pacific/Apia and Pacific/Pago_Pago switched from Antipodean to
+    American time in 1892, not 1879.  (Thanks to Michael Deckers.)
+
+    Adjust the 1867 transition in Alaska to better reflect the
+    historical record, by changing it to occur on 1867-10-18 at 15:30
+    Sitka time rather than at the start of 1867-10-17 local time.
+    Although strictly speaking this is accurate only for Sitka,
+    the rest of Alaska's blanks need to be filled in somehow.
+
+    Fix off-by-one errors in UT offsets for Adak and Nome before 1867.
+    (Thanks to Michael Deckers.)
+
+    Add 7 s to the UT offset in Asia/Yangon before 1920.
+
+  Changes to zone names
+
+    Remove Canada/East-Saskatchewan from the 'backward' file, as it
+    exceeded the 14-character limit and was an unused misnomer anyway.
+
+  Changes to build procedure
+
+    To support applications that prefer to read time zone data in text
+    form, two zic input files tzdata.zi and leapseconds are now
+    installed by default.  The commands 'zic tzdata.zi' and 'zic -L
+    leapseconds tzdata.zi' can reproduce the tzdata binary files
+    without and with leap seconds, respectively.  To prevent these two
+    new files from being installed, use 'make TZDATA_TEXT=', and to
+    suppress leap seconds from the tzdata text installation, use 'make
+    TZDATA_TEXT=tzdata.zi'.
+
+    'make BACKWARD=' now suppresses backward-compatibility names
+    like 'US/Pacific' that are defined in the 'backward' and
+    'pacificnew' files.
+
+    'make check' now works on systems that lack a UTF-8 locale,
+    or that lack the nsgmls program.  Set UTF8_LOCALE to configure
+    the name of a UTF-8 locale, if you have one.
+
+    Y2K runtime checks are no longer enabled by default.  Add
+    -DDEPRECATE_TWO_DIGIT_YEARS to CFLAGS to enable them, instead of
+    adding -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
+    to disable them.  (New name suggested by Brian Inglis.)
+
+    The build procedure for zdump now works on AIX 7.1.
+    (Problem reported by Kees Dekker.)
+
+  Changes to code
+
+    zic and the reference runtime now reject multiple leap seconds
+    within 28 days of each other, or leap seconds before the Epoch.
+    As a result, support for double leap seconds, which was
+    obsolescent and undocumented, has been removed.  Double leap
+    seconds were an error in the C89 standard; they have never existed
+    in civil timekeeping.  (Thanks to Robert Elz and Bradley White for
+    noticing glitches in the code that uncovered this problem.)
+
+    zic now warns about use of the obsolescent and undocumented -y
+    option, and about use of the obsolescent TYPE field of Rule lines.
+
+    zic now allows unambiguous abbreviations like "Sa" and "Su" for
+    weekdays; formerly it rejected them due to a bug.  Conversely, zic
+    no longer considers non-prefixes to be abbreviations; for example,
+    it no longer accepts "lF" as an abbreviation for "lastFriday".
+    Also, zic warns about the undocumented usage with a "last-"
+    prefix, e.g., "last-Fri".
+
+    Similarly, zic now accepts the unambiguous abbreviation "L" for
+    "Link" in ordinary context and for "Leap" in leap-second context.
+    Conversely, zic no longer accepts non-prefixes such as "La" as
+    abbreviations for words like "Leap".
+
+    zic no longer accepts leap second lines in ordinary input, or
+    ordinary lines in leap second input.  Formerly, zic sometimes
+    warned about this undocumented usage and handled it incorrectly.
+
+    The new macro HAVE_TZNAME governs whether the tzname external
+    variable is exported, instead of USG_COMPAT.  USG_COMPAT now
+    governs only the external variables "timezone" and "daylight".
+    This change is needed because the three variables are not in the
+    same category: although POSIX requires tzname, it specifies the
+    other two variables as optional.  Also, USG_COMPAT is now 1 or 0:
+    if not defined, the code attempts to guess it from other macros.
+
+    localtime.c and difftime.c no longer require stdio.h, and .c files
+    other than zic.c no longer require sys/wait.h.
+
+    zdump.c no longer assumes snprintf.  (Reported by Jonathan Leffler.)
+
+    Calculation of time_t extrema works around a bug in GCC 4.8.4
+    (Reported by Stan Shebs and Joseph Myers.)
+
+    zic.c no longer mistranslates formats of line numbers in non-English
+    locales.  (Problem reported by Benno Schulenberg.)
+
+    Several minor changes have been made to the code to make it a
+    bit easier to port to MS-Windows and Solaris.  (Thanks to Kees
+    Dekker for reporting the problems.)
+
+  Changes to documentation and commentary
+
+    The two new files 'theory.html' and 'calendars' contain the
+    contents of the removed file 'Theory'.  The goal is to document
+    tzdb theory more accessibly.
+
+    The zic man page now documents abbreviation rules.
+
+    tz-link.htm now covers how to apply tzdata changes to clients.
+    (Thanks to Jorge Fábregas for the AIX link.)  It also mentions MySQL.
+
+    The leap-seconds.list URL has been updated to something that is
+    more reliable for tzdb.  (Thanks to Tim Parenti and Brian Inglis.)
+
 Release 2017b - 2017-03-17 07:30:38 -0700
 
   Briefly: Haiti has resumed DST.
@@ -15,6 +179,16 @@ Release 2017b - 2017-03-17 07:30:38 -0700
     Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430"
     is one byte over the POSIX limit.  (Problem reported by Derick Rethans.)
 
+  Changes to code
+
+    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
+    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.)
+
 
 Release 2017a - 2017-02-28 00:05:36 -0800
 
@@ -1981,7 +2155,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700
 
     The 'leapseconds' file is now generated automatically from a
     new file 'leap-seconds.list', which is a copy of
-    <ftp://time.nist.gov/pub/leap-seconds.list>.
+    <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
     A new source file 'leapseconds.awk' implements this.
     The goal is simplification of the future maintenance of 'leapseconds'.
 
@@ -2187,7 +2361,7 @@ Release 2013a - 2013-02-27 09:20:35 -0800
 
   Many changes affect historical timestamps before 1940.
   These were deduced from: Milne J. Civil time. Geogr J. 1899
-  Feb;13(2):173-94 <http://www.jstor.org/stable/1774359>.
+  Feb;13(2):173-94 <https://www.jstor.org/stable/1774359>.
 
   Changes affecting the code:
 
diff --git a/Theory b/Theory
deleted file mode 100644 (file)
index 33e4606..0000000
--- a/Theory
+++ /dev/null
@@ -1,870 +0,0 @@
-Theory and pragmatics of the tz code and data
-
-
------ Outline -----
-
-       Scope of the tz database
-       Names of time zone rules
-       Time zone abbreviations
-       Accuracy of the tz database
-       Time and date functions
-       Interface stability
-       Calendrical issues
-       Time and time zones on Mars
-
-
------ Scope of the tz database -----
-
-The tz database attempts to record the history and predicted future of
-all computer-based clocks that track civil time.  To represent this
-data, the world is partitioned into regions whose clocks all agree
-about time stamps that occur after the somewhat-arbitrary cutoff point
-of the POSIX Epoch (1970-01-01 00:00:00 UTC).  For each such region,
-the database records all known clock transitions, and labels the region
-with a notable location.  Although 1970 is a somewhat-arbitrary
-cutoff, there are significant challenges to moving the cutoff earlier
-even by a decade or two, due to the wide variety of local practices
-before computer timekeeping became prevalent.
-
-Clock transitions before 1970 are recorded for each such location,
-because most systems support time stamps 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
-applications requiring accurate handling of all past times everywhere,
-as it would take far too much effort and guesswork to record all
-details of pre-1970 civil timekeeping.
-
-As described below, reference source code for using the tz database is
-also available.  The tz code is upwards compatible with POSIX, an
-international standard for UNIX-like systems.  As of this writing, the
-current edition of POSIX is:
-
-  The Open Group Base Specifications Issue 7
-  IEEE Std 1003.1-2008, 2016 Edition
-  <http://pubs.opengroup.org/onlinepubs/9699919799/>
-
-
-
------ Names of time zone rules -----
-
-Each of the database's time zone rules 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 'tzselect'
-program in the tz code.  The Unicode Common Locale Data Repository
-<http://cldr.unicode.org/> contains data that may be useful for other
-selection interfaces.
-
-The time zone rule naming conventions attempt to strike a balance
-among the following goals:
-
- * Uniquely identify every region where clocks have agreed since 1970.
-   This is essential for the intended use: static clocks keeping local
-   civil time.
-
- * Indicate to experts where that region is.
-
- * Be robust in the presence of political changes.  For example, names
-   of countries are ordinarily not used, to avoid incompatibilities
-   when countries change their name (e.g. Zaire->Congo) or when
-   locations change countries (e.g. Hong Kong from UK colony to
-   China).
-
- * Be portable to a wide variety of implementations.
-
- * Use a consistent naming conventions over the entire world.
-
-Names normally have the form AREA/LOCATION, where AREA is the name
-of a continent or ocean, and LOCATION is the name of a specific
-location within that region.  North and South America share the same
-area, 'America'.  Typical names are 'Africa/Cairo', 'America/New_York',
-and 'Pacific/Honolulu'.
-
-Here are the general rules used for choosing location names,
-in decreasing order of importance:
-
-       Use only valid POSIX file name components (i.e., the parts of
-               names other than '/').  Do not use the file name
-               components '.' and '..'.  Within a file name component,
-               use only ASCII letters, '.', '-' and '_'.  Do not use
-               digits, as that might create an ambiguity with POSIX
-               TZ strings.  A file name component must not exceed 14
-               characters or start with '-'.  E.g., prefer 'Brunei'
-               to 'Bandar_Seri_Begawan'.  Exceptions: see the discussion
-               of legacy names below.
-       A name must not be empty, or contain '//', or start or end with '/'.
-       Do not use names that differ only in case.  Although the reference
-               implementation is case-sensitive, some other implementations
-               are not, and they would mishandle names differing only in case.
-       If one name A is an initial prefix of another name AB (ignoring case),
-               then B must not start with '/', as a regular file cannot have
-               the same name as a directory in POSIX.  For example,
-               'America/New_York' precludes 'America/New_York/Bronx'.
-       Uninhabited regions like the North Pole and Bouvet Island
-               do not need locations, since local time is not defined there.
-       There should typically be at least one name for each ISO 3166-1
-               officially assigned two-letter code for an inhabited country
-               or territory.
-       If all the clocks in a region have agreed since 1970,
-               don't bother to include more than one location
-               even if subregions' clocks disagreed before 1970.
-               Otherwise these tables would become annoyingly large.
-       If a name is ambiguous, use a less ambiguous alternative;
-               e.g. many cities are named San José and Georgetown, so
-               prefer 'Costa_Rica' to 'San_Jose' and 'Guyana' to 'Georgetown'.
-       Keep locations compact.  Use cities or small islands, not countries
-               or regions, so that any future time zone changes do not split
-               locations into different time zones.  E.g. prefer 'Paris'
-               to 'France', since France has had multiple time zones.
-       Use mainstream English spelling, e.g. prefer 'Rome' to 'Roma', and
-               prefer 'Athens' to the Greek 'Αθήνα' or the Romanized 'Athína'.
-               The POSIX file name restrictions encourage this rule.
-       Use the most populous among locations in a zone,
-               e.g. prefer 'Shanghai' to 'Beijing'.  Among locations with
-               similar populations, pick the best-known location,
-               e.g. prefer 'Rome' to 'Milan'.
-       Use the singular form, e.g. prefer 'Canary' to 'Canaries'.
-       Omit common suffixes like '_Islands' and '_City', unless that
-               would lead to ambiguity.  E.g. prefer 'Cayman' to
-               'Cayman_Islands' and 'Guatemala' to 'Guatemala_City',
-               but prefer 'Mexico_City' to 'Mexico' because the country
-               of Mexico has several time zones.
-       Use '_' to represent a space.
-       Omit '.' from abbreviations in names, e.g. prefer 'St_Helena'
-               to 'St._Helena'.
-       Do not change established names if they only marginally
-               violate the above rules.  For example, don't change
-               the existing name 'Rome' to 'Milan' merely because
-               Milan's population has grown to be somewhat greater
-               than Rome's.
-       If a name is changed, put its old spelling in the 'backward' file.
-               This means old spellings will continue to work.
-
-The file 'zone1970.tab' lists geographical locations used to name time
-zone rules.  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.  Although a 'zone1970.tab' location's longitude
-corresponds to its LMT offset with one hour for every 15 degrees east
-longitude, this relationship is not exact.
-
-Older versions of this package used a different naming scheme,
-and these older names are still supported.
-See the file 'backward' for most of these older names
-(e.g., 'US/Eastern' instead of 'America/New_York').
-The other old-fashioned names still supported are
-'WET', 'CET', 'MET', and 'EET' (see the file 'europe').
-
-Older versions of this package defined legacy names that are
-incompatible with the first rule of location names, but which are
-still supported.  These legacy names are mostly defined in the file
-'etcetera'.  Also, the file 'backward' defines the legacy names
-'GMT0', 'GMT-0', 'GMT+0' and 'Canada/East-Saskatchewan', and the file
-'northamerica' defines the legacy names 'EST5EDT', 'CST6CDT',
-'MST7MDT', and 'PST8PDT'.
-
-Excluding 'backward' should not affect the other data.  If
-'backward' is excluded, excluding 'etcetera' should not affect the
-remaining data.
-
-
------ Time zone abbreviations -----
-
-When this package is installed, it generates time zone abbreviations
-like 'EST' to be compatible with human tradition and POSIX.
-Here are the general rules used for choosing time zone abbreviations,
-in decreasing order of importance:
-
-       Use three or more characters that are ASCII alphanumerics or '+' or '-'.
-               Previous editions of this database also used characters like
-               ' ' and '?', but these characters have a special meaning to
-               the shell and cause commands like
-                       set `date`
-               to have unexpected effects.
-               Previous editions of this rule required upper-case letters,
-               but the Congressman who introduced Chamorro Standard Time
-               preferred "ChST", so lower-case letters are now allowed.
-               Also, POSIX from 2001 on relaxed the rule to allow '-', '+',
-               and alphanumeric characters from the portable character set
-               in the current locale.  In practice ASCII alphanumerics and
-               '+' and '-' are safe in all locales.
-
-               In other words, in the C locale the POSIX extended regular
-               expression [-+[:alnum:]]{3,} should match the abbreviation.
-               This guarantees that all abbreviations could have been
-               specified by a POSIX TZ string.
-
-       Use abbreviations that are in common use among English-speakers,
-               e.g. 'EST' for Eastern Standard Time in North America.
-               We assume that applications translate them to other languages
-               as part of the normal localization process; for example,
-               a French application might translate 'EST' to 'HNE'.
-
-       For zones whose times are taken from a city's longitude, use the
-               traditional xMT notation, e.g. 'PMT' for Paris Mean Time.
-               The only name like this in current use is 'GMT'.
-
-       Use 'LMT' for local mean time of locations before the introduction
-               of standard time; see "Scope of the tz database".
-
-       If there is no common English abbreviation, use numeric offsets like
-               -05 and +0830 that are generated by zic's %z notation.
-
-       Use current abbreviations for older timestamps to avoid confusion.
-               For example, in 1910 a common English abbreviation for UT +01
-               in central Europe was 'MEZ' (short for both "Middle European
-               Zone" and for "Mitteleuropäische Zeit" in German).  Nowadays
-               'CET' ("Central European Time") is more common in English, and
-               the database uses 'CET' even for circa-1910 timestamps as this
-               is less confusing for modern users and avoids the need for
-               determining when 'CET' supplanted 'MEZ' in common usage.
-
-       Use a consistent style in a zone's history.  For example, if a zone's
-               history tends to use numeric abbreviations and a particular
-               entry could go either way, use a numeric abbreviation.
-
-    [The remaining guidelines predate the introduction of %z.
-    They are problematic as they mean tz data entries invent
-    notation rather than record it.  These guidelines are now
-    deprecated and the plan is to gradually move to %z for
-    inhabited locations and to "-00" for uninhabited locations.]
-
-       If there is no common English abbreviation, abbreviate the English
-               translation of the usual phrase used by native speakers.
-               If this is not available or is a phrase mentioning the country
-               (e.g. "Cape Verde Time"), then:
-
-               When a country is identified with a single or principal zone,
-                       append 'T' to the country's ISO code, e.g. 'CVT' for
-                       Cape Verde Time.  For summer time append 'ST';
-                       for double summer time append 'DST'; etc.
-               Otherwise, take the first three letters of an English place
-                       name identifying each zone and append 'T', 'ST', etc.
-                       as before; e.g. 'CHAST' for CHAtham Summer Time.
-
-       Use UT (with time zone abbreviation '-00') for locations while
-               uninhabited.  The leading '-' is a flag that the time
-               zone is in some sense undefined; this notation is
-               derived from Internet RFC 3339.
-
-Application writers should note that these abbreviations are ambiguous
-in practice: e.g. 'CST' has a different meaning in China than
-it does in the United States.  In new applications, it's often better
-to use numeric UT offsets like '-0600' instead of time zone
-abbreviations like 'CST'; this avoids the ambiguity.
-
-
------ Accuracy of the tz database -----
-
-The tz database is not authoritative, and it surely has errors.
-Corrections are welcome and encouraged; see the file CONTRIBUTING.
-Users requiring authoritative data should consult national standards
-bodies and the references cited in the database's comments.
-
-Errors in the tz database arise from many sources:
-
- * The tz database predicts future time stamps, and current predictions
-   will be incorrect after future governments change the rules.
-   For example, if today someone schedules a meeting for 13:00 next
-   October 1, Casablanca time, and tomorrow Morocco changes its
-   daylight saving rules, software can mess up after the rule change
-   if it blithely relies on conversions made before the change.
-
- * 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 zones would
-   be needed if the tz 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 into dozens
-   of entries, perhaps hundreds.  And in most of the world even this
-   approach would be misleading due to widespread disagreement or
-   indifference about what times should be observed.  In her 2015 book
-   "The Global Transformation of Time, 1870-1950", Vanessa Ogle writes
-   "Outside of Europe and North America there was no system of time
-   zones at all, often not even a stable landscape of mean times,
-   prior to the middle decades of the twentieth century".  See:
-   Timothy Shenk, Booked: A Global History of Time. Dissent 2015-12-17
-   https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanessa-ogle
-
- * Most of the pre-1970 data entries come from unreliable sources, often
-   astrology books that lack citations and whose compilers evidently
-   invented entries when the true facts were unknown, without
-   reporting which entries were known and which were invented.
-   These books often contradict each other or give implausible entries,
-   and on the rare occasions when they are checked they are
-   typically found to be incorrect.
-
- * For the UK the tz database relies on years of first-class work done by
-   Joseph Myers and others; see <http://www.polyomino.org.uk/british-time/>.
-   Other countries are not done nearly as well.
-
- * Sometimes, different people in the same city would maintain clocks
-   that differed significantly.  Railway time was used by railroad
-   companies (which did not always agree with each other),
-   church-clock time was used for birth certificates, etc.
-   Often this was merely common practice, but sometimes it was set by law.
-   For example, from 1891 to 1911 the UT offset in France was legally
-   0:09:21 outside train stations and 0:04:21 inside.
-
- * Although a named location in the tz database stands for the
-   containing region, its pre-1970 data entries are often accurate for
-   only a small subset of that region.  For example, Europe/London
-   stands for the United Kingdom, but its pre-1847 times are valid
-   only for locations that have London's exact meridian, and its 1847
-   transition to GMT is known to be valid only for the L&NW and the
-   Caledonian railways.
-
- * The tz database does not record the earliest time for which a zone's
-   data entries are thereafter valid for every location in the region.
-   For example, Europe/London is valid for all locations in its
-   region after GMT was made the standard time, but the date of
-   standardization (1880-08-02) is not in the tz database, other than
-   in commentary.  For many zones the earliest time of validity is
-   unknown.
-
- * The tz database does not record a region's boundaries, and in many
-   cases the boundaries are not known.  For example, the zone
-   America/Kentucky/Louisville represents a region around the city of
-   Louisville, the boundaries of which are unclear.
-
- * Changes that are modeled as instantaneous transitions in the tz
-   database were often spread out over hours, days, or even decades.
-
- * Even if the time is specified by law, locations sometimes
-   deliberately flout the law.
-
- * Early timekeeping practices, even assuming perfect clocks, were
-   often not specified to the accuracy that the tz database requires.
-
- * Sometimes historical timekeeping was specified more precisely
-   than what the tz database can handle.  For example, from 1909 to
-   1937 Netherlands clocks were legally UT +00:19:32.13, but the tz
-   database cannot represent the fractional second.
-
- * Even when all the timestamp transitions recorded by the tz database
-   are correct, the tz rules that generate them may not faithfully
-   reflect the historical rules.  For example, from 1922 until World
-   War II the UK moved clocks forward the day following the third
-   Saturday in April unless that was Easter, in which case it moved
-   clocks forward the previous Sunday.  Because the tz database has no
-   way to specify Easter, these exceptional years are entered as
-   separate tz Rule lines, even though the legal rules did not change.
-
- * The tz database models pre-standard time using the proleptic Gregorian
-   calendar and local mean time (LMT), but many people used other
-   calendars and other timescales.  For example, the Roman Empire used
-   the Julian calendar, and had 12 varying-length daytime hours with a
-   non-hour-based system at night.
-
- * Early clocks were less reliable, and data entries do not represent
-   clock error.
-
- * The tz database assumes Universal Time (UT) as an origin, even
-   though UT is not standardized for older time stamps.  In the tz
-   database commentary, UT denotes a family of time standards that
-   includes Coordinated Universal Time (UTC) along with other variants
-   such as UT1 and GMT, with days starting at midnight.  Although UT
-   equals UTC for modern time stamps, UTC was not defined until 1960,
-   so commentary uses the more-general abbreviation UT for time stamps
-   that might predate 1960.  Since UT, UT1, etc. disagree slightly,
-   and since pre-1972 UTC seconds varied in length, interpretation of
-   older time stamps can be problematic when subsecond accuracy is
-   needed.
-
- * Civil time was not based on atomic time before 1972, and we don't
-   know the history of earth's rotation accurately enough to map SI
-   seconds to historical solar time to more than about one-hour
-   accuracy.  See: Stephenson FR, Morrison LV, Hohenkerk CY.
-   Measurement of the Earth's rotation: 720 BC to AD 2015.
-   Proc Royal Soc A. 2016 Dec 7;472:20160404.
-   http://dx.doi.org/10.1098/rspa.2016.0404
-   Also see: Espenak F. Uncertainty in Delta T (ΔT).
-   http://eclipse.gsfc.nasa.gov/SEhelp/uncertainty2004.html
-
- * The relationship between POSIX time (that is, UTC but ignoring leap
-   seconds) and UTC is not agreed upon after 1972.  Although the POSIX
-   clock officially stops during an inserted leap second, at least one
-   proposed standard has it jumping back a second instead; and in
-   practice POSIX clocks more typically either progress glacially during
-   a leap second, or are slightly slowed while near a leap second.
-
- * The tz database does not represent how uncertain its information is.
-   Ideally it would contain information about when data entries are
-   incomplete or dicey.  Partial temporal knowledge is a field of
-   active research, though, and it's not clear how to apply it here.
-
-In short, many, perhaps most, of the tz database's pre-1970 and future
-time stamps are either wrong or misleading.  Any attempt to pass the
-tz database off as the definition of time should be unacceptable to
-anybody who cares about the facts.  In particular, the tz database's
-LMT offsets should not be considered meaningful, and should not prompt
-creation of zones merely because two locations differ in LMT or
-transitioned to standard time at different dates.
-
-
------ Time and date functions -----
-
-The tz code contains time and date functions that are upwards
-compatible with those of POSIX.
-
-POSIX has the following properties and limitations.
-
-*      In POSIX, time display in a process is controlled by the
-       environment variable TZ.  Unfortunately, the POSIX TZ string takes
-       a form that is hard to describe and is error-prone in practice.
-       Also, POSIX TZ strings can't deal with other (for example, Israeli)
-       daylight saving time rules, or situations where more than two
-       time zone abbreviations are used in an area.
-
-       The POSIX TZ string takes the following form:
-
-               stdoffset[dst[offset][,date[/time],date[/time]]]
-
-       where:
-
-       std and dst
-               are 3 or more characters specifying the standard
-               and daylight saving time (DST) zone names.
-               Starting with POSIX.1-2001, std and dst may also be
-               in a quoted form like "<UTC+10>"; this allows
-               "+" and "-" in the names.
-       offset
-               is of the form '[+-]hh:[mm[:ss]]' and specifies the
-               offset west of UT.  'hh' may be a single digit; 0<=hh<=24.
-               The default DST offset is one hour ahead of standard time.
-       date[/time],date[/time]
-               specifies the beginning and end of DST.  If this is absent,
-               the system supplies its own rules for DST, and these can
-               differ from year to year; typically US DST rules are used.
-       time
-               takes the form 'hh:[mm[:ss]]' and defaults to 02:00.
-               This is the same format as the offset, except that a
-               leading '+' or '-' is not allowed.
-       date
-               takes one of the following forms:
-               Jn (1<=n<=365)
-                       origin-1 day number not counting February 29
-               n (0<=n<=365)
-                       origin-0 day number counting February 29 if present
-               Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
-                       for the dth day of week n of month m of the year,
-                       where week 1 is the first week in which day d appears,
-                       and '5' stands for the last week in which day d appears
-                       (which may be either the 4th or 5th week).
-                       Typically, this is the only useful form;
-                       the n and Jn forms are rarely used.
-
-       Here is an example POSIX TZ string, for US Pacific time using rules
-       appropriate from 1987 through 2006:
-
-               TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'
-
-       This POSIX TZ string is hard to remember, and mishandles time stamps
-       before 1987 and after 2006.  With this package you can use this
-       instead:
-
-               TZ='America/Los_Angeles'
-
-*      POSIX does not define the exact meaning of TZ values like "EST5EDT".
-       Typically the current US DST rules are used to interpret such values,
-       but this means that the US DST rules are compiled into each program
-       that does time conversion.  This means that when US time conversion
-       rules change (as in the United States in 1987), all programs that
-       do time conversion must be recompiled to ensure proper results.
-
-*      The TZ environment variable is process-global, which makes it hard
-       to write efficient, thread-safe applications that need access
-       to multiple time zones.
-
-*      In POSIX, there's 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 used only at certain times -
-       without regard to whether the user has fiddled the "TZ" environment
-       variable.  While an administrator can "do everything in UTC" 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.)
-
-*      POSIX provides no convenient and efficient way to determine the UT
-       offset and time zone abbreviation of arbitrary time stamps,
-       particularly for time zone settings that do not fit into the
-       POSIX model.
-
-*      POSIX requires that systems ignore leap seconds.
-
-*      The tz code attempts to support all the time_t implementations
-       allowed by POSIX.  The time_t type represents a nonnegative count of
-       seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds.
-       In practice, time_t is usually a signed 64- or 32-bit integer; 32-bit
-       signed time_t values stop working after 2038-01-19 03:14:07 UTC, so
-       new implementations these days typically use a signed 64-bit integer.
-       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 time_t to be a
-       floating-point type, this was not supported by any practical
-       systems, and POSIX.1-2013 and the tz code both require time_t
-       to be an integer type.
-
-These are the extensions that have been made to the POSIX functions:
-
-*      The "TZ" environment variable is used in generating the name of a file
-       from which time zone information is read (or is interpreted a la
-       POSIX); "TZ" is no longer constrained to be a three-letter time zone
-       name followed by a number of hours and an optional three-letter
-       daylight time zone name.  The daylight saving time rules to be used
-       for a particular time zone are encoded in the time zone file;
-       the format of the file allows U.S., Australian, and other rules to be
-       encoded, and allows for situations where more than two time zone
-       abbreviations are used.
-
-       It was recognized that allowing the "TZ" environment variable to
-       take on values such as "America/New_York" might cause "old" programs
-       (that expect "TZ" to have a certain form) to operate incorrectly;
-       consideration was given to using some other environment variable
-       (for example, "TIMEZONE") to hold the string used to generate the
-       time zone information file name.  In the end, however, it was decided
-       to continue using "TZ": it is widely used for time zone purposes;
-       separately maintaining both "TZ" and "TIMEZONE" seemed a nuisance;
-       and systems where "new" forms of "TZ" might cause problems can simply
-       use TZ values such as "EST5EDT" which can be used both by
-       "new" programs (a la POSIX) and "old" programs (as zone names and
-       offsets).
-
-*      The code supports platforms with a UT offset member in struct tm,
-       e.g., tm_gmtoff.
-
-*      The code supports platforms with a time zone abbreviation member in
-       struct tm, e.g., tm_zone.
-
-*      Since the "TZ" environment variable can now be used to control time
-       conversion, the "daylight" and "timezone" variables are no longer
-       needed.  (These variables are defined and set by "tzset"; however, their
-       values will not be used by "localtime.")
-
-*      Functions tzalloc, tzfree, localtime_rz, and mktime_z for
-       more-efficient thread-safe applications that need to use
-       multiple time zones.  The tzalloc and tzfree functions
-       allocate and free objects of type timezone_t, and localtime_rz
-       and mktime_z are like localtime_r and mktime with an extra
-       timezone_t argument.  The functions were inspired by NetBSD.
-
-*      A function "tzsetwall" has been added to arrange for the system's
-       best approximation to local wall clock time to be delivered by
-       subsequent calls to "localtime."  Source code for portable
-       applications that "must" run on local wall clock time should call
-       "tzsetwall();" if such code is moved to "old" systems that don't
-       provide tzsetwall, you won't be able to generate an executable program.
-       (These time zone functions also arrange for local wall clock time to be
-       used if tzset is called - directly or indirectly - and there's no "TZ"
-       environment variable; portable applications should not, however, rely
-       on this behavior since it's not the way SVR2 systems behave.)
-
-*      Negative time_t values are supported, on systems where time_t is signed.
-
-*      These functions can account for leap seconds, thanks to Bradley White.
-
-Points of interest to folks with other systems:
-
-*      Code compatible with this package is already part of many platforms,
-       including GNU/Linux, Android, the BSDs, Chromium OS, Cygwin, AIX, iOS,
-       BlackBery 10, macOS, Microsoft Windows, OpenVMS, and Solaris.
-       On such hosts, the primary use of this package
-       is to update obsolete time zone rule tables.
-       To do this, you may need to compile the time zone compiler
-       'zic' supplied with this package instead of using the system 'zic',
-       since the format of zic's input is occasionally extended,
-       and a platform may still be shipping an older zic.
-
-*      The UNIX Version 7 "timezone" function is not present in this package;
-       it's impossible to reliably map timezone's arguments (a "minutes west
-       of GMT" value and a "daylight saving time in effect" flag) to a
-       time zone abbreviation, and we refuse to guess.
-       Programs that in the past used the timezone function may now examine
-       tzname[localtime(&clock)->tm_isdst] to learn the correct time
-       zone abbreviation to use.  Alternatively, use
-       localtime(&clock)->tm_zone if this has been enabled.
-
-*      The 4.2BSD gettimeofday function is not used in this package.
-       This formerly let users obtain the current UTC offset and DST flag,
-       but this functionality was removed in later versions of BSD.
-
-*      In SVR2, time conversion fails for near-minimum or near-maximum
-       time_t values when doing conversions for places that don't use UT.
-       This package takes care to do these conversions correctly.
-       A comment in the source code tells how to get compatibly wrong
-       results.
-
-The functions that are conditionally compiled if STD_INSPIRED is defined
-should, at this point, be looked on primarily as food for thought.  They are
-not in any sense "standard compatible" - some are not, in fact, specified in
-*any* standard.  They do, however, represent responses of various authors to
-standardization proposals.
-
-Other time conversion proposals, in particular the one developed by folks at
-Hewlett Packard, 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
-functions.  Rather, their absence reflects the decision to make this package
-contain valid extensions to POSIX, to ensure its broad acceptability.  If
-more powerful time conversion functions can be standardized, so much the
-better.
-
-
------ Interface stability -----
-
-The tz code and data supply the following interfaces:
-
- * A set of zone names as per "Names of time zone rules" above.
-
- * Library functions described in "Time and date functions" above.
-
- * The programs tzselect, zdump, and zic, documented in their man pages.
-
- * The format of zic input files, documented in the zic man page.
-
- * The format of zic output files, documented in the tzfile man page.
-
- * The format of zone table files, documented in zone1970.tab.
-
- * The format of the country code file, documented in iso3166.tab.
-
- * The version number of the code and data, as the first line of
-   the text file 'version' in each release.
-
-Interface changes in a release attempt to preserve compatibility with
-recent releases.  For example, tz data files typically do not rely on
-recently-added zic features, so that users can run older zic versions
-to process newer data files.  The tz-link.htm file describes how
-releases are tagged and distributed.
-
-Interfaces not listed above are less stable.  For example, users
-should not rely on particular UT offsets or abbreviations for time
-stamps, as data entries are often based on guesswork and these guesses
-may be corrected or improved.
-
-
------ Calendrical issues -----
-
-Calendrical issues are a bit out of scope for a time zone database,
-but they indicate the sort of problems that we would run into if we
-extended the time zone database further into the past.  An excellent
-resource in this area is Nachum Dershowitz and Edward M. Reingold,
-Calendrical Calculations: Third Edition, Cambridge University Press (2008)
-<http://emr.cs.iit.edu/home/reingold/calendar-book/third-edition/>.
-Other information and sources are given below.  They sometimes disagree.
-
-
-France
-
-Gregorian calendar adopted 1582-12-20.
-French Revolutionary calendar used 1793-11-24 through 1805-12-31,
-and (in Paris only) 1871-05-06 through 1871-05-23.
-
-
-Russia
-
-From Chris Carrier (1996-12-02):
-On 1929-10-01 the Soviet Union instituted an "Eternal Calendar"
-with 30-day months plus 5 holidays, with a 5-day week.
-On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
-Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
-reverted to the 7-day week.  With the 6-day week the usual days
-off were the 6th, 12th, 18th, 24th and 30th of the month.
-(Source: Evitiar Zerubavel, _The Seven Day Circle_)
-
-
-Mark Brader reported a similar story in "The Book of Calendars", edited
-by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377.  But:
-
-From: Petteri Sulonen (via Usenet)
-Date: 14 Jan 1999 00:00:00 GMT
-...
-
-If your source is correct, how come documents between 1929 and 1940 were
-still dated using the conventional, Gregorian calendar?
-
-I can post a scan of a document dated December 1, 1934, signed by
-Yenukidze, the secretary, on behalf of Kalinin, the President of the
-Executive Committee of the Supreme Soviet, if you like.
-
-
-
-Sweden (and Finland)
-
-From: Mark Brader
-Subject: Re: Gregorian reform - a part of locale?
-<news:1996Jul6.012937.29190@sq.com>
-Date: 1996-07-06
-
-In 1700, Denmark made the transition from Julian to Gregorian.  Sweden
-decided to *start* a transition in 1700 as well, but rather than have one of
-those unsightly calendar gaps :-), they simply decreed that the next leap
-year after 1696 would be in 1744 - putting the whole country on a calendar
-different from both Julian and Gregorian for a period of 40 years.
-
-However, in 1704 something went wrong and the plan was not carried through;
-they did, after all, have a leap year that year.  And one in 1708.  In 1712
-they gave it up and went back to Julian, putting 30 days in February that
-year!...
-
-Then in 1753, Sweden made the transition to Gregorian in the usual manner,
-getting there only 13 years behind the original schedule.
-
-(A previous posting of this story was challenged, and Swedish readers
-produced the following references to support it: "Tideräkning och historia"
-by Natanael Beckman (1924) and "Tid, en bok om tideräkning och
-kalenderväsen" by Lars-Olof Lodén (1968).
-
-
-Grotefend's data
-
-From: "Michael Palmer" [with one obvious typo fixed]
-Subject: Re: Gregorian Calendar (was Re: Another FHC related question
-Newsgroups: soc.genealogy.german
-Date: Tue, 9 Feb 1999 02:32:48 -800
-...
-
-The following is a(n incomplete) listing, arranged chronologically, of
-European states, with the date they converted from the Julian to the
-Gregorian calendar:
-
-04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
-                 Catholics and Danzig only)
-09/20 Dec 1582 - France, Lorraine
-
-21 Dec 1582/
-   01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
-10/21 Feb 1583 - bishopric of Liege (Lüttich)
-13/24 Feb 1583 - bishopric of Augsburg
-04/15 Oct 1583 - electorate of Trier
-05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
-                 Salzburg, Brixen
-13/24 Oct 1583 - Austrian Oberelsaß and Breisgau
-20/31 Oct 1583 - bishopric of Basel
-02/13 Nov 1583 - duchy of Jülich-Berg
-02/13 Nov 1583 - electorate and city of Köln
-04/15 Nov 1583 - bishopric of Würzburg
-11/22 Nov 1583 - electorate of Mainz
-16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
-17/28 Nov 1583 - bishopric of Münster and duchy of Cleve
-14/25 Dec 1583 - Steiermark
-
-06/17 Jan 1584 - Austria and Bohemia
-11/22 Jan 1584 - Lucerne, Uri, Schwyz, Zug, Freiburg, Solothurn
-12/23 Jan 1584 - Silesia and the Lausitz
-22 Jan/
-   02 Feb 1584 - Hungary (legally on 21 Oct 1587)
-      Jun 1584 - Unterwalden
-01/12 Jul 1584 - duchy of Westfalen
-
-16/27 Jun 1585 - bishopric of Paderborn
-
-14/25 Dec 1590 - Transylvania
-
-22 Aug/
-   02 Sep 1612 - duchy of Prussia
-
-13/24 Dec 1614 - Pfalz-Neuburg
-
-          1617 - duchy of Kurland (reverted to the Julian calendar in
-                 1796)
-
-          1624 - bishopric of Osnabrück
-
-          1630 - bishopric of Minden
-
-15/26 Mar 1631 - bishopric of Hildesheim
-
-          1655 - Kanton Wallis
-
-05/16 Feb 1682 - city of Strassburg
-
-18 Feb/
-   01 Mar 1700 - Protestant Germany (including Swedish possessions in
-                 Germany), Denmark, Norway
-30 Jun/
-   12 Jul 1700 - Gelderland, Zutphen
-10 Nov/
-   12 Dec 1700 - Utrecht, Overijssel
-
-31 Dec 1700/
-   12 Jan 1701 - Friesland, Groningen, Zürich, Bern, Basel, Geneva,
-                 Turgau, and Schaffhausen
-
-          1724 - Glarus, Appenzell, and the city of St. Gallen
-
-01 Jan 1750    - Pisa and Florence
-
-02/14 Sep 1752 - Great Britain
-
-17 Feb/
-   01 Mar 1753 - Sweden
-
-1760-1812      - Graubünden
-
-The Russian empire (including Finland and the Baltic states) did not
-convert to the Gregorian calendar until the Soviet revolution of 1917.
-
-Source: H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
-Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
-(Hannover: Hahnsche Buchhandlung, 1941), pp. 26-28.
-
-
------ Time and time zones on Mars -----
-
-Some people's work schedules use Mars time.  Jet Propulsion Laboratory
-(JPL) coordinators have kept Mars time on and off at least since 1997
-for the Mars Pathfinder mission.  Some of their family members have
-also adapted to Mars time.  Dozens of special Mars watches were built
-for JPL workers who kept Mars time during the Mars Exploration
-Rovers mission (2004).  These timepieces look like normal Seikos and
-Citizens but use Mars seconds rather than terrestrial seconds.
-
-A Mars solar day is called a "sol" and has a mean period equal to
-about 24 hours 39 minutes 35.244 seconds in terrestrial time.  It is
-divided into a conventional 24-hour clock, so each Mars second equals
-about 1.02749125 terrestrial seconds.
-
-The prime meridian of Mars goes through the center of the crater
-Airy-0, named in honor of the British astronomer who built the
-Greenwich telescope that defines Earth's prime meridian.  Mean solar
-time on the Mars prime meridian is called Mars Coordinated Time (MTC).
-
-Each landed mission on Mars has adopted a different reference for
-solar time keeping, so there is no real standard for Mars time zones.
-For example, the Mars Exploration Rover project (2004) defined two
-time zones "Local Solar Time A" and "Local Solar Time B" for its two
-missions, each zone designed so that its time equals local true solar
-time at approximately the middle of the nominal mission.  Such a "time
-zone" is not particularly suited for any application other than the
-mission itself.
-
-Many calendars have been proposed for Mars, but none have achieved
-wide acceptance.  Astronomers often use Mars Sol Date (MSD) which is a
-sequential count of Mars solar days elapsed since about 1873-12-29
-12:00 GMT.
-
-The tz database does not currently support Mars time, but it is
-documented here in the hopes that support will be added eventually.
-
-Sources:
-
-Michael Allison and Robert Schmunk,
-"Technical Notes on Mars Solar Time as Adopted by the Mars24 Sunclock"
-<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2012-08-08).
-
-Jia-Rui Chong, "Workdays Fit for a Martian", Los Angeles Times
-<http://articles.latimes.com/2004/jan/14/science/sci-marstime14>
-(2004-01-14), pp A1, A20-A21.
-
-Tom Chmielewski, "Jet Lag Is Worse on Mars", The Atlantic (2015-02-26)
-<http://www.theatlantic.com/technology/archive/2015/02/jet-lag-is-worse-on-mars/386033/>
-
------
-
-This file is in the public domain, so clarified as of 2009-05-17 by
-Arthur David Olson.
-
------
-Local Variables:
-coding: utf-8
-End:
diff --git a/africa b/africa
index dcc20b9..3a60bc2 100644 (file)
--- a/africa
+++ b/africa
@@ -26,7 +26,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@@ -218,7 +218,7 @@ Rule        Egypt   2006    only    -       Sep     21      24:00   0       -
 # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
 # From Jesper Nørgaard Welen (2007-08-15): [The following agree:]
 # http://www.nentjes.info/Bill/bill5.htm
-# http://www.timeanddate.com/worldclock/city.html?n=53
+# https://www.timeanddate.com/worldclock/city.html?n=53
 # From Steffen Thorsen (2007-09-04): The official information...:
 # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
 Rule   Egypt   2007    only    -       Sep     Thu>=1  24:00   0       -
@@ -256,8 +256,8 @@ Rule        Egypt   2007    only    -       Sep     Thu>=1  24:00   0       -
 # timeanddate[2] and another site I've found[3] also support that.
 #
 # [1] https://bugzilla.redhat.com/show_bug.cgi?id=492263
-# [2] http://www.timeanddate.com/worldclock/clockchange.html?n=53
-# [3] http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
+# [2] https://www.timeanddate.com/worldclock/clockchange.html?n=53
+# [3] https://wwp.greenwichmeantime.com/time-zone/africa/egypt/
 
 # From Arthur David Olson (2009-04-20):
 # In 2009 (and for the next several years), Ramadan ends before the fourth
@@ -267,10 +267,10 @@ Rule      Egypt   2007    only    -       Sep     Thu>=1  24:00   0       -
 # From Steffen Thorsen (2009-08-11):
 # We have been able to confirm the August change with the Egyptian Cabinet
 # Information and Decision Support Center:
-# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
+# https://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
 #
 # The Middle East News Agency
-# http://www.mena.org.eg/index.aspx
+# https://www.mena.org.eg/index.aspx
 # also reports "Egypt starts winter time on August 21"
 # today in article numbered "71, 11/08/2009 12:25 GMT."
 # Only the title above is available without a subscription to their service,
@@ -320,7 +320,7 @@ Rule        Egypt   2007    only    -       Sep     Thu>=1  24:00   0       -
 # Thursday of April....  Clocks will still be turned back for Ramadan, but
 # dates not yet announced....
 # http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
-# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
+# https://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
 
 # From Ahmed Nazmy (2015-04-20):
 # Egypt's ministers cabinet just announced ... that it will cancel DST at
@@ -447,11 +447,11 @@ Zone      Africa/Monrovia -0:43:08 -      LMT     1882
 
 # From Even Scharning (2012-11-10):
 # Libya set their time one hour back at 02:00 on Saturday November 10.
-# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
+# https://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
 # Here is an official source [in Arabic]: http://ls.ly/fb6Yc
 #
 # Steffen Thorsen forwarded a translation (2012-11-10) in
-# http://mm.icann.org/pipermail/tz/2012-November/018451.html
+# https://mm.icann.org/pipermail/tz/2012-November/018451.html
 #
 # From Tim Parenti (2012-11-11):
 # Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
@@ -462,7 +462,7 @@ Zone        Africa/Monrovia -0:43:08 -      LMT     1882
 # From Even Scharning (2013-10-25):
 # The scheduled end of DST in Libya on Friday, October 25, 2013 was
 # cancelled yesterday....
-# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
+# https://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
 #
 # From Paul Eggert (2013-10-25):
 # For now, assume they're reverting to the pre-2012 rules of permanent UT +02.
@@ -515,7 +515,7 @@ Zone        Africa/Tripoli  0:52:44 -       LMT     1920
 # basis....
 # It seems that Mauritius observed daylight saving time from 1982-10-10 to
 # 1983-03-20 as well, but that was not successful....
-# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
+# https://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
 
 # From Alex Krivenyshev (2008-06-25):
 # http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
@@ -583,7 +583,7 @@ Zone        Africa/Tripoli  0:52:44 -       LMT     1920
 # http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
 #
 # Our wrap-up:
-# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
+# https://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
 
 # From Arthur David Olson (2009-07-11):
 # The "mauritius-dst-will-not-repeat" wrapup includes this:
@@ -615,7 +615,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # be one hour ahead of GMT between 1 June and 27 September, according to
 # Communication Minister and Government Spokesman, Khalid Naciri...."
 #
-# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
+# http://www.worldtimezone.com/dst_news/dst_news_morocco01.html
 # http://en.afrik.com/news11892.html
 
 # From Alex Krivenyshev (2008-05-09):
@@ -628,7 +628,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 
 # From Patrice Scattolin (2008-05-09):
 # According to this article:
-# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
+# https://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
 # (and republished here: <http://www.actu.ma/heure-dete-comment_i127896_0.html>)
 # the changes occur at midnight:
 #
@@ -650,7 +650,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # posted in English).
 #
 # The following Google query will generate many relevant hits:
-# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
+# https://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
 
 # From Steffen Thorsen (2008-08-27):
 # Morocco will change the clocks back on the midnight between August 31
@@ -661,7 +661,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
 #
 # We have some further details posted here:
-# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
+# https://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
 
 # From Steffen Thorsen (2009-03-17):
 # Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
@@ -671,7 +671,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # (French)
 #
 # Our summary:
-# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# https://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
 
 # From Alexander Krivenyshev (2009-03-17):
 # Here is a link to official document from Royaume du Maroc Premier Ministre,
@@ -694,7 +694,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
 # (French)
 # Our page:
-# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# https://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 
 # From Dan Abitol (2011-03-30):
 # ...Rules for Africa/Casablanca are the following (24h format)
@@ -711,7 +711,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # They said that the decision was already taken.
 #
 # More articles in the press
-# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
+# https://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
 # http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
 # http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
 
@@ -803,7 +803,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # 1433 (18 April 2012) and the decision of the Head of Government of
 # 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
 # Source (french):
-# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
+# https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
 #
 # From Milamber (2015-06-09):
 # http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
@@ -812,7 +812,7 @@ Zone Indian/Mauritius       3:50:00 -       LMT     1907 # Port Louis
 # [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
 # from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
 # I think the patch is correct and the quoted text is wrong; the text in
-# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
+# <https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
 # with the patch.
 
 # From Paul Eggert (2015-06-08):
@@ -937,9 +937,17 @@ Link Africa/Maputo Africa/Kigali   # Rwanda
 Link Africa/Maputo Africa/Lubumbashi   # E Dem. Rep. of Congo
 Link Africa/Maputo Africa/Lusaka       # Zambia
 
+
 # Namibia
-# The 1994-04-03 transition is from Shanks & Pottenger.
-# Shanks & Pottenger report no DST after 1998-04; go with IATA.
+
+# From Arthur David Olson (2017-08-09):
+# The text of the "Namibia Time Act, 1994" is available online at
+# www.lac.org.na/laws/1994/811.pdf
+# and includes this nugget:
+# Notwithstanding the provisions of subsection (2) of section 1, the
+# first winter period after the commencement of this Act shall
+# commence at OOhOO on Monday 21 March 1994 and shall end at 02h00 on
+# Sunday 4 September 1994.
 
 # From Petronella Sibeene (2007-03-30):
 # http://allafrica.com/stories/200703300178.html
@@ -955,19 +963,30 @@ Link Africa/Maputo Africa/Lusaka  # Zambia
 # observes Botswana time, we have no details about historical practice.
 # In the meantime people there can use Africa/Gaborone.
 # See: Immanuel S. The Namibian. 2017-02-23.
-# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
+# https://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
+
+# From Steffen Thorsen (2017-08-09):
+# Namibia is going to change their time zone to what is now their DST:
+# https://www.newera.com.na/2017/02/23/namibias-winter-time-might-be-repealed/
+# This video is from the government decision:
+# https://www.nbc.na/news/na-passes-namibia-time-bill-repealing-1994-namibia-time-act.8665
+# We have made the assumption so far that they will change their time zone at
+# the same time they would normally start DST, the first Sunday in September:
+# https://www.timeanddate.com/news/time/namibia-new-time-zone.html
 
 # RULE NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
-Rule   Namibia 1994    max     -       Sep     Sun>=1  2:00    1:00    S
-Rule   Namibia 1995    max     -       Apr     Sun>=1  2:00    0       -
+Rule   Namibia 1994    only    -       Mar     21      0:00    0       -
+Rule   Namibia 1994    2016    -       Sep     Sun>=1  2:00    1:00    S
+Rule   Namibia 1995    2017    -       Apr     Sun>=1  2:00    0       -
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Africa/Windhoek 1:08:24 -       LMT     1892 Feb 8
                        1:30    -       +0130   1903 Mar
                        2:00    -       SAST    1942 Sep 20  2:00
                        2:00    1:00    SAST    1943 Mar 21  2:00
                        2:00    -       SAST    1990 Mar 21 # independence
-                       2:00    -       CAT     1994 Apr  3
-                       1:00    Namibia WA%sT
+                       2:00    -       CAT     1994 Mar 21  0:00
+                       1:00    Namibia WA%sT   2017 Sep  3  2:00
+                       2:00    -       CAT
 
 # Niger
 # See Africa/Lagos.
@@ -1054,14 +1073,24 @@ Link Africa/Johannesburg Africa/Mbabane    # Swaziland
 # no information
 
 # Sudan
-#
+
 # From <http://www.sunanews.net/sn13jane.html>
 # Sudan News Agency (2000-01-13),
 # also reported by Michaël De Beukelaer-Dossche via Steffen Thorsen:
 # Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
 # Saturday....  This was announced Thursday by Caretaker State Minister for
 # Manpower Abdul-Rahman Nur-Eddin.
+
+# From Ahmed Atyya, National Telecommunications Corp. (NTC), Sudan (2017-10-17):
+# ... the Republic of Sudan is going to change the time zone from (GMT+3:00)
+# to (GMT+ 2:00) starting from Wednesday 1 November 2017.
 #
+# From Paul Eggert (2017-10-18):
+# A scanned copy (in Arabic) of Cabinet Resolution No. 352 for the
+# year 2017 can be found as an attachment in email today from Yahia
+# Abdalla of NTC, archived at:
+# https://mm.icann.org/pipermail/tz/2017-October/025333.html
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Sudan   1970    only    -       May      1      0:00    1:00    S
 Rule   Sudan   1970    1985    -       Oct     15      0:00    0       -
@@ -1070,10 +1099,14 @@ Rule    Sudan   1972    1985    -       Apr     lastSun 0:00    1:00    S
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Africa/Khartoum 2:10:08 -       LMT     1931
                        2:00    Sudan   CA%sT   2000 Jan 15 12:00
-                       3:00    -       EAT
+                       3:00    -       EAT     2017 Nov  1
+                       2:00    -       CAT
 
 # South Sudan
-Link Africa/Khartoum Africa/Juba
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Juba     2:06:28 -       LMT     1931
+                       2:00    Sudan   CA%sT   2000 Jan 15 12:00
+                       3:00    -       EAT
 
 # Swaziland
 # See Africa/Johannesburg.
@@ -1111,11 +1144,11 @@ Link Africa/Khartoum Africa/Juba
 # According to several news sources, Tunisia will not observe DST this year.
 # (Arabic)
 # http://www.elbashayer.com/?page=viewn&nid=42546
-# http://www.babnet.net/kiwidetail-15295.asp
+# https://www.babnet.net/kiwidetail-15295.asp
 #
 # We have also confirmed this with the US embassy in Tunisia.
 # We have a wrap-up about this on the following page:
-# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# https://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
 
 # From Alexander Krivenyshev (2009-03-17):
 # Here is a link to Tunis Afrique Presse News Agency
index 3332d66..d9c132a 100644 (file)
@@ -26,7 +26,7 @@
 # Heard Island, McDonald Islands (uninhabited)
 #      previously sealers and scientific personnel wintered
 #      Margaret Turner reports
-#      http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
+#      https://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
 #      (1999-09-30) that they're UT +05, with no DST;
 #      presumably this is when they have visitors.
 #
@@ -47,7 +47,7 @@
 # http://www.aad.gov.au/default.asp?casid=37079
 #
 # We have more background information here:
-# http://www.timeanddate.com/news/time/antarctica-new-times.html
+# https://www.timeanddate.com/news/time/antarctica-new-times.html
 
 # From Steffen Thorsen (2010-03-10):
 # We got these changes from the Australian Antarctic Division: ...
@@ -62,7 +62,7 @@
 # - Mawson station stays on UTC+5.
 #
 # Background:
-# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
+# https://www.timeanddate.com/news/time/antartica-time-changes-2010.html
 
 # From Steffen Thorsen (2016-10-28):
 # Australian Antarctica Division informed us that Casey changed time
@@ -145,7 +145,7 @@ Zone Indian/Kerguelen       0       -       -00     1950 # Port-aux-Français
 #
 # year-round base in the main continent
 # Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
-# <http://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
+# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
 #
 # Another base at Port-Martin, 50km east, began operation in 1947.
 # It was destroyed by fire on 1952-01-14.
index 85ebf88..a55f785 100644 (file)
--- a/asctime.c
+++ b/asctime.c
@@ -12,6 +12,7 @@
 /*LINTLIBRARY*/
 
 #include "private.h"
+#include <stdio.h>
 
 /*
 ** Some systems only handle "%.2d"; others only handle "%02d";
@@ -32,9 +33,9 @@
 ** but many implementations pad anyway; most likely the standards are buggy.
 */
 #ifdef __GNUC__
-#define ASCTIME_FMT    "%.3s %.3s%3d %2.2d:%2.2d:%2.2d %-4s\n"
+#define ASCTIME_FMT    "%s %s%3d %2.2d:%2.2d:%2.2d %-4s\n"
 #else /* !defined __GNUC__ */
-#define ASCTIME_FMT    "%.3s %.3s%3d %02.2d:%02.2d:%02.2d %-4s\n"
+#define ASCTIME_FMT    "%s %s%3d %02.2d:%02.2d:%02.2d %-4s\n"
 #endif /* !defined __GNUC__ */
 /*
 ** For years that are more than four digits we put extra spaces before the year
@@ -43,9 +44,9 @@
 ** that no output is better than wrong output).
 */
 #ifdef __GNUC__
-#define ASCTIME_FMT_B  "%.3s %.3s%3d %2.2d:%2.2d:%2.2d     %s\n"
+#define ASCTIME_FMT_B  "%s %s%3d %2.2d:%2.2d:%2.2d     %s\n"
 #else /* !defined __GNUC__ */
-#define ASCTIME_FMT_B  "%.3s %.3s%3d %02.2d:%02.2d:%02.2d     %s\n"
+#define ASCTIME_FMT_B  "%s %s%3d %02.2d:%02.2d:%02.2d     %s\n"
 #endif /* !defined __GNUC__ */
 
 #define STD_ASCTIME_BUF_SIZE   26
@@ -70,10 +71,10 @@ static char buf_asctime[MAX_ASCTIME_BUF_SIZE];
 char *
 asctime_r(register const struct tm *timeptr, char *buf)
 {
-       static const char       wday_name[][3] = {
+       static const char       wday_name[][4] = {
                "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
        };
-       static const char       mon_name[][3] = {
+       static const char       mon_name[][4] = {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun",
                "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
        };
diff --git a/asia b/asia
index 35774c6..ac39af3 100644 (file)
--- a/asia
+++ b/asia
@@ -26,7 +26,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # For Russian data circa 1919, a source is:
 # Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
@@ -75,8 +75,8 @@ Rule E-EurAsia        1996    max     -       Oct     lastSun  0:00   0       -
 Rule RussiaAsia        1981    1984    -       Apr     1        0:00   1:00    S
 Rule RussiaAsia        1981    1983    -       Oct     1        0:00   0       -
 Rule RussiaAsia        1984    1995    -       Sep     lastSun  2:00s  0       -
-Rule RussiaAsia        1985    2011    -       Mar     lastSun  2:00s  1:00    S
-Rule RussiaAsia        1996    2011    -       Oct     lastSun  2:00s  0       -
+Rule RussiaAsia        1985    2010    -       Mar     lastSun  2:00s  1:00    S
+Rule RussiaAsia        1996    2010    -       Oct     lastSun  2:00s  0       -
 
 # Afghanistan
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
@@ -109,13 +109,17 @@ Zone      Asia/Kabul      4:36:48 -       LMT     1890
 # or
 # (brief)
 # http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule Armenia   2011    only    -       Mar     lastSun  2:00s  1:00    S
+Rule Armenia   2011    only    -       Oct     lastSun  2:00s  0       -
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Yerevan    2:58:00 -       LMT     1924 May  2
                        3:00    -       +03     1957 Mar
                        4:00 RussiaAsia +04/+05 1991 Mar 31  2:00s
                        3:00 RussiaAsia +03/+04 1995 Sep 24  2:00s
                        4:00    -       +04     1997
-                       4:00 RussiaAsia +04/+05
+                       4:00 RussiaAsia +04/+05 2011
+                       4:00    Armenia +04/+05
 
 # Azerbaijan
 
@@ -127,7 +131,7 @@ Zone        Asia/Yerevan    2:58:00 -       LMT     1924 May  2
 # From Steffen Thorsen (2016-03-17):
 # ... the Azerbaijani Cabinet of Ministers has cancelled switching to
 # daylight saving time....
-# http://www.azernews.az/azerbaijan/94137.html
+# https://www.azernews.az/azerbaijan/94137.html
 # http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
 # http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
 
@@ -168,11 +172,11 @@ Zone      Asia/Baku       3:19:24 -       LMT     1924 May  2
 # the 19th and 20th, and they have not set the end date yet.
 #
 # Some sources:
-# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
+# https://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
 # http://bdnews24.com/details.php?id=85889&cid=2
 #
 # Our wrap-up:
-# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
+# https://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
 
 # From A. N. M. Kamrus Saadat (2009-06-15):
 # Finally we've got the official mail regarding DST start time where DST start
@@ -258,9 +262,15 @@ Zone       Asia/Brunei     7:39:40 -       LMT     1926 Mar # Bandar Seri Begawan
 
 # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
 
+# From Paul Eggert (2017-04-20):
+# Page 27 of Reed & Low (cited for Asia/Kolkata) says "Rangoon local time is
+# used upon the railways and telegraphs of Burma, and is 6h. 24m. 47s. ahead
+# of Greenwich."  This refers to the period before Burma's transition to +0630,
+# a transition for which Shanks is the only source.
+
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Asia/Yangon     6:24:40 -       LMT     1880        # or Rangoon
-                       6:24:40 -       RMT     1920        # Rangoon Mean Time?
+Zone   Asia/Yangon     6:24:47 -       LMT     1880        # or Rangoon
+                       6:24:47 -       RMT     1920        # Rangoon local time
                        6:30    -       +0630   1942 May
                        9:00    -       +09     1945 May  3
                        6:30    -       +0630
@@ -317,7 +327,7 @@ Rule        PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
 #
 # From Jesper Nørgaard Welen (2006-07-14):
 # I have investigated the timezones around 1970 on the
-# http://www.astro.com/atlas site [with provinces and county
+# https://www.astro.com/atlas site [with provinces and county
 # boundaries summarized below]....  A few other exceptions were two
 # counties on the Sichuan side of the Xizang-Sichuan border,
 # counties Dege and Baiyu which lies on the Sichuan side and are
@@ -469,7 +479,7 @@ Rule        PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
 
 # From David Cochrane (2014-03-26):
 # Just a confirmation that Ürümqi time was implemented in Ürümqi on 1 Feb 1986:
-# http://content.time.com/time/magazine/article/0,9171,960684,00.html
+# https://content.time.com/time/magazine/article/0,9171,960684,00.html
 
 # From Luther Ma (2014-04-22):
 # I have interviewed numerous people of various nationalities and from
@@ -626,7 +636,7 @@ Zone        Asia/Hong_Kong  7:36:42 -       LMT     1904 Oct 30
 # (both in Okinawa) adopt the Western Standard Time which is based on
 # 120E. The adoption began from Jan 1, 1896. The original text can be
 # found on Wikisource:
-# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
+# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
 # ... This could be the first adoption of time zone in Taiwan, because
 # during the Qing Dynasty, it seems that there was no time zone
 # declared officially.
@@ -639,7 +649,7 @@ Zone        Asia/Hong_Kong  7:36:42 -       LMT     1904 Oct 30
 # territory, including later occupations, adopt Japan Central Time
 # (UTC+9). The adoption began on Oct 1, 1937. The original text can
 # be found on Wikisource:
-# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
+# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
 #
 # That is, the time zone of Taipei switched to UTC+9 on Oct 1, 1937.
 
@@ -775,6 +785,12 @@ Zone       Asia/Macau      7:34:20 -       LMT     1912 Jan  1
 # Looks like the time zone split in Cyprus went through last night.
 # http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
 
+# From Paul Eggert (2017-10-18):
+# Northern Cyprus will reinstate winter time on October 29, thus
+# staying in sync with the rest of Cyprus.  See: Anastasiou A.
+# Cyprus to remain united in time.  Cyprus Mail 2017-10-17.
+# https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Cyprus  1975    only    -       Apr     13      0:00    1:00    S
 Rule   Cyprus  1975    only    -       Oct     12      0:00    0       -
@@ -792,7 +808,8 @@ Zone        Asia/Nicosia    2:13:28 -       LMT     1921 Nov 14
 Zone   Asia/Famagusta  2:15:48 -       LMT     1921 Nov 14
                        2:00    Cyprus  EE%sT   1998 Sep
                        2:00    EUAsia  EE%sT   2016 Sep  8
-                       3:00    -       +03
+                       3:00    -       +03     2017 Oct 29 1:00u
+                       2:00    EUAsia  EE%sT
 
 # Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
 # However, for various reasons many users expect to find it under Europe.
@@ -852,7 +869,7 @@ Zone        Asia/Tbilisi    2:59:11 -       LMT     1880
 
 # From João Carrascalão, brother of the former governor of East Timor, in
 # East Timor may be late for its millennium
-# <http://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
+# <https://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
 # Portugal tried to change the time forward in 1974 because the sun
 # rises too early but the suggestion raised a lot of problems with the
 # Timorese and I still don't think it would work today because it
@@ -880,21 +897,62 @@ Zone      Asia/Dili       8:22:20 -       LMT     1912 Jan  1
 # India
 
 # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic
-# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
+# https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
 # (2015-12-22):
 # In January 1906, several thousand cotton-mill workers rioted on the
 # outskirts of Bombay....  They were protesting the proposed abolition of
 # local time in favor of Indian Standard Time....  Journalists called this
 # dispute the "Battle of the Clocks."  It lasted nearly half a century.
 
+# From Paul Eggert (2017-04-20):
+# Good luck trying to nail down old timekeeping records in India.
+# "... in the nineteenth century ... Madras Observatory took its magnetic
+# measurements on Göttingen time, its meteorological measurements on Madras
+# (local) time, dropped its time ball on Greenwich (ocean navigator's) time,
+# and distributed civil (local time)." -- Bartky IR. Selling the true time:
+# 19th-century timekeeping in america. Stanford U Press (2000), 247 note 19.
+# "A more potent cause of resistance to the general adoption of the present
+# standard time lies in the fact that it is Madras time.  The citizen of
+# Bombay, proud of being 'primus in Indis' and of Calcutta, equally proud of
+# his city being the Capital of India, and - for a part of the year - the Seat
+# of the Supreme Government, alike look down on Madras, and refuse to change
+# the time they are using, for that of what they regard as a benighted
+# Presidency; while Madras, having for long given the standard time to the
+# rest of India, would resist the adoption of any other Indian standard in its
+# place." -- Oldham RD. On Time in India: a suggestion for its improvement.
+# Proceedings of the Asiatic Society of Bengal (April 1899), 49-55.
+#
+# "In 1870 ... Madras time - 'now used by the telegraph and regulated from the
+# only government observatory' - was suggested as a standard railway time,
+# first to be adopted on the Great Indian Peninsular Railway (GIPR)....
+# Calcutta, Bombay, and Karachi, were to be allowed to continue with their
+# local time for civil purposes." - Prasad R. Tracks of Change: Railways and
+# Everyday Life in Colonial India. Cambridge University Press (2016), 145.
+#
+# Reed S, Low F. The Indian Year Book 1936-37. Bennett, Coleman, pp 27-8.
+# https://archive.org/details/in.ernet.dli.2015.282212
+# This lists +052110 as Madras local time used in railways, and says that on
+# 1906-01-01 railways and telegraphs in India switched to +0530.  Some
+# municipalities retained their former time, and the time in Calcutta
+# continued to depend on whether you were at the railway station or at
+# government offices.  Government time was at +055320 (according to Shanks) or
+# at +0554 (according to the Indian Year Book).  Railway time is more
+# appropriate for our purposes, as it was better documented, it is what we do
+# elsewhere (e.g., Europe/London before 1880), and after 1906 it was
+# consistent in the region now identified by Asia/Kolkata.  So, use railway
+# time for 1870-1941.  Shanks is our only (and dubious) source for the
+# 1941-1945 data.
+
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Asia/Kolkata    5:53:28 -       LMT     1880        # Kolkata
-                       5:53:20 -       HMT     1941 Oct    # Howrah Mean Time?
-                       6:30    -       +0630   1942 May 15
+Zone   Asia/Kolkata    5:53:28 -       LMT     1854 Jun 28 # Kolkata
+                       5:53:20 -       HMT     1870        # Howrah Mean Time?
+                       5:21:10 -       MMT     1906 Jan  1 # Madras local time
+                       5:30    -       IST     1941 Oct
+                       5:30    1:00    +0630   1942 May 15
                        5:30    -       IST     1942 Sep
                        5:30    1:00    +0630   1945 Oct 15
                        5:30    -       IST
-# The following are like Asia/Kolkata:
+# Since 1970 the following are like Asia/Kolkata:
 #      Andaman Is
 #      Lakshadweep (Laccadive, Minicoy and Amindivi Is)
 #      Nicobar Is
@@ -1036,7 +1094,7 @@ Zone Asia/Jayapura        9:22:48 -       LMT     1932 Nov
 # From Reuters (2007-09-16), with a heads-up from Jesper Nørgaard Welen:
 # ... the Guardian Council ... approved a law on Sunday to re-introduce
 # daylight saving time ...
-# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
+# https://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
 #
 # From Roozbeh Pournader (2007-11-05):
 # This is quoted from Official Gazette of the Islamic Republic of
@@ -1135,7 +1193,7 @@ Zone      Asia/Tehran     3:25:44 -       LMT     1916
 # http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
 #
 # We have published a short article in English about the change:
-# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
+# https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
 
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Iraq    1982    only    -       May     1       0:00    1:00    D
@@ -1443,12 +1501,12 @@ Rule    Japan   1950    1951    -       May     Sun>=1  2:00    1:00    D
 # From Yu-Cheng Chuang (2013-07-12):
 # ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause
 # about standard time" ... The adoption began from Jan 1, 1896.
-# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
+# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
 #
 # ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which
 # means the whole Japan territory, including later occupations, adopt Japan
 # Central Time (UTC+9). The adoption began on Oct 1, 1937.
-# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
+# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
 
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Tokyo      9:18:59 -       LMT     1887 Dec 31 15:00u
@@ -1510,7 +1568,7 @@ Zone      Asia/Tokyo      9:18:59 -       LMT     1887 Dec 31 15:00u
 # Official, in Arabic:
 # http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
 # ... Our background/permalink about it
-# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
+# https://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
 # ...
 # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
 # ... says midnight for the coming one and 1:00 for the ones in the future
@@ -1868,9 +1926,9 @@ Zone      Asia/Bishkek    4:58:24 -       LMT     1924 May  2
 # between 1987 and 1988 ...
 
 # From Sanghyuk Jung (2014-10-29):
-# http://mm.icann.org/pipermail/tz/2014-October/021830.html
+# https://mm.icann.org/pipermail/tz/2014-October/021830.html
 # According to the Korean Wikipedia
-# http://ko.wikipedia.org/wiki/한국_표준시
+# https://ko.wikipedia.org/wiki/한국_표준시
 # [oldid=12896437 2014-09-04 08:03 UTC]
 # DST in Republic of Korea was as follows....  And I checked old
 # newspapers in Korean, all articles correspond with data in Wikipedia.
@@ -2092,7 +2150,7 @@ Zone      Indian/Maldives 4:54:00 -       LMT     1880 # Male
 # +08:00 instead. Different sources appear to disagree with the tz
 # database on this, e.g.:
 #
-# http://www.timeanddate.com/worldclock/city.html?n=1026
+# https://www.timeanddate.com/worldclock/city.html?n=1026
 # http://www.worldtimeserver.com/current_time_in_MN.aspx
 #
 # both say GMT+08:00.
@@ -2222,7 +2280,7 @@ Zone      Asia/Kathmandu  5:41:16 -       LMT     1920
 # help reduce load shedding by approving the closure of commercial centres at
 # 9pm and moving clocks forward by one hour for the next three months. ...."
 #
-# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan01.html
 # http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
 
 # From Arthur David Olson (2008-05-19):
@@ -2288,7 +2346,7 @@ Zone      Asia/Kathmandu  5:41:16 -       LMT     1920
 #
 # We have confirmed this year's end date with both with the Ministry of
 # Water and Power and the Pakistan Electric Power Company:
-# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
+# https://www.timeanddate.com/news/time/pakistan-ends-dst09.html
 
 # From Christoph Göhre (2009-10-01):
 # [T]he German Consulate General in Karachi reported me today that Pakistan
@@ -2470,7 +2528,7 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 #
 # We are not sure if Gaza will do the same, last year they had a different
 # end date, we will keep this page updated:
-# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# https://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
 
 # From Alexander Krivenyshev (2009-09-02):
 # Seems that Gaza Strip will go back to Winter Time same date as West Bank.
@@ -2508,7 +2566,7 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 # the clocks were set back one hour at 2010-08-11 00:00:00 local time in
 # Gaza and the West Bank.
 # Some more background info:
-# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# https://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
 
 # From Steffen Thorsen (2011-08-26):
 # Gaza and the West Bank did go back to standard time in the beginning of
@@ -2518,7 +2576,7 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 #
 # http://www.maannews.net/eng/ViewDetails.aspx?ID=416217
 # Additional info:
-# http://www.timeanddate.com/news/time/palestine-dst-2011.html
+# https://www.timeanddate.com/news/time/palestine-dst-2011.html
 
 # From Alexander Krivenyshev (2011-08-27):
 # According to the article in The Jerusalem Post:
@@ -2528,7 +2586,7 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 # The Hamas government said on Saturday that it won't observe summertime after
 # the Muslim feast of Id al-Fitr, which begins on Tuesday..."
 # ...
-# http://www.jpost.com/MiddleEast/Article.aspx?id=235650
+# https://www.jpost.com/MiddleEast/Article.aspx?id=235650
 # http://www.worldtimezone.com/dst_news/dst_news_gazastrip05.html
 # The rules for Egypt are stolen from the 'africa' file.
 
@@ -2549,7 +2607,7 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 # http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
 #
 # Our brief summary:
-# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
+# https://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
 
 # From Steffen Thorsen (2013-03-26):
 # The following news sources tells that Palestine will "start daylight saving
@@ -2569,11 +2627,11 @@ Zone    Asia/Karachi    4:28:12 -       LMT     1907
 
 # From Steffen Thorsen (2015-03-03):
 # Sources such as http://www.alquds.com/news/article/view/id/548257
-# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
+# and https://www.raya.ps/ar/news/890705.html say Palestine areas will
 # start DST on 2015-03-28 00:00 which is one day later than expected.
 #
 # From Paul Eggert (2015-03-03):
-# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
+# https://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
 # says that the fall 2014 transition was Oct 23 at 24:00.
 
 # From Hannah Kreitem (2016-03-09):
@@ -2597,8 +2655,8 @@ Zone      Asia/Karachi    4:28:12 -       LMT     1907
 #
 # From Paul Eggert (2016-10-19):
 # It's also consistent with predictions in the following URLs today:
-# http://www.timeanddate.com/time/change/gaza-strip/gaza
-# http://www.timeanddate.com/time/change/west-bank/hebron
+# https://www.timeanddate.com/time/change/gaza-strip/gaza
+# https://www.timeanddate.com/time/change/west-bank/hebron
 
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule EgyptAsia 1957    only    -       May     10      0:00    1:00    S
@@ -2661,7 +2719,7 @@ Zone      Asia/Hebron     2:20:23 -       LMT     1900 Oct
 # Philippines, issued a proclamation announcing that 1844-12-30 was to
 # be immediately followed by 1845-01-01; see R.H. van Gent's
 # History of the International Date Line
-# http://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
+# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
 # The rest of the data entries are from Shanks & Pottenger.
 
 # From Jesper Nørgaard Welen (2006-04-26):
@@ -2925,7 +2983,7 @@ Rule      Syria   2007    only    -       Nov      Fri>=1 0:00    0       -
 # We have not found any sources saying anything about when DST ends this year.
 #
 # Our summary
-# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# https://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
 
 # From Steffen Thorsen (2009-10-27):
 # The Syrian Arab News Network on 2009-09-29 reported that Syria will
@@ -2952,7 +3010,7 @@ Rule      Syria   2007    only    -       Nov      Fri>=1 0:00    0       -
 # http://www.sana.sy/ara/2/2012/03/26/408215.htm
 #
 # Our brief summary:
-# http://www.timeanddate.com/news/time/syria-dst-2012.html
+# https://www.timeanddate.com/news/time/syria-dst-2012.html
 
 # From Arthur David Olson (2012-03-27):
 # Assume last Friday in March going forward XXX.
@@ -3035,7 +3093,7 @@ Zone      Asia/Tashkent   4:37:11 -       LMT     1924 May  2
 # is quoted verbatim in:
 # http://www.thoigian.com.vn/?mPage=P80D01
 # is translated by Brian Inglis in:
-# http://mm.icann.org/pipermail/tz/2014-October/021654.html
+# https://mm.icann.org/pipermail/tz/2014-October/021654.html
 # and is the basis for the information below.
 #
 # The 1906 transition was effective July 1 and standardized Indochina to
index d389ae1..5f7c86d 100644 (file)
@@ -293,7 +293,7 @@ Zone        Indian/Cocos    6:27:40 -       LMT     1900
 # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
 #
 # A bit more background info here:
-# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
+# https://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
 
 # From Alexander Krivenyshev (2010-10-24):
 # According to Radio Fiji and Fiji Times online, Fiji will end DST 3
@@ -357,9 +357,12 @@ Zone       Indian/Cocos    6:27:40 -       LMT     1900
 # clocks go forward an hour at 2am to 3am....  Daylight Saving will
 # end at 3.00am on Sunday 15th January 2017."
 
-# From Paul Eggert (2016-10-03):
-# For now, guess DST from 02:00 the first Sunday in November to
-# 03:00 the third Sunday in January.  Although ad hoc, it matches
+# From Paul Eggert (2017-08-21):
+# 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.
+# 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
 # transitions since late 2014 and seems more likely to match future
 # practice than guessing no DST.
 
@@ -373,7 +376,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    S
-Rule   Fiji    2015    max     -       Jan     Sun>=15 3:00    0       -
+Rule   Fiji    2015    max     -       Jan     Sun>=14 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
@@ -557,7 +560,7 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT     1880
 # The World War II entries below are instead based on Arawa-Kieta.
 # The Japanese occupied Kieta in July 1942,
 # according to the Pacific War Online Encyclopedia
-# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
+# https://pwencycl.kgbudge.com/B/o/Bougainville.htm
 # and seem to have controlled it until their 1945-08-21 surrender.
 #
 # The Autonomous Region of Bougainville switched from UT +10 to +11
@@ -579,7 +582,7 @@ Zone Pacific/Pitcairn       -8:40:20 -      LMT     1901        # Adamstown
                        -8:00   -       -08
 
 # American Samoa
-Zone Pacific/Pago_Pago  12:37:12 -     LMT     1879 Jul  5
+Zone Pacific/Pago_Pago  12:37:12 -     LMT     1892 Jul  5
                        -11:22:48 -     LMT     1911
                        -11:00  -       SST                 # S=Samoa
 Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
@@ -595,7 +598,7 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
 # Sunday of April 2011."
 #
 # Background info:
-# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# https://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
 #
 # Samoa's Daylight Saving Time Act 2009 is available here, but does not
 # contain any dates:
@@ -659,7 +662,7 @@ Rule        WS      2011    only    -       Sep     lastSat 3:00    1       D
 Rule   WS      2012    max     -       Apr     Sun>=1  4:00    0       S
 Rule   WS      2012    max     -       Sep     lastSun 3:00    1       D
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-Zone Pacific/Apia       12:33:04 -     LMT     1879 Jul  5
+Zone Pacific/Apia       12:33:04 -     LMT     1892 Jul  5
                        -11:26:56 -     LMT     1911
                        -11:30  -       -1130   1950
                        -11:00  WS      -11/-10 2011 Dec 29 24:00
@@ -686,7 +689,7 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT     1912 Oct # Honiara
 # From Paul Eggert (2012-07-25)
 # A Google Books snippet of Appendix to the Journals of the House of
 # Representatives of New Zealand, Session 1948,
-# <http://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
+# <https://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
 # was "11 hours slow on G.M.T."  Go with Thorsen and assume Shanks & Pottenger
 # are off by an hour starting in 1901.
 
@@ -701,8 +704,8 @@ Rule        Tonga   1999    only    -       Oct      7      2:00s   1:00    S
 Rule   Tonga   2000    only    -       Mar     19      2:00s   0       -
 Rule   Tonga   2000    2001    -       Nov     Sun>=1  2:00    1:00    S
 Rule   Tonga   2001    2002    -       Jan     lastSun 2:00    0       -
-Rule   Tonga   2016    max     -       Nov     Sun>=1  2:00    1:00    S
-Rule   Tonga   2017    max     -       Jan     Sun>=15 3:00    0       -
+Rule   Tonga   2016    only    -       Nov     Sun>=1  2:00    1:00    S
+Rule   Tonga   2017    only    -       Jan     Sun>=15 3:00    0       -
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone Pacific/Tongatapu 12:19:20 -      LMT     1901
                        12:20   -       +1220   1941
@@ -756,7 +759,7 @@ Zone Pacific/Funafuti       11:56:52 -      LMT     1901
 # Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
 # "The United States High-Altitude Test Experience: A Review Emphasizing the
 # Impact on the Environment", Los Alamos LA-6405, Oct 1976.
-# http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
+# https://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
 # See the table on page 4 where he lists GMT and local times for the tests; a
 # footnote for the JI tests reads that local time is "JI time = Hawaii Time
 # Minus One Hour".
@@ -822,7 +825,7 @@ Zone        Pacific/Wallis  12:15:20 -      LMT     1901
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@@ -969,7 +972,7 @@ Zone        Pacific/Wallis  12:15:20 -      LMT     1901
 #   AEST ACST AWST AEDT ACDT
 #
 #   Parliamentary Library (2008-11-10)
-#   http://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
+#   https://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
 #   EST CST WST preferred for standard time; AEST AEDT ACST ACDT also used
 #
 #   The Transport Safety Bureau has an extensive series of accident reports,
@@ -1005,13 +1008,13 @@ Zone    Pacific/Wallis  12:15:20 -      LMT     1901
 #
 # NSW (including LHI and Broken Hill):
 # Standard Time Act 1987 (updated 1995-04-04)
-# http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
+# https://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
 # ACT
 # Standard Time and Summer Time Act 1972
-# http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
+# https://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
 # SA
 # Standard Time Act, 1898
-# http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
+# https://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
 
 # From David Grosz (2005-06-13):
 # It was announced last week that Daylight Saving would be extended by
@@ -1306,7 +1309,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm
 # (1999-07-22).  For now, we'll wait to see if this really happens.
 #
-# Victoria will following NSW.  See:
+# Victoria will follow NSW.  See:
 # Vic to extend daylight saving (1999-07-28)
 # http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm
 #
@@ -1409,7 +1412,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # the ACT for all 52 weeks of the year...
 #
 # We have a wrap-up here:
-# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
+# https://www.timeanddate.com/news/time/south-australia-extends-dst.html
 ###############################################################################
 
 # New Zealand
@@ -1463,7 +1466,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # From Paul Eggert (2014-07-14):
 # Chatham Island time was formally standardized on 1957-01-01 by
 # New Zealand's Standard Time Amendment Act 1956 (1956-10-26).
-# http://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
+# https://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
 # According to Google Books snippet view, a speaker in the New Zealand
 # parliamentary debates in 1956 said "Clause 78 makes provision for standard
 # time in the Chatham Islands.  The time there is 45 minutes in advance of New
@@ -1578,7 +1581,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # the Norfolk Island Museum and the Australian Bureau of Meteorology's
 # Norfolk Island station, and found no record of Norfolk observing DST
 # other than in 1974/5.  See:
-# http://www.timeanddate.com/time/australia/norfolk-island.html
+# https://www.timeanddate.com/time/australia/norfolk-island.html
 
 # Pitcairn
 
@@ -1606,11 +1609,13 @@ Zone    Pacific/Wallis  12:15:20 -      LMT     1901
 
 # (Western) Samoa and American Samoa
 
-# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
-# that in 1879 the King of Samoa decided to change
+# Howse writes (p 153) that after the 1879 standardization on Antipodean
+# time by the British governor of Fiji, the King of Samoa decided to change
 # "the date in his kingdom from the Antipodean to the American system,
 # ordaining - by a masterpiece of diplomatic flattery - that
 # the Fourth of July should be celebrated twice in that year."
+# This happened in 1892, according to the Evening News (Sydney) of 1892-07-20.
+# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm
 
 # Although Shanks & Pottenger says they both switched to UT -11:30
 # in 1911, and to -11 in 1950. many earlier sources give -11
@@ -1621,6 +1626,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # day in 2011.  Assume also that the Samoas follow the US and New
 # Zealand's "ST"/"DT" style of daylight-saving abbreviations.
 
+
 # Tonga
 
 # From Paul Eggert (1996-01-22):
@@ -1715,6 +1721,15 @@ Zone     Pacific/Wallis  12:15:20 -      LMT     1901
 # Assume Tonga will observe DST from the first Sunday in November at 02:00
 # through the third Sunday in January at 03:00, like Fiji, for now.
 
+# From David Wade (2017-10-18):
+# In August government was disolved by the King.  The current prime minister
+# continued in office in care taker mode.  It is easy to see that few
+# decisions will be made until elections 16th November.
+#
+# From Paul Eggert (2017-10-18):
+# For now, guess that DST is discontinued.  That's what the IATA is guessing.
+
+
 # Wake
 
 # From Vernice Anderson, Personal Secretary to Philip Jessup,
@@ -1727,7 +1742,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # making calculation of time in Washington difficult if not almost
 # impossible.
 #
-# http://www.trumanlibrary.org/wake/meeting.htm
+# https://www.trumanlibrary.org/oralhist/andrsonv.htm
 
 # From Paul Eggert (2003-03-23):
 # We have no other report of DST in Wake Island, so omit this info for now.
@@ -1755,7 +1770,7 @@ Zone      Pacific/Wallis  12:15:20 -      LMT     1901
 # an international standard, there are some places on the high seas where the
 # correct date is ambiguous.
 
-# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
+# From Wikipedia <https://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
 # Before 1920, all ships kept local apparent time on the high seas by setting
 # their clocks at night or at the morning sight so that, given the ship's
 # speed and direction, it would be 12 o'clock when the Sun crossed the ship's
index 09f2a31..2141f0d 100644 (file)
--- a/backward
+++ b/backward
@@ -61,7 +61,9 @@ Link  America/Sao_Paulo       Brazil/East
 Link   America/Manaus          Brazil/West
 Link   America/Halifax         Canada/Atlantic
 Link   America/Winnipeg        Canada/Central
-Link   America/Regina          Canada/East-Saskatchewan
+# This line is commented out, as the name exceeded the 14-character limit
+# and was an unused misnomer.
+#Link  America/Regina          Canada/East-Saskatchewan
 Link   America/Toronto         Canada/Eastern
 Link   America/Edmonton        Canada/Mountain
 Link   America/St_Johns        Canada/Newfoundland
index 9ce7831..32bd0f1 100644 (file)
--- a/backzone
+++ b/backzone
@@ -181,7 +181,7 @@ Zone        Africa/Lome     0:04:52 -       LMT     1893
 # with the date that it took effect, namely 1912-01-01.
 #
 Zone   Africa/Luanda   0:52:56 -       LMT     1892
-                       0:52:04 -       +005204 1912 Jan  1
+                       0:52:04 -       LMT     1912 Jan  1 # Luanda Mean Time?
                        1:00    -       WAT
 
 # Democratic Republic of the Congo (east)
@@ -540,10 +540,10 @@ Zone      Europe/Belfast  -0:23:40 -      LMT     1880 Aug  2
 
 # Guernsey
 # Data from Joseph S. Myers
-# http://mm.icann.org/pipermail/tz/2013-September/019883.html
+# https://mm.icann.org/pipermail/tz/2013-September/019883.html
 # References to be added
-# LMT Location - 49.27N -2.33E - St.Peter Port
-Zone   Europe/Guernsey -0:09:19 -      LMT     1913 Jun 18
+# LMT is for Town Church, St. Peter Port, 49 degrees 27'17"N 2 degrees 32'10"W
+Zone   Europe/Guernsey -0:10:09 -      LMT     1913 Jun 18
                         0:00   GB-Eire %s      1940 Jul  2
                         1:00   C-Eur   CE%sT   1945 May  8
                         0:00   GB-Eire %s      1968 Oct 27
@@ -555,11 +555,11 @@ Zone      Europe/Guernsey -0:09:19 -      LMT     1913 Jun 18
 #
 # From Lester Caine (2013-09-04):
 # The Isle of Man legislation is now on-line at
-# <http://www.legislation.gov.im>, starting with the original Statutory
+# <https://www.legislation.gov.im>, starting with the original Statutory
 # Time Act in 1883 and including additional confirmation of some of
 # the dates of the 'Summer Time' orders originating at
 # Westminster.  There is a little uncertainty as to the starting date
-# of the first summer time in 1916 which may have be announced a
+# of the first summer time in 1916 which may have been announced a
 # couple of days late.  There is still a substantial number of
 # documents to work through, but it is thought that every GB change
 # was also implemented on the island.
@@ -574,10 +574,10 @@ Zone Europe/Isle_of_Man   -0:17:55 -      LMT     1883 Mar 30  0:00s
 
 # Jersey
 # Data from Joseph S. Myers
-# http://mm.icann.org/pipermail/tz/2013-September/019883.html
+# https://mm.icann.org/pipermail/tz/2013-September/019883.html
 # References to be added
-# LMT Location - 49.187N -2.107E - St. Helier
-Zone   Europe/Jersey   -0:08:25 -      LMT     1898 Jun 11 16:00u
+# LMT is for Parish Church, St. Helier, 49 degrees 11'0.57"N 2 degrees 6'24.33"W
+Zone   Europe/Jersey   -0:08:26 -      LMT     1898 Jun 11 16:00u
                         0:00   GB-Eire %s      1940 Jul  2
                         1:00   C-Eur   CE%sT   1945 May  8
                         0:00   GB-Eire %s      1968 Oct 27
diff --git a/calendars b/calendars
new file mode 100644 (file)
index 0000000..8bc7062
--- /dev/null
+++ b/calendars
@@ -0,0 +1,173 @@
+----- Calendrical issues -----
+
+As mentioned in Theory.html, although calendrical issues are out of
+scope for tzdb, they indicate the sort of problems that we would run
+into if we extended tzdb further into the past.  The following
+information and sources go beyond Theory.html's brief discussion.
+They sometimes disagree.
+
+
+France
+
+Gregorian calendar adopted 1582-12-20.
+French Revolutionary calendar used 1793-11-24 through 1805-12-31,
+and (in Paris only) 1871-05-06 through 1871-05-23.
+
+
+Russia
+
+From Chris Carrier (1996-12-02):
+On 1929-10-01 the Soviet Union instituted an "Eternal Calendar"
+with 30-day months plus 5 holidays, with a 5-day week.
+On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
+Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
+reverted to the 7-day week.  With the 6-day week the usual days
+off were the 6th, 12th, 18th, 24th and 30th of the month.
+(Source: Evitiar Zerubavel, _The Seven Day Circle_)
+
+
+Mark Brader reported a similar story in "The Book of Calendars", edited
+by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377.  But:
+
+From: Petteri Sulonen (via Usenet)
+Date: 14 Jan 1999 00:00:00 GMT
+...
+
+If your source is correct, how come documents between 1929 and 1940 were
+still dated using the conventional, Gregorian calendar?
+
+I can post a scan of a document dated December 1, 1934, signed by
+Yenukidze, the secretary, on behalf of Kalinin, the President of the
+Executive Committee of the Supreme Soviet, if you like.
+
+
+
+Sweden (and Finland)
+
+From: Mark Brader
+Subject: Re: Gregorian reform - a part of locale?
+<news:1996Jul6.012937.29190@sq.com>
+Date: 1996-07-06
+
+In 1700, Denmark made the transition from Julian to Gregorian.  Sweden
+decided to *start* a transition in 1700 as well, but rather than have one of
+those unsightly calendar gaps :-), they simply decreed that the next leap
+year after 1696 would be in 1744 - putting the whole country on a calendar
+different from both Julian and Gregorian for a period of 40 years.
+
+However, in 1704 something went wrong and the plan was not carried through;
+they did, after all, have a leap year that year.  And one in 1708.  In 1712
+they gave it up and went back to Julian, putting 30 days in February that
+year!...
+
+Then in 1753, Sweden made the transition to Gregorian in the usual manner,
+getting there only 13 years behind the original schedule.
+
+(A previous posting of this story was challenged, and Swedish readers
+produced the following references to support it: "Tideräkning och historia"
+by Natanael Beckman (1924) and "Tid, en bok om tideräkning och
+kalenderväsen" by Lars-Olof Lodén (1968).
+
+
+Grotefend's data
+
+From: "Michael Palmer" [with one obvious typo fixed]
+Subject: Re: Gregorian Calendar (was Re: Another FHC related question
+Newsgroups: soc.genealogy.german
+Date: Tue, 9 Feb 1999 02:32:48 -800
+...
+
+The following is a(n incomplete) listing, arranged chronologically, of
+European states, with the date they converted from the Julian to the
+Gregorian calendar:
+
+04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
+                 Catholics and Danzig only)
+09/20 Dec 1582 - France, Lorraine
+
+21 Dec 1582/
+   01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
+10/21 Feb 1583 - bishopric of Liege (Lüttich)
+13/24 Feb 1583 - bishopric of Augsburg
+04/15 Oct 1583 - electorate of Trier
+05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
+                 Salzburg, Brixen
+13/24 Oct 1583 - Austrian Oberelsaß and Breisgau
+20/31 Oct 1583 - bishopric of Basel
+02/13 Nov 1583 - duchy of Jülich-Berg
+02/13 Nov 1583 - electorate and city of Köln
+04/15 Nov 1583 - bishopric of Würzburg
+11/22 Nov 1583 - electorate of Mainz
+16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
+17/28 Nov 1583 - bishopric of Münster and duchy of Cleve
+14/25 Dec 1583 - Steiermark
+
+06/17 Jan 1584 - Austria and Bohemia
+11/22 Jan 1584 - Lucerne, Uri, Schwyz, Zug, Freiburg, Solothurn
+12/23 Jan 1584 - Silesia and the Lausitz
+22 Jan/
+   02 Feb 1584 - Hungary (legally on 21 Oct 1587)
+      Jun 1584 - Unterwalden
+01/12 Jul 1584 - duchy of Westfalen
+
+16/27 Jun 1585 - bishopric of Paderborn
+
+14/25 Dec 1590 - Transylvania
+
+22 Aug/
+   02 Sep 1612 - duchy of Prussia
+
+13/24 Dec 1614 - Pfalz-Neuburg
+
+          1617 - duchy of Kurland (reverted to the Julian calendar in
+                 1796)
+
+          1624 - bishopric of Osnabrück
+
+          1630 - bishopric of Minden
+
+15/26 Mar 1631 - bishopric of Hildesheim
+
+          1655 - Kanton Wallis
+
+05/16 Feb 1682 - city of Strassburg
+
+18 Feb/
+   01 Mar 1700 - Protestant Germany (including Swedish possessions in
+                 Germany), Denmark, Norway
+30 Jun/
+   12 Jul 1700 - Gelderland, Zutphen
+10 Nov/
+   12 Dec 1700 - Utrecht, Overijssel
+
+31 Dec 1700/
+   12 Jan 1701 - Friesland, Groningen, Zürich, Bern, Basel, Geneva,
+                 Turgau, and Schaffhausen
+
+          1724 - Glarus, Appenzell, and the city of St. Gallen
+
+01 Jan 1750    - Pisa and Florence
+
+02/14 Sep 1752 - Great Britain
+
+17 Feb/
+   01 Mar 1753 - Sweden
+
+1760-1812      - Graubünden
+
+The Russian empire (including Finland and the Baltic states) did not
+convert to the Gregorian calendar until the Soviet revolution of 1917.
+
+Source: H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
+Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
+(Hannover: Hahnsche Buchhandlung, 1941), pp. 26-28.
+
+-----
+
+This file is in the public domain, so clarified as of 2009-05-17 by
+Arthur David Olson.
+
+-----
+Local Variables:
+coding: utf-8
+End:
index 5b3e157..f309010 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
     Zone = "\n"
 }
 
-/^Zone/ {
+/^Z/ {
     if (defined[$2]) {
        if (defined[$2] == Zone) {
            printf "%s: Zone has duplicate definition\n", $2
@@ -21,7 +21,7 @@ BEGIN {
     defined[$2] = Zone
 }
 
-/^Link/ {
+/^L/ {
     if (defined[$3]) {
        if (defined[$3] == Zone) {
            printf "%s: Link with same name as Zone\n", $3
diff --git a/date.c b/date.c
index 866091f..2cc533f 100644 (file)
--- a/date.c
+++ b/date.c
@@ -29,6 +29,7 @@
 
 #include "private.h"
 #include <locale.h>
+#include <stdio.h>
 
 /*
 ** The two things date knows about time are. . .
 #define SECSPERMIN     60
 #endif /* !defined SECSPERMIN */
 
-extern char **         environ;
-
 #if !HAVE_POSIX_DECLS
 extern char *          optarg;
 extern int             optind;
-extern char *          tzname[];
 #endif
 
 static int             retval = EXIT_SUCCESS;
@@ -56,7 +54,7 @@ static void           display(const char *, time_t);
 static void            dogmt(void);
 static void            errensure(void);
 static void            timeout(FILE *, const char *, const struct tm *);
-static void            usage(void);
+static _Noreturn void  usage(void);
 
 int
 main(const int argc, char *argv[])
@@ -99,7 +97,7 @@ main(const int argc, char *argv[])
                        secs = strtoimax (optarg, &endarg, 0);
                        if (*endarg || optarg == endarg)
                                errno = EINVAL;
-                       else if (! (time_t_min <= secs && secs <= time_t_max))
+                       else if (! (TIME_T_MIN <= secs && secs <= TIME_T_MAX))
                                errno = ERANGE;
                        if (errno) {
                                perror(optarg);
index ba2fd03..856234a 100644 (file)
@@ -14,7 +14,7 @@ dminus(double x)
   return -x;
 }
 
-double ATTRIBUTE_CONST
+double
 difftime(time_t time1, time_t time0)
 {
        /*
diff --git a/europe b/europe
index 558b9f1..5b3b4e5 100644 (file)
--- a/europe
+++ b/europe
 #      [PDF] (1914-03)
 #
 #      Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-#      <http://www.jstor.org/stable/1774359>.  He writes:
+#      <https://www.jstor.org/stable/1774359>.  He writes:
 #      "It is requested that corrections and additions to these tables
 #      may be sent to Mr. John Milne, Royal Geographical Society,
 #      Savile Row, London."  Nowadays please email them to tz@iana.org.
 #
 #      Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
 #      This Russian-language source was consulted by Vladimir Karpinsky; see
-#      http://mm.icann.org/pipermail/tz/2014-August/021320.html
+#      https://mm.icann.org/pipermail/tz/2014-August/021320.html
 #      The full Russian citation is:
 #      Бялокоз, Евгений Людвигович. Новый счет времени в течении суток
 #      введенный декретом Совета народных комиссаров для всей России с 1-го
 # foundations of civilization throughout the world.
 #      -- "A Silent Toast to William Willett", Pictorial Weekly;
 #      republished in Finest Hour (Spring 2002) 1(114):26
-#      http://www.winstonchurchill.org/images/finesthour/Vol.01%20No.114.pdf
+#      https://www.winstonchurchill.org/publications/finest-hour/finest-hour-114/a-silent-toast-to-william-willett-by-winston-s-churchill
 
 # From Paul Eggert (2015-08-08):
 # The OED Supplement says that the English originally said "Daylight Saving"
 # official designation; the reply of the 21st was that there wasn't
 # but he couldn't think of anything better than the "Double British
 # Summer Time" that the BBC had been using informally.
-# http://www.polyomino.org.uk/british-time/bbc-19410418.png
-# http://www.polyomino.org.uk/british-time/ho-19410421.png
+# https://www.polyomino.org.uk/british-time/bbc-19410418.png
+# https://www.polyomino.org.uk/british-time/ho-19410421.png
 
 # From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
 # [N]o official designation has as far as I know been adopted for the time
 # the history of summer time legislation in the United Kingdom.
 # Since 1998 Joseph S. Myers has been updating
 # and extending this list, which can be found in
-# http://www.polyomino.org.uk/british-time/
+# https://www.polyomino.org.uk/british-time/
 
 # From Joseph S. Myers (1998-01-06):
 #
 # The legal time in the UK outside of summer time is definitely GMT, not UTC;
 # see Lord Tanlaw's speech
-# http://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
+# https://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
 # (Lords Hansard 11 June 1997 columns 964 to 976).
 
 # From Paul Eggert (2006-03-22):
 # Irish 'public feeling (was) outraged by forcing of English time on us'."
 # -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
 # Irish Times 2014-10-27.
-# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
+# https://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
 
 # From Joseph S. Myers (2005-01-26):
 # Irish laws are available online at <http://www.irishstatutebook.ie>.
 # Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
 # "Irish Summer Time", abbreviated to "IST".
 
+# Michael Deckers (2017-06-01) gave the following URLs for Ireland's
+# Summer Time Act, 1925 and Summer Time Orders, 1926 and 1947:
+# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print.html
+# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print.html
+# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print.html
+
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 # Summer Time Act, 1916
 Rule   GB-Eire 1916    only    -       May     21      2:00s   1:00    BST
@@ -472,14 +478,14 @@ Link      Europe/London   Europe/Isle_of_Man
 
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Europe/Dublin   -0:25:00 -      LMT     1880 Aug  2
-                       -0:25:21 -      DMT     1916 May 21  2:00 # Dublin MT
+                       -0:25:21 -      DMT     1916 May 21  2:00s # Dublin MT
                        -0:25:21 1:00   IST     1916 Oct  1  2:00s
                         0:00   GB-Eire %s      1921 Dec  6 # independence
-                        0:00   GB-Eire GMT/IST 1940 Feb 25  2:00
-                        0:00   1:00    IST     1946 Oct  6  2:00
-                        0:00   -       GMT     1947 Mar 16  2:00
-                        0:00   1:00    IST     1947 Nov  2  2:00
-                        0:00   -       GMT     1948 Apr 18  2:00
+                        0:00   GB-Eire GMT/IST 1940 Feb 25  2:00s
+                        0:00   1:00    IST     1946 Oct  6  2:00s
+                        0:00   -       GMT     1947 Mar 16  2:00s
+                        0:00   1:00    IST     1947 Nov  2  2:00s
+                        0:00   -       GMT     1948 Apr 18  2:00s
                         0:00   GB-Eire GMT/IST 1968 Oct 27
                         1:00   -       IST     1971 Oct 31  2:00u
                         0:00   GB-Eire GMT/IST 1996
@@ -625,7 +631,7 @@ Rule        Russia  1996    2010    -       Oct     lastSun  2:00s  0       -
 # Council of Ministers of the USSR from 1989-03-14 No. 227.
 #
 # I did not find full texts of these acts.  For the 1989 one we have
-# title at http://base.garant.ru/70754136/ :
+# title at https://base.garant.ru/70754136/ :
 # "About change in calculation of time on the territories of
 # Lithuanian SSR, Latvian SSR and Estonian SSR, Astrakhan,
 # Kaliningrad, Kirov, Kuybyshev, Ulyanovsk and Uralsk oblasts".
@@ -656,7 +662,7 @@ Rule        Russia  1996    2010    -       Oct     lastSun  2:00s  0       -
 # http://bmockbe.ru/events/?ID=7583
 #
 # Medvedev signed a law on the calculation of the time (in russian):
-# http://www.regnum.ru/news/polit/1413906.html
+# https://www.regnum.ru/news/polit/1413906.html
 
 # From Arthur David Olson (2011-06-15):
 # Take "abolishing daylight saving time" to mean that time is now considered
@@ -783,7 +789,7 @@ Zone        Europe/Vienna   1:05:21 -       LMT     1893 Apr
 # Sources (Russian language):
 # http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
 # http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
-# http://news.tut.by/society/250578.html
+# https://news.tut.by/society/250578.html
 #
 # From Alexander Bokovoy (2014-10-09):
 # Belarussian government decided against changing to winter time....
@@ -1104,7 +1110,7 @@ Zone America/Thule        -4:35:08 -      LMT     1916 Jul 28 # Pituffik air base
 # for their standard and summer times. He says no, they use "suveaeg"
 # (summer time) and "talveaeg" (winter time).
 
-# From The Baltic Times <http://www.baltictimes.com/> (1999-09-09)
+# From The Baltic Times <https://www.baltictimes.com/> (1999-09-09)
 # via Steffen Thorsen:
 # This year will mark the last time Estonia shifts to summer time,
 # a council of the ruling coalition announced Sept. 6....
@@ -1156,7 +1162,7 @@ Zone      Europe/Tallinn  1:39:00 -       LMT     1880
 # This is documented in Heikki Oja: Aikakirja 2007, published by The Almanac
 # Office of University of Helsinki, ISBN 952-10-3221-9, available online (in
 # Finnish) at
-# http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
+# https://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
 #
 # Page 105 (56 in PDF version) has a handy table of all past daylight savings
 # transitions. It is easy enough to interpret without Finnish skills.
@@ -1169,7 +1175,7 @@ Zone      Europe/Tallinn  1:39:00 -       LMT     1880
 
 # From Konstantin Hyppönen (2014-06-13):
 # [Heikki Oja's book Aikakirja 2013]
-# http://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
+# https://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
 # pages 104-105, including a scan from a newspaper published on Apr 2 1942
 # say that ... [o]n Apr 2 1942, 24 o'clock (which means Apr 3 1942,
 # 00:00), clocks were moved one hour forward. The newspaper
@@ -1299,7 +1305,7 @@ Zone      Europe/Paris    0:09:21 -       LMT     1891 Mar 15  0:01
 
 # From Jörg Schilling (2002-10-23):
 # In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
-# http://www.dhm.de/lemo/html/biografien/BersarinNikolai/
+# https://www.dhm.de/lemo/html/biografien/BersarinNikolai/
 # General [Nikolai] Bersarin.
 
 # From Paul Eggert (2003-03-08):
@@ -1524,7 +1530,7 @@ Zone Atlantic/Reykjavik   -1:28   -       LMT     1908
 # From Paul Eggert (2016-10-27):
 # Go with INRiM for DST rules, except as corrected by Inglis for 1944
 # for the Kingdom of Italy.  This is consistent with Renzo Baldini.
-# Model Rome's occupation by using using C-Eur rules from 1943-09-10
+# Model Rome's occupation by using C-Eur rules from 1943-09-10
 # to 1944-06-04; although Rome was an open city during this period, it
 # was effectively controlled by Germany.
 #
@@ -1839,14 +1845,14 @@ Zone    Europe/Malta    0:58:04 -       LMT     1893 Nov  2  0:00s # Valletta
 # Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
 # Tiraspol will go back to winter time on October 30, 2011.
 # News from Moldova (in russian):
-# http://ru.publika.md/link_317061.html
+# https://ru.publika.md/link_317061.html
 
 # From Roman Tudos (2015-07-02):
 # http://lex.justice.md/index.php?action=view&view=doc&lang=1&id=355077
 # From Paul Eggert (2015-07-01):
 # The abovementioned official link to IGO1445-868/2014 states that
 # 2014-10-26's fallback transition occurred at 03:00 local time.  Also,
-# http://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
+# https://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
 # says the 2014-03-30 spring-forward transition was at 02:00 local time.
 # Guess that since 1997 Moldova has switched one hour before the EU.
 
@@ -1918,7 +1924,7 @@ Zone      Europe/Monaco   0:29:32 -       LMT     1891 Mar 15
 # Amsterdam mean time.
 
 # The data entries before 1945 are taken from
-# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
+# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
 
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   Neth    1916    only    -       May      1      0:00    1:00    NST     # Netherlands Summer Time
@@ -1999,7 +2005,7 @@ Zone      Europe/Oslo     0:43:00 -       LMT     1895 Jan  1
 # so it must have diverged from Oslo time during the war, as Oslo was
 # keeping Berlin time.
 #
-# <http://home.no.net/janmayen/history.htm> says that the meteorologists
+# <https://www.jan-mayen.no/history.htm> says that the meteorologists
 # burned down their station in 1940 and left the island, but returned in
 # 1941 with a small Norwegian garrison and continued operations despite
 # frequent air attacks from Germans.  In 1943 the Americans established a
@@ -2037,7 +2043,7 @@ Rule      Poland  1945    only    -       Apr     29      0:00    1:00    S
 Rule   Poland  1945    only    -       Nov      1      0:00    0       -
 # For 1946 on the source is Kazimierz Borkowski,
 # Toruń Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
-# http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
+# https://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
 # Thanks to Przemysław Augustyniak (2005-05-28) for this reference.
 # He also gives these further references:
 # Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
@@ -2071,7 +2077,7 @@ Zone      Europe/Warsaw   1:24:00 -       LMT     1880
 #
 # From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
 # According to a Portuguese decree (1911-05-26)
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
 # Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
 # Round the old offset to -0:36:45.  This agrees with Willett but disagrees
 # with Shanks, who says the transition occurred on 1911-05-24 at 00:00 for
@@ -2253,7 +2259,7 @@ Zone Europe/Bucharest     1:44:24 -       LMT     1891 Oct
 # 2011 No. 725" and contains no other dates or "effective date" information.
 #
 # Another source is
-# http://www.rg.ru/2011/09/06/chas-zona-dok.html
+# https://rg.ru/2011/09/06/chas-zona-dok.html
 # which, according to translate.google.com, begins "Resolution of the
 # Government of the Russian Federation on August 31, 2011 N 725" and also
 # contains "Date first official publication: September 6, 2011 Posted on:
@@ -2261,7 +2267,7 @@ Zone Europe/Bucharest     1:44:24 -       LMT     1891 Oct
 # does not contain any "effective date" information.
 #
 # Another source is
-# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
+# https://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
 # which, in note 8, contains "Resolution No. 725 of August 31, 2011...
 # Effective as of after 7 days following the day of the official publication"
 # but which does not contain any reference to September 6, 2011.
@@ -2297,7 +2303,7 @@ Zone Europe/Bucharest     1:44:24 -       LMT     1891 Oct
 # http://itar-tass.com/obschestvo/1333711
 # http://www.pravo.gov.ru:8080/page.aspx?111660
 # http://www.kremlin.ru/acts/46279
-# From October 26, 2014 the new Russian time zone map will looks like this:
+# From October 26, 2014 the new Russian time zone map will look like this:
 # http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
 
 # From Paul Eggert (2006-03-22):
@@ -2344,7 +2350,7 @@ Zone Europe/Bucharest     1:44:24 -       LMT     1891 Oct
 # with maintenance only and represent our best guesses as to which regions
 # are covered by each zone.  They are not meant to be taken as an authoritative
 # listing.  The region codes listed come from
-# http://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
+# https://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
 # and are used for convenience only; no guarantees are made regarding their
 # future stability.  ISO 3166-2:RU codes are also listed for first-level
 # divisions where available.
@@ -2509,7 +2515,7 @@ Zone Europe/Kaliningrad    1:22:00 -      LMT     1893 Apr
 # http://www.kaliningradka.ru/site_pc/cherez/index.php?ELEMENT_ID=40091
 # says that Kaliningrad decided not to be an exception 2 days before the
 # 1991-03-31 switch and one person at
-# http://izhevsk.ru/forum_light_message/50/682597-m8369040.html
+# https://izhevsk.ru/forum_light_message/50/682597-m8369040.html
 # says he remembers that Samara opted out of the 1992-01-19 exception
 # 2 days before the switch.
 #
@@ -2581,7 +2587,7 @@ Zone Europe/Simferopol     2:16:24 -      LMT     1880
                         3:00   -       MSK     1997 Mar lastSun  1:00u
 # From Alexander Krivenyshev (2014-03-17):
 # time change at 2:00 (2am) on March 30, 2014
-# http://vz.ru/news/2014/3/17/677464.html
+# https://vz.ru/news/2014/3/17/677464.html
 # From Paul Eggert (2014-03-30):
 # Simferopol and Sevastopol reportedly changed their central town clocks
 # late the previous day, but this appears to have been ceremonial
@@ -2764,7 +2770,7 @@ Zone Asia/Omsk             4:53:30 -      LMT     1919 Nov 14
 # suggests that Altai Republic transitioned to Moscow+3 on
 # 1995-05-28.
 #
-# http://regnum.ru/news/society/1957270.html
+# https://regnum.ru/news/society/1957270.html
 # has some historical data for Altai Krai:
 # before 1957: west part on UTC+6, east on UTC+7
 # after 1957: UTC+7
@@ -3138,8 +3144,8 @@ Zone Asia/Magadan 10:03:12 -      LMT     1924 May  2
 # districts, but have very similar populations.  In fact, Wikipedia currently
 # lists them both as having 3528 people, exactly 1668 males and 1860 females
 # each!  (Yikes!)
-# http://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
-# http://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
+# https://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
+# https://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
 # Assume this is a mistake, albeit an amusing one.
 #
 # Looking at censuses, the populations of the two municipalities seem to have
@@ -3460,7 +3466,7 @@ Zone Europe/Stockholm     1:12:12 -       LMT     1879 Jan  1
 #
 # From Alois Treindl (2013-09-11):
 # The Federal regulations say
-# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
+# https://www.admin.ch/opc/de/classified-compilation/20071096/index.html
 # ... the meridian for Bern mean time ... is 7 degrees 26' 22.50".
 # Expressed in time, it is 0h29m45.5s.
 
@@ -3537,9 +3543,9 @@ Zone      Europe/Zurich   0:34:08 -       LMT     1853 Jul 16 # See above comment.
 # According to the articles linked below, Turkey will change into summer
 # time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
 # This change is due to a nationwide exam on 27th.
-# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
+# https://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # Turkish:
-# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
+# https://www.hurriyet.com.tr/yaz-saati-uygulamasi-bir-gun-ileri-alindi-17230464
 
 # From Faruk Pasin (2014-02-14):
 # The DST for Turkey has been changed for this year because of the
@@ -3675,7 +3681,7 @@ Link      Europe/Istanbul Asia/Istanbul   # Istanbul is in both continents.
 # http://www.segodnya.ua/news/14290482.html
 #
 # Deputies cancelled the winter time (in Russian)
-# http://www.pravda.com.ua/rus/news/2011/09/20/6600616/
+# https://www.pravda.com.ua/rus/news/2011/09/20/6600616/
 #
 # From Philip Pizzey (2011-10-18):
 # Today my Ukrainian colleagues have informed me that the
index d0903e7..5d50010 100644 (file)
 #      current -- the update time stamp, the data and the name of the file
 #      will not change.
 #
-#      Updated through IERS Bulletin C53
-#      File expires on:  28 December 2017
+#      Updated through IERS Bulletin C54
+#      File expires on:  28 June 2018
 #
-#@     3723408000
+#@     3739132800
 #
 2272060800     10      # 1 Jan 1972
 2287785600     11      # 1 Jul 1972
 #      the hash line is also ignored in the
 #      computation.
 #
-#h     62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d
+#h     5101445a 69948b51 9153e2b 2086e3d8 d54561a3
index 1ebf70f..a191d5f 100644 (file)
@@ -3,19 +3,18 @@
 # This file is in the public domain.
 
 # This file is generated automatically from the data in the public-domain
-# leap-seconds.list file available from most NIST time servers.
-# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,
-# you should be able to pick up leap-seconds.list from a secondary NIST server.
-# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers.
+# leap-seconds.list file, which is copied from:
+# ftp://ftp.nist.gov/pub/time/leap-seconds.list
 # For more about leap-seconds.list, please see
 # The NTP Timescale and Leap Seconds
-# http://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
-# Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
+# 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/
 # 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.
@@ -58,5 +57,5 @@ 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 C53
-#      File expires on:  28 December 2017
+#      Updated through IERS Bulletin C54
+#      File expires on:  28 June 2018
index 21fe540..66eb64d 100644 (file)
@@ -8,19 +8,18 @@ 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 available from most NIST time servers."
-  print "# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,"
-  print "# you should be able to pick up leap-seconds.list from a secondary NIST server."
-  print "# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers."
+  print "# leap-seconds.list file, which is copied from:"
+  print "# ftp://ftp.nist.gov/pub/time/leap-seconds.list"
   print "# For more about leap-seconds.list, please see"
   print "# The NTP Timescale and Leap Seconds"
-  print "# http://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 "# Terry J Quinn, The BIPM and the accurate measure of time,"
-  print "# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>."
+  print "# 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 "# 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."
index afc7438..2e1d621 100644 (file)
@@ -87,14 +87,14 @@ static const char   gmt[] = "GMT";
 
 /*
 ** The DST rules to use if TZ has no rules and we can't load TZDEFRULES.
-** We default to US rules as of 1999-08-17.
+** Default to US rules as of 2017-05-07.
 ** POSIX 1003.1 section 8.1.1 says that the default DST rules are
 ** implementation dependent; for historical reasons, US rules are a
 ** common default.
 */
 #ifndef TZDEFRULESTRING
-#define TZDEFRULESTRING ",M4.1.0,M10.5.0"
-#endif /* !defined TZDEFDST */
+#define TZDEFRULESTRING ",M3.2.0,M11.1.0"
+#endif
 
 struct ttinfo {                                /* time type information */
        int_fast32_t    tt_gmtoff;      /* UT offset in seconds */
@@ -188,20 +188,21 @@ static int                lcl_is_set;
 
 static struct tm       tm;
 
-#if !HAVE_POSIX_DECLS
+#if !HAVE_POSIX_DECLS || TZ_TIME_T
+# if HAVE_TZNAME
 char *                 tzname[2] = {
        (char *) wildabbr,
        (char *) wildabbr
 };
-# ifdef USG_COMPAT
+# endif
+# if USG_COMPAT
 long                   timezone;
 int                    daylight;
 # endif
-#endif
-
-#ifdef ALTZONE
+# ifdef ALTZONE
 long                   altzone;
-#endif /* defined ALTZONE */
+# endif
+#endif
 
 /* Initialize *S to a value based on GMTOFF, ISDST, and ABBRIND.  */
 static void
@@ -263,8 +264,10 @@ detzcode64(const char *const codep)
 static void
 update_tzname_etc(struct state const *sp, struct ttinfo const *ttisp)
 {
+#if HAVE_TZNAME
   tzname[ttisp->tt_isdst] = (char *) &sp->chars[ttisp->tt_abbrind];
-#ifdef USG_COMPAT
+#endif
+#if USG_COMPAT
   if (!ttisp->tt_isdst)
     timezone = - ttisp->tt_gmtoff;
 #endif
@@ -280,16 +283,17 @@ settzname(void)
        register struct state * const   sp = lclptr;
        register int                    i;
 
-       tzname[0] = tzname[1] = (char *) wildabbr;
-#ifdef USG_COMPAT
+#if HAVE_TZNAME
+       tzname[0] = tzname[1] = (char *) (sp ? wildabbr : gmt);
+#endif
+#if USG_COMPAT
        daylight = 0;
        timezone = 0;
-#endif /* defined USG_COMPAT */
+#endif
 #ifdef ALTZONE
        altzone = 0;
 #endif /* defined ALTZONE */
        if (sp == NULL) {
-               tzname[0] = tzname[1] = (char *) gmt;
                return;
        }
        /*
@@ -304,10 +308,10 @@ settzname(void)
                                                        &sp->ttis[
                                                                sp->types[i]];
                update_tzname_etc(sp, ttisp);
-#ifdef USG_COMPAT
+#if USG_COMPAT
                if (ttisp->tt_isdst)
                        daylight = 1;
-#endif /* defined USG_COMPAT */
+#endif
        }
 }
 
@@ -352,19 +356,23 @@ union input_buffer {
           + 4 * TZ_MAX_TIMES];
 };
 
+/* TZDIR with a trailing '/' rather than a trailing '\0'.  */
+static char const tzdirslash[sizeof TZDIR] = TZDIR "/";
+
 /* Local storage needed for 'tzloadbody'.  */
 union local_storage {
-  /* The file name to be opened.  */
-  char fullname[FILENAME_MAX + 1];
-
   /* The results of analyzing the file's contents after it is opened.  */
-  struct {
+  struct file_analysis {
     /* The input buffer.  */
     union input_buffer u;
 
     /* A temporary state used for parsing a TZ string in the file.  */
     struct state st;
   } u;
+
+  /* The file name to be opened.  */
+  char fullname[BIGGEST(sizeof (struct file_analysis),
+                       sizeof tzdirslash + 1024)];
 };
 
 /* Load tz data from the file named NAME into *SP.  Read extended
@@ -379,7 +387,6 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
        register int                    stored;
        register ssize_t                nread;
        register bool doaccess;
-       register char *fullname = lsp->fullname;
        register union input_buffer *up = &lsp->u.u;
        register int tzheadsize = sizeof (struct tzhead);
 
@@ -395,18 +402,20 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                ++name;
        doaccess = name[0] == '/';
        if (!doaccess) {
-               char const *p = TZDIR;
-               if (! p)
-                 return EINVAL;
-               if (sizeof lsp->fullname - 1 <= strlen(p) + strlen(name))
+               size_t namelen = strlen(name);
+               if (sizeof lsp->fullname - sizeof tzdirslash <= namelen)
                  return ENAMETOOLONG;
-               strcpy(fullname, p);
-               strcat(fullname, "/");
-               strcat(fullname, name);
+
+               /* Create a string "TZDIR/NAME".  Using sprintf here
+                  would pull in stdio (and would fail if the
+                  resulting string length exceeded INT_MAX!).  */
+               memcpy(lsp->fullname, tzdirslash, sizeof tzdirslash);
+               strcpy(lsp->fullname + sizeof tzdirslash, name);
+
                /* Set doaccess if '.' (as in "../") shows up in name.  */
                if (strchr(name, '.'))
                        doaccess = true;
-               name = fullname;
+               name = lsp->fullname;
        }
        if (doaccess && access(name, R_OK) != 0)
          return errno;
@@ -425,6 +434,8 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
        for (stored = 4; stored <= 8; stored *= 2) {
                int_fast32_t ttisstdcnt = detzcode(up->tzhead.tzh_ttisstdcnt);
                int_fast32_t ttisgmtcnt = detzcode(up->tzhead.tzh_ttisgmtcnt);
+               int_fast64_t prevtr = 0;
+               int_fast32_t prevcorr = 0;
                int_fast32_t leapcnt = detzcode(up->tzhead.tzh_leapcnt);
                int_fast32_t timecnt = detzcode(up->tzhead.tzh_timecnt);
                int_fast32_t typecnt = detzcode(up->tzhead.tzh_typecnt);
@@ -453,17 +464,17 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                sp->charcnt = charcnt;
 
                /* Read transitions, discarding those out of time_t range.
-                  But pretend the last transition before time_t_min
-                  occurred at time_t_min.  */
+                  But pretend the last transition before TIME_T_MIN
+                  occurred at TIME_T_MIN.  */
                timecnt = 0;
                for (i = 0; i < sp->timecnt; ++i) {
                        int_fast64_t at
                          = stored == 4 ? detzcode(p) : detzcode64(p);
-                       sp->types[i] = at <= time_t_max;
+                       sp->types[i] = at <= TIME_T_MAX;
                        if (sp->types[i]) {
                          time_t attime
-                           = ((TYPE_SIGNED(time_t) ? at < time_t_min : at < 0)
-                              ? time_t_min : at);
+                           = ((TYPE_SIGNED(time_t) ? at < TIME_T_MIN : at < 0)
+                              ? TIME_T_MIN : at);
                          if (timecnt && attime <= sp->ats[timecnt - 1]) {
                            if (attime < sp->ats[timecnt - 1])
                              return EINVAL;
@@ -510,17 +521,20 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                  int_fast64_t tr = stored == 4 ? detzcode(p) : detzcode64(p);
                  int_fast32_t corr = detzcode(p + stored);
                  p += stored + 4;
-                 if (tr <= time_t_max) {
-                   time_t trans
-                     = ((TYPE_SIGNED(time_t) ? tr < time_t_min : tr < 0)
-                        ? time_t_min : tr);
-                   if (leapcnt && trans <= sp->lsis[leapcnt - 1].ls_trans) {
-                     if (trans < sp->lsis[leapcnt - 1].ls_trans)
-                       return EINVAL;
-                     leapcnt--;
-                   }
-                   sp->lsis[leapcnt].ls_trans = trans;
-                   sp->lsis[leapcnt].ls_corr = corr;
+                 /* Leap seconds cannot occur before the Epoch.  */
+                 if (tr < 0)
+                   return EINVAL;
+                 if (tr <= TIME_T_MAX) {
+                   /* Leap seconds cannot occur more than once per UTC month,
+                      and UTC months are at least 28 days long (minus 1
+                      second for a negative leap second).  Each leap second's
+                      correction must differ from the previous one's by 1
+                      second.  */
+                   if (tr - prevtr < 28 * SECSPERDAY - 1
+                       || (corr != prevcorr - 1 && corr != prevcorr + 1))
+                     return EINVAL;
+                   sp->lsis[leapcnt].ls_trans = prevtr = tr;
+                   sp->lsis[leapcnt].ls_corr = prevcorr = corr;
                    leapcnt++;
                  }
                }
@@ -639,7 +653,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
                }
        }
        /*
-       ** If type 0 is is unused in transitions,
+       ** If type 0 is unused in transitions,
        ** it's the type to use for early times.
        */
        for (i = 0; i < sp->timecnt; ++i)
@@ -732,7 +746,7 @@ static const int    year_lengths[2] = {
 ** character.
 */
 
-static const char * ATTRIBUTE_PURE
+static const char *
 getzname(register const char *strp)
 {
        register char   c;
@@ -752,7 +766,7 @@ getzname(register const char *strp)
 ** We don't do any checking here; checking is done later in common-case code.
 */
 
-static const char * ATTRIBUTE_PURE
+static const char *
 getqzname(register const char *strp, const int delim)
 {
        register int    c;
@@ -914,7 +928,7 @@ getrule(const char *strp, register struct rule *const rulep)
 ** effect, calculate the year-relative time that rule takes effect.
 */
 
-static int_fast32_t ATTRIBUTE_PURE
+static int_fast32_t
 transtime(const int year, register const struct rule *const rulep,
          const int_fast32_t offset)
 {
@@ -1583,11 +1597,18 @@ offtime(const time_t *timep, long offset)
 ** where, to make the math easy, the answer for year zero is defined as zero.
 */
 
-static int ATTRIBUTE_PURE
+static int
+leaps_thru_end_of_nonneg(int y)
+{
+  return y / 4 - y / 100 + y / 400;
+}
+
+static int
 leaps_thru_end_of(register const int y)
 {
-       return (y >= 0) ? (y / 4 - y / 100 + y / 400) :
-               -(leaps_thru_end_of(-(y + 1)) + 1);
+  return (y < 0
+         ? -1 - leaps_thru_end_of_nonneg(-1 - y)
+         : leaps_thru_end_of_nonneg(y));
 }
 
 static struct tm *
@@ -1610,20 +1631,9 @@ timesub(const time_t *timep, int_fast32_t offset,
        while (--i >= 0) {
                lp = &sp->lsis[i];
                if (*timep >= lp->ls_trans) {
-                       if (*timep == lp->ls_trans) {
-                               hit = ((i == 0 && lp->ls_corr > 0) ||
-                                       lp->ls_corr > sp->lsis[i - 1].ls_corr);
-                               if (hit)
-                                       while (i > 0 &&
-                                               sp->lsis[i].ls_trans ==
-                                               sp->lsis[i - 1].ls_trans + 1 &&
-                                               sp->lsis[i].ls_corr ==
-                                               sp->lsis[i - 1].ls_corr + 1) {
-                                                       ++hit;
-                                                       --i;
-                                       }
-                       }
                        corr = lp->ls_corr;
+                       hit = (*timep == lp->ls_trans
+                              && (i == 0 ? 0 : lp[-1].ls_corr) < corr);
                        break;
                }
        }
@@ -1785,12 +1795,12 @@ increment_overflow_time(time_t *tp, int_fast32_t j)
 {
        /*
        ** This is like
-       ** 'if (! (time_t_min <= *tp + j && *tp + j <= time_t_max)) ...',
+       ** 'if (! (TIME_T_MIN <= *tp + j && *tp + j <= TIME_T_MAX)) ...',
        ** except that it does the right thing even if *tp + j would overflow.
        */
        if (! (j < 0
-              ? (TYPE_SIGNED(time_t) ? time_t_min - j <= *tp : -1 - j < *tp)
-              : *tp <= time_t_max - j))
+              ? (TYPE_SIGNED(time_t) ? TIME_T_MIN - j <= *tp : -1 - j < *tp)
+              : *tp <= TIME_T_MAX - j))
                return true;
        *tp += j;
        return false;
@@ -1926,8 +1936,8 @@ time2sub(struct tm *const tmp,
        /*
        ** Do a binary search (this works whatever time_t's type is).
        */
-       lo = time_t_min;
-       hi = time_t_max;
+       lo = TIME_T_MIN;
+       hi = TIME_T_MAX;
        for ( ; ; ) {
                t = lo / 2 + hi / 2;
                if (t < lo)
@@ -1944,12 +1954,12 @@ time2sub(struct tm *const tmp,
                } else  dir = tmcomp(&mytm, &yourtm);
                if (dir != 0) {
                        if (t == lo) {
-                               if (t == time_t_max)
+                               if (t == TIME_T_MAX)
                                        return WRONG;
                                ++t;
                                ++lo;
                        } else if (t == hi) {
-                               if (t == time_t_min)
+                               if (t == TIME_T_MIN)
                                        return WRONG;
                                --t;
                                --hi;
@@ -2216,7 +2226,7 @@ leapcorr(struct state const *sp, time_t t)
        return 0;
 }
 
-NETBSD_INSPIRED_EXTERN time_t ATTRIBUTE_PURE
+NETBSD_INSPIRED_EXTERN time_t
 time2posix_z(struct state *sp, time_t t)
 {
   return t - leapcorr(sp, t);
@@ -2238,7 +2248,7 @@ time2posix(time_t t)
   return t;
 }
 
-NETBSD_INSPIRED_EXTERN time_t ATTRIBUTE_PURE
+NETBSD_INSPIRED_EXTERN time_t
 posix2time_z(struct state *sp, time_t t)
 {
        time_t  x;
@@ -2285,9 +2295,9 @@ posix2time(time_t t)
 
 #endif /* defined STD_INSPIRED */
 
-#if defined time_tz || EPOCH_LOCAL || EPOCH_OFFSET != 0
+#if TZ_TIME_T
 
-# ifndef USG_COMPAT
+# if !USG_COMPAT
 #  define daylight 0
 #  define timezone 0
 # endif
index 169c919..8b89935 100644 (file)
@@ -7,7 +7,7 @@ asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time
 .el ds - \-
 .B #include <time.h>
 .PP
-.B extern char *tzname[2];
+.BR "extern char *tzname[];" " /\(** (optional) \(**/"
 .PP
 .B char *ctime(time_t const *clock);
 .PP
@@ -213,7 +213,7 @@ includes the following fields:
 .RS
 .PP
 .nf
-.ta .5i +\w'long tm_gmtoff;\0\0'u
+.ta 2n +\w'long tm_gmtoff;nn'u
        int tm_sec;     /\(** seconds (0\*(en60) \(**/
        int tm_min;     /\(** minutes (0\*(en59) \(**/
        int tm_hour;    /\(** hours (0\*(en23) \(**/
@@ -223,21 +223,11 @@ includes the following fields:
        int tm_wday;    /\(** day of week (Sunday = 0) \(**/
        int tm_yday;    /\(** day of year (0\*(en365) \(**/
        int tm_isdst;   /\(** is summer time in effect? \(**/
-       char \(**tm_zone;       /\(** abbreviation of time zone name \(**/
-       long tm_gmtoff; /\(** offset from UT in seconds \(**/
+       char \(**tm_zone;       /\(** time zone abbreviation (optional) \(**/
+       long tm_gmtoff; /\(** offset from UT in seconds (optional) \(**/
 .fi
 .RE
 .PP
-The
-.I tm_zone
-and
-.I tm_gmtoff
-fields exist, and are filled in, only if arrangements to do
-so were made when the library containing these functions was
-created.
-There is no guarantee that these fields will continue to exist
-in this form in future releases of this code.
-.PP
 .I Tm_isdst
 is non-zero if summer time is in effect.
 .PP
@@ -246,6 +236,21 @@ is the offset (in seconds) of the time represented
 from UT, with positive values indicating east
 of the Prime Meridian.
 The field's name is derived from Greenwich Mean Time, a precursor of UT.
+.PP
+In
+.B struct tm
+the
+.I tm_zone
+and
+.I tm_gmtoff
+fields exist, and are filled in, only if arrangements to do
+so were made when the library containing these functions was
+created.
+Similarly, the
+.B tzname
+variable is optional.
+There is no guarantee that these fields and this variable will
+continue to exist in this form in future releases of this code.
 .SH FILES
 .ta \w'/usr/local/etc/zoneinfo/posixrules\0\0'u
 /usr/local/etc/zoneinfo        time zone information directory
@@ -277,12 +282,19 @@ and
 point to static data
 overwritten by each call.
 The
+.B tzname
+variable (once set) and the
 .B tm_zone
 field of a returned
 .B "struct tm"
-points to a static array of characters, which
-can be overwritten by later calls to
-.IR tzset .
+both point to an array of characters that
+can be freed or overwritten by later calls to the functions
+.IR localtime ,
+.IR tzfree ,
+and
+.IR tzset ,
+if these functions affect the time zone information that specifies the
+abbreviation in question.
 The remaining functions and data are thread-safe.
 .PP
 .IR Asctime ,
index a2f2089..a3a5455 100644 (file)
@@ -7,7 +7,7 @@ NAME
 SYNOPSIS
        #include <time.h>
 
-       extern char *tzname[2];
+       extern char *tzname[]; /* (optional) */
 
        char *ctime(time_t const *clock);
 
@@ -113,22 +113,17 @@ DESCRIPTION
        structure, are in the <time.h> header file.  The structure (of type)
        struct tm includes the following fields:
 
-                   int tm_sec;      /* seconds (0-60) */
-                   int tm_min;      /* minutes (0-59) */
-                   int tm_hour;     /* hours (0-23) */
-                   int tm_mday;     /* day of month (1-31) */
-                   int tm_mon;      /* month of year (0-11) */
-                   int tm_year;     /* year - 1900 */
-                   int tm_wday;     /* day of week (Sunday = 0) */
-                   int tm_yday;     /* day of year (0-365) */
-                   int tm_isdst;    /* is summer time in effect? */
-                   char *tm_zone;   /* abbreviation of time zone name */
-                   long tm_gmtoff;  /* offset from UT in seconds */
-
-       The tm_zone and tm_gmtoff fields exist, and are filled in, only if
-       arrangements to do so were made when the library containing these
-       functions was created.  There is no guarantee that these fields will
-       continue to exist in this form in future releases of this code.
+                int tm_sec;      /* seconds (0-60) */
+                int tm_min;      /* minutes (0-59) */
+                int tm_hour;     /* hours (0-23) */
+                int tm_mday;     /* day of month (1-31) */
+                int tm_mon;      /* month of year (0-11) */
+                int tm_year;     /* year - 1900 */
+                int tm_wday;     /* day of week (Sunday = 0) */
+                int tm_yday;     /* day of year (0-365) */
+                int tm_isdst;    /* is summer time in effect? */
+                char *tm_zone;   /* time zone abbreviation (optional) */
+                long tm_gmtoff;  /* offset from UT in seconds (optional) */
 
        Tm_isdst is non-zero if summer time is in effect.
 
@@ -136,6 +131,12 @@ DESCRIPTION
        with positive values indicating east of the Prime Meridian.  The
        field's name is derived from Greenwich Mean Time, a precursor of UT.
 
+       In struct tm the tm_zone and tm_gmtoff fields exist, and are filled in,
+       only if arrangements to do so were made when the library containing
+       these functions was created.  Similarly, the tzname variable is
+       optional.  There is no guarantee that these fields and this variable
+       will continue to exist in this form in future releases of this code.
+
 FILES
        /usr/local/etc/zoneinfo             time zone information directory
        /usr/local/etc/zoneinfo/localtime   local time zone file
@@ -150,10 +151,12 @@ SEE ALSO
 
 NOTES
        The return values of asctime, ctime, gmtime, and localtime point to
-       static data overwritten by each call.  The tm_zone field of a returned
-       struct tm points to a static array of characters, which can be
-       overwritten by later calls to tzset.  The remaining functions and data
-       are thread-safe.
+       static data overwritten by each call.  The tzname variable (once set)
+       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
+       remaining functions and data are thread-safe.
 
        Asctime, asctime_r, ctime, and ctime_r behave strangely for years
        before 1000 or after 9999.  The 1989 and 1999 editions of the C
index 6ede9dc..e5d3eca 100644 (file)
 # Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
 # In the introduction, Oboler spoke of "Eastern Peace Time."
 # An AltaVista search turned up:
-# http://rowayton.org/rhs/hstaug45.html
+# https://web.archive.org/web/20000926032210/http://rowayton.org/rhs/hstaug45.html
 # "When the time is announced over the radio now, it is 'Eastern Peace
 # Time' instead of the old familiar 'Eastern War Time.'  Peace is wonderful."
 # (August 1945) by way of confirmation.
+#
+# From Paul Eggert (2017-09-23):
+# This was the V-J Day issue of the Clamdigger, a Rowayton, CT newsletter.
 
 # From Joseph Gallant citing
 # George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
@@ -257,7 +260,7 @@ Zone        PST8PDT          -8:00  US      P%sT
 # HST and HDT are standardized abbreviations for Hawaii-Aleutian
 # standard and daylight times.  See section 9.47 (p 234) of the
 # U.S. Government Printing Office Style Manual (2008)
-# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
+# https://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -346,7 +349,7 @@ Zone America/New_York       -4:56:02 -      LMT     1883 Nov 18 12:03:58
 # western Tennessee, most of Texas, Wisconsin
 
 # From Larry M. Smith (2006-04-26) re Wisconsin:
-# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
+# https://docs.legis.wisconsin.gov/statutes/statutes/175.pdf
 # is currently enforced at the 01:00 time of change.  Because the local
 # "bar time" in the state corresponds to 02:00, a number of citations
 # are issued for the "sale of class 'B' alcohol after prohibited
@@ -355,7 +358,7 @@ Zone America/New_York       -4:56:02 -      LMT     1883 Nov 18 12:03:58
 # From Douglas R. Bomberg (2007-03-12):
 # Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
 # Statue 175 closer in synch with the US Congress' intent....
-# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
+# https://docs.legis.wisconsin.gov/2007/related/acts/3
 
 # From an email administrator of the City of Fort Pierre, SD (2015-12-21):
 # Fort Pierre is technically located in the Mountain time zone as is
@@ -402,7 +405,7 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT  1883 Nov 18 12:14:21
 # ...it appears that Mercer County, North Dakota, changed from the
 # mountain time zone to the central time zone at the last transition from
 # daylight-saving to standard time (on Nov. 7, 2010):
-# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# https://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
 # http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
 
 # From Andy Lipscomb (2011-01-24):
@@ -453,7 +456,7 @@ Zone America/Denver -6:59:56 -      LMT     1883 Nov 18 12:00:04
 # legal time, and is not part of the data here.)  See:
 # Ross SA. An energy crisis from the past: Northern California in 1948.
 # Working Paper No. 8, Institute of Governmental Studies, UC Berkeley,
-# 1973-11.  http://escholarship.org/uc/item/8x22k30c
+# 1973-11.  https://escholarship.org/uc/item/8x22k30c
 #
 # In another measure to save electricity, DST was instituted from 1948-03-14
 # at 02:01 to 1949-01-16 at 02:00, with the governor having the option to move
@@ -474,8 +477,8 @@ Zone America/Denver -6:59:56 -      LMT     1883 Nov 18 12:00:04
 # which established DST from April's last Sunday at 01:00 until September's
 # last Sunday at 02:00. This was amended by 1962's Proposition 6, which changed
 # the fall-back date to October's last Sunday. See:
-# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
-# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
+# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
+# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
 #
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
 Rule   CA      1948    only    -       Mar     14      2:01    1:00    D
@@ -492,20 +495,31 @@ Zone America/Los_Angeles -7:52:58 -       LMT     1883 Nov 18 12:07:02
 # Alaska
 # AK%sT is the modern abbreviation for -09 per USNO.
 #
-# From Paul Eggert (2001-05-30):
+# From Paul Eggert (2017-06-15):
 # Howse writes that Alaska switched from the Julian to the Gregorian calendar,
 # and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
-# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
-# also a Friday.  Include only the time zone part of this transition,
-# ignoring the switch from Julian to Gregorian, since we can't represent
-# the Julian calendar.
-#
-# As far as we know, none of the exact locations mentioned below were
+# On Friday, 1867-10-18 (Gregorian), at precisely 15:30 local time, the
+# Russian forts and fleet at Sitka fired salutes to mark the ceremony of
+# formal transfer.  See the Sacramento Daily Union (1867-11-14), p 3, col 2.
+# https://cdnc.ucr.edu/cgi-bin/cdnc?a=d&d=SDU18671114.2.12.1
+# Sitka workers did not change their calendars until Sunday, 1867-10-20,
+# and so celebrated two Sundays that week.  See: Ahllund T (tr Hallamaa P).
+# From the memoirs of a Finnish workman. Alaska History. 2006 Fall;21(2):1-25.
+# http://alaskahistoricalsociety.org/wp-content/uploads/2016/12/Ahllund-2006-Memoirs-of-a-Finnish-Workman.pdf
+# Include only the time zone part of this transition, ignoring the switch
+# from Julian to Gregorian, since we can't represent the Julian calendar.
+#
+# As far as we know, of the locations mentioned below only Sitka was
 # permanently inhabited in 1867 by anyone using either calendar.
-# (Yakutat was colonized by the Russians in 1799, but the settlement
-# was destroyed in 1805 by a Yakutat-kon war party.)  However, there
-# were nearby inhabitants in some cases and for our purposes perhaps
-# it's best to simply use the official transition.
+# (Yakutat was colonized by the Russians in 1799, but the settlement was
+# destroyed in 1805 by a Yakutat-kon war party.)  Many of Alaska's inhabitants
+# were unaware of the US acquisition of Alaska, much less of any calendar or
+# time change.  However, the Russian-influenced part of Alaska did observe
+# Russian time, and it is more accurate to model this than to ignore it.
+# The database format requires an exact transition time; use the Russian
+# salute as a somewhat-arbitrary time for the formal transfer of control for
+# all of Alaska.  Sitka's UTC offset is -9:01:13; adjust its 15:30 to the
+# local times of other Alaskan locations so that they change simultaneously.
 
 # From Paul Eggert (2014-07-18):
 # One opinion of the early-1980s turmoil in Alaska over time zones and
@@ -558,10 +572,10 @@ Zone America/Los_Angeles -7:52:58 -       LMT     1883 Nov 18 12:07:02
 # It seems Metlakatla did go off PST on Sunday, November 1, changing
 # their time to AKST and are going to follow Alaska's DST, switching
 # between AKST and AKDT from now on....
-# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
+# https://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
 
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
-Zone America/Juneau     15:02:19 -     LMT     1867 Oct 18
+Zone America/Juneau     15:02:19 -     LMT     1867 Oct 19 15:33:32
                         -8:57:41 -     LMT     1900 Aug 20 12:00
                         -8:00  -       PST     1942
                         -8:00  US      P%sT    1946
@@ -571,7 +585,7 @@ Zone America/Juneau  15:02:19 -     LMT     1867 Oct 18
                         -8:00  US      P%sT    1983 Oct 30  2:00
                         -9:00  US      Y%sT    1983 Nov 30
                         -9:00  US      AK%sT
-Zone America/Sitka      14:58:47 -     LMT     1867 Oct 18
+Zone America/Sitka      14:58:47 -     LMT     1867 Oct 19 15:30
                         -9:01:13 -     LMT     1900 Aug 20 12:00
                         -8:00  -       PST     1942
                         -8:00  US      P%sT    1946
@@ -579,7 +593,7 @@ Zone America/Sitka   14:58:47 -     LMT     1867 Oct 18
                         -8:00  US      P%sT    1983 Oct 30  2:00
                         -9:00  US      Y%sT    1983 Nov 30
                         -9:00  US      AK%sT
-Zone America/Metlakatla         15:13:42 -     LMT     1867 Oct 18
+Zone America/Metlakatla         15:13:42 -     LMT     1867 Oct 19 15:44:55
                         -8:46:18 -     LMT     1900 Aug 20 12:00
                         -8:00  -       PST     1942
                         -8:00  US      P%sT    1946
@@ -587,14 +601,14 @@ Zone America/Metlakatla    15:13:42 -     LMT     1867 Oct 18
                         -8:00  US      P%sT    1983 Oct 30  2:00
                         -8:00  -       PST     2015 Nov  1  2:00
                         -9:00  US      AK%sT
-Zone America/Yakutat    14:41:05 -     LMT     1867 Oct 18
+Zone America/Yakutat    14:41:05 -     LMT     1867 Oct 19 15:12:18
                         -9:18:55 -     LMT     1900 Aug 20 12:00
                         -9:00  -       YST     1942
                         -9:00  US      Y%sT    1946
                         -9:00  -       YST     1969
                         -9:00  US      Y%sT    1983 Nov 30
                         -9:00  US      AK%sT
-Zone America/Anchorage  14:00:24 -     LMT     1867 Oct 18
+Zone America/Anchorage  14:00:24 -     LMT     1867 Oct 19 14:31:37
                         -9:59:36 -     LMT     1900 Aug 20 12:00
                        -10:00  -       AST     1942
                        -10:00  US      A%sT    1967 Apr
@@ -602,7 +616,7 @@ Zone America/Anchorage       14:00:24 -     LMT     1867 Oct 18
                        -10:00  US      AH%sT   1983 Oct 30  2:00
                         -9:00  US      Y%sT    1983 Nov 30
                         -9:00  US      AK%sT
-Zone America/Nome       12:58:21 -     LMT     1867 Oct 18
+Zone America/Nome       12:58:22 -     LMT     1867 Oct 19 13:29:35
                        -11:01:38 -     LMT     1900 Aug 20 12:00
                        -11:00  -       NST     1942
                        -11:00  US      N%sT    1946
@@ -611,7 +625,7 @@ Zone America/Nome    12:58:21 -     LMT     1867 Oct 18
                        -11:00  US      B%sT    1983 Oct 30  2:00
                         -9:00  US      Y%sT    1983 Nov 30
                         -9:00  US      AK%sT
-Zone America/Adak       12:13:21 -     LMT     1867 Oct 18
+Zone America/Adak       12:13:22 -     LMT     1867 Oct 19 12:44:35
                        -11:46:38 -     LMT     1900 Aug 20 12:00
                        -11:00  -       NST     1942
                        -11:00  US      N%sT    1946
@@ -647,7 +661,7 @@ Zone America/Adak    12:13:21 -     LMT     1867 Oct 18
 # "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
 # of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
 # the article is available at
-# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
+# https://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
 # and indicates that standard time was adopted effective noon, January
 # 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
 # saving for the period between the last Sunday of each April and the
@@ -746,7 +760,7 @@ Zone America/Boise  -7:44:49 -      LMT     1883 Nov 18 12:15:11
 # Indiana
 #
 # For a map of Indiana's time zone regions, see:
-# http://en.wikipedia.org/wiki/Time_in_Indiana
+# https://en.wikipedia.org/wiki/Time_in_Indiana
 #
 # From Paul Eggert (2007-08-17):
 # Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
@@ -973,7 +987,7 @@ Zone America/Kentucky/Louisville -5:43:02 - LMT     1883 Nov 18 12:16:58
 # From Paul Eggert (2001-07-16):
 # The final rule was published in the
 # Federal Register 65, 160 (2000-08-17), pp 50154-50158.
-# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22
+# https://www.gpo.gov/fdsys/pkg/FR-2000-08-17/html/00-20854.htm
 #
 Zone America/Kentucky/Monticello -5:39:24 - LMT        1883 Nov 18 12:20:36
                        -6:00   US      C%sT    1946
@@ -999,7 +1013,7 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT    1883 Nov 18 12:20:36
 # West Wendover, NV officially switched from Pacific to mountain time on
 # 1999-10-31.  See the
 # Federal Register 64, 203 (1999-10-21), pp 56705-56707.
-# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15
+# https://www.gpo.gov/fdsys/pkg/FR-1999-10-21/html/99-27240.htm
 # However, the Federal Register says that West Wendover already operated
 # on mountain time, and the rule merely made this official;
 # hence a separate tz entry is not needed.
@@ -1029,12 +1043,23 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
 # one hour in 1914."  This change is not in Shanks.  We have no more
 # info, so omit this for now.
 #
+# From Paul Eggert (2017-07-26):
+# Although Shanks says Detroit observed DST in 1967 from 06-14 00:01
+# until 10-29 00:01, I now see multiple reports that this is incorrect.
+# For example, according to a 50-year anniversary report about the 1967
+# Detroit riots and a major-league doubleheader on 1967-07-23, "By the time
+# the last fly ball of the doubleheader settled into the glove of leftfielder
+# Lenny Green, it was after 7 p.m.  Detroit did not observe daylight saving
+# time, so light was already starting to fail.  Twilight was made even deeper
+# by billowing columns of smoke that ascended in an unbroken wall north of the
+# ballpark."  See: Dow B. Detroit '67: As violence unfolded, Tigers played two
+# at home vs. Yankees. Detroit Free Press 2017-07-23.
+# https://www.freep.com/story/sports/mlb/tigers/2017/07/23/detroit-tigers-1967-riot-new-york-yankees/499951001/
+#
 # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
 Rule   Detroit 1948    only    -       Apr     lastSun 2:00    1:00    D
 Rule   Detroit 1948    only    -       Sep     lastSun 2:00    0       S
-Rule   Detroit 1967    only    -       Jun     14      2:00    1:00    D
-Rule   Detroit 1967    only    -       Oct     lastSun 2:00    0       S
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone America/Detroit   -5:32:11 -      LMT     1905
                        -6:00   -       CST     1915 May 15  2:00
@@ -1098,7 +1123,7 @@ Zone America/Menominee    -5:50:27 -      LMT     1885 Sep 18 12:00
 #      [PDF] (1914-03)
 #
 #      Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-#      <http://www.jstor.org/stable/1774359>.
+#      <https://www.jstor.org/stable/1774359>.
 #
 # See the 'europe' file for Greenland.
 
@@ -1144,19 +1169,19 @@ Zone America/Menominee  -5:50:27 -      LMT     1885 Sep 18 12:00
 # The British Columbia government announced yesterday that it will
 # adjust daylight savings next year to align with changes in the
 # U.S. and the rest of Canada....
-# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
+# https://archive.news.gov.bc.ca/releases/news_releases_2005-2009/2006AG0014-000330.htm
 # ...
 # Nova Scotia
 # Daylight saving time will be extended by four weeks starting in 2007....
-# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
+# https://www.novascotia.ca/just/regulations/rg2/2006/ma1206.pdf
 #
 # [For New Brunswick] the new legislation dictates that the time change is to
 # be done at 02:00 instead of 00:01.
-# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
+# https://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
 # ...
 # Manitoba has traditionally changed the clock every fall at 03:00.
 # As of 2006, the transition is to take place one hour earlier at 02:00.
-# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
+# https://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
 # ...
 # [Alberta, Ontario, Quebec] will follow US rules.
 # http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
@@ -1170,7 +1195,7 @@ Zone America/Menominee    -5:50:27 -      LMT     1885 Sep 18 12:00
 # http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
 # ...
 # Yukon
-# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
+# https://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
 # ...
 # N.W.T. will follow US rules.  Whoever maintains the government web site
 # does not seem to believe in bookmarks.  To see the news release, click the
@@ -1191,8 +1216,8 @@ Zone America/Menominee    -5:50:27 -      LMT     1885 Sep 18 12:00
 # time and daylight saving time arrangements in Canada circa 1998.
 #
 # National Research Council Canada maintains info about time zones and DST.
-# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
-# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
+# https://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
+# https://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
 # Its unofficial information is often taken from Matthews and Vincent.
 
 # From Paul Eggert (2006-06-27):
@@ -1229,11 +1254,13 @@ Rule    Canada  2007    max     -       Nov     Sun>=1  2:00    0       S
 
 # Newfoundland and Labrador
 
-# From Paul Eggert (2000-10-02):
-# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
-# but the only part of Labrador that follows the rules is the
-# southeast corner, including Port Hope Simpson and Mary's Harbour,
-# but excluding, say, Black Tickle.
+# From Paul Eggert (2017-10-14):
+# Legally Labrador should observe Newfoundland time; see:
+# McLeod J. Labrador time - legal or not? St. John's Telegram, 2017-10-07
+# http://www.thetelegram.com/news/local/labrador-time--legal-or-not-154860/
+# Matthews and Vincent (1998) write that the only part of Labrador
+# that follows the rules is the southeast corner, including Port Hope
+# Simpson and Mary's Harbour, but excluding, say, Black Tickle.
 
 # Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
 Rule   StJohns 1917    only    -       Apr      8      2:00    1:00    D
@@ -1433,7 +1460,7 @@ Zone America/Moncton      -4:19:08 -      LMT     1883 Dec  9
 # http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
 # that the coastal strip from just east of Natashquan to Blanc-Sablon
 # observes Atlantic standard time all year round.
-# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
+# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
 # says this common practice was codified into law as of 2007.
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
@@ -1465,6 +1492,11 @@ Zone America/Blanc-Sablon -3:48:28 -     LMT     1884
 # earlier in June).
 #
 # Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
+#
+# From Paul Eggert (2017-07-08):
+# For more on Orillia, see: Daubs K. Bold attempt at daylight saving
+# time became a comic failure in Orillia. Toronto Star 2017-07-08.
+# https://www.thestar.com/news/insight/2017/07/08/bold-attempt-at-daylight-saving-time-became-a-comic-failure-in-orillia.html
 
 # From Paul Eggert (1997-10-17):
 # Mark Brader writes that an article in the 1997-10-14 Toronto Star
@@ -1956,7 +1988,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 #      * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
 #      c. 7 defines Yukon standard time as UTC-9....
 #      see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
-#      [http://canlii.ca/t/7vhg]
+#      [https://www.canlii.org/en/ca/laws/stat/rsc-1985-c-i-21/latest/rsc-1985-c-i-21.html]
 #      * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
 #      * O.I.C. 1980/02 established DST.
 #      * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
@@ -2021,7 +2053,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 #     hours behind Greenwich Time.
 #
 # * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
-#   http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
+#   https://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
 #   C.O. 1973/214 INTERPRETATION ACT ...
 #
 #     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
@@ -2036,7 +2068,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 #   http://? - no online source found
 #
 # * Yukon Daylight Saving Time, YOIC 1987/56
-#   http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
+#   https://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
 #   O.I.C. 1987/056 INTERPRETATION ACT ...
 #
 #   In every year between
@@ -2048,7 +2080,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 #   Dated ... 9th day of March, A.D., 1987.
 #
 # * Yukon Daylight Saving Time 2006, YOIC 2006/127
-#   http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
+#   https://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
 #   O.I.C. 2006/127 INTERPRETATION ACT ...
 #
 #     1. In Yukon each year the time for general purposes shall be 7 hours
@@ -2062,7 +2094,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 #     3. This order comes into force January 1, 2007.
 #
 # * Interpretation Act, RSY 2002, c 125
-# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
+# https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2105,7 +2137,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 
 # From Michaela Rodrigue, writing in the
 # Nunatsiaq News (1999-11-19):
-# http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html
+# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html
 # Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
 # central - or Nunavut time - for government offices, and eastern time
 # for municipal offices and schools....  Igloolik [was similar but then]
@@ -2123,7 +2155,7 @@ Zone America/Creston      -7:46:04 -      LMT     1884
 # Central Time and Southampton Island [in the Central zone] is not
 # required to use daylight savings.
 
-# From <http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html>
+# From <http://www.nunatsiaqonline.ca/archives/nunavut001130/nvt21110_02.html>
 # Nunavut now has two time zones (2000-11-10):
 # The Nunavut government would allow its employees in Kugluktuk and
 # Cambridge Bay to operate on central time year-round, putting them
@@ -2454,7 +2486,7 @@ Zone America/Dawson       -9:17:40 -      LMT     1900 Aug 20
 # http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html
 #
 # Our page:
-# http://www.timeanddate.com/news/time/north-mexico-dst-change.html
+# https://www.timeanddate.com/news/time/north-mexico-dst-change.html
 
 # From Arthur David Olson (2010-01-20):
 # The page
@@ -2873,7 +2905,7 @@ Zone America/Costa_Rica   -5:36:13 -      LMT     1890        # San José
 # http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
 #
 # Some more background information is posted here:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
 #
 # The article also says that Cuba has been observing DST since 1963,
 # while Shanks (and tzdata) has 1965 as the first date (except in the
@@ -2920,7 +2952,7 @@ Zone America/Costa_Rica   -5:36:13 -      LMT     1890        # San José
 # http://granma.co.cu/2011/03/08/nacional/artic01.html
 #
 # Our info:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 #
 # From Steffen Thorsen (2011-10-30)
 # Cuba will end DST two weeks later this year. Instead of going back
@@ -2930,7 +2962,7 @@ Zone America/Costa_Rica   -5:36:13 -      LMT     1890        # San José
 # http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
 #
 # Our page:
-# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# https://www.timeanddate.com/news/time/cuba-time-changes-2011.html
 #
 # From Steffen Thorsen (2012-03-01)
 # According to Radio Reloj, Cuba will start DST on Midnight between March
@@ -2940,7 +2972,7 @@ Zone America/Costa_Rica   -5:36:13 -      LMT     1890        # San José
 # http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril
 #
 # Our info on it:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
 
 # From Steffen Thorsen (2012-11-03):
 # Radio Reloj and many other sources report that Cuba is changing back
@@ -3135,8 +3167,8 @@ Zone America/Guatemala    -6:02:04 -      LMT     1918 Oct 5
 # From Steffen Thorsen (2016-03-12):
 # Jean Antoine, editor of www.haiti-reference.com informed us that Haiti
 # are not going on DST this year.  Several other resources confirm this: ...
-# http://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
-# http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
+# https://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
+# https://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
 # From Steffen Thorsen (2017-03-12):
@@ -3335,7 +3367,7 @@ Zone America/Miquelon     -3:44:40 -      LMT     1911 May 15 # St Pierre
 # Turks and Caicos
 #
 # From Chris Dunn in
-# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007
+# https://bugs.debian.org/415007
 # (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
 # daylight saving dates for time changes have been adjusted to match
 # the recent U.S. change of dates.
@@ -3357,12 +3389,25 @@ Zone America/Miquelon   -3:44:40 -      LMT     1911 May 15 # St Pierre
 # "permanent daylight saving time" by one year....
 # http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
 #
+# From the Turks & Caicos Cabinet (2017-07-20), heads-up from Steffen Thorsen:
+# ... agreed to the reintroduction in TCI of Daylight Saving Time (DST)
+# during the summer months and Standard Time, also known as Local
+# Time, during the winter months with effect from April 2018 ...
+# https://www.gov.uk/government/news/turks-and-caicos-post-cabinet-meeting-statement--3
+#
+# From Paul Eggert (2017-08-26):
+# The date of effect of the spring 2018 change appears to be March 11,
+# which makes more sense.  See: Hamilton D. Time change back
+# by March 2018 for TCI. Magnetic Media. 2017-08-25.
+# http://magneticmediatv.com/2017/08/time-change-back-by-march-2018-for-tci/
+#
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone America/Grand_Turk        -4:44:32 -      LMT     1890
                        -5:07:11 -      KMT     1912 Feb # Kingston Mean Time
                        -5:00   -       EST     1979
                        -5:00   US      E%sT    2015 Nov Sun>=1 2:00
-                       -4:00   -       AST
+                       -4:00   -       AST     2018 Mar 11 3:00
+                       -5:00   US      E%sT
 
 # British Virgin Is
 # Virgin Is
index e2f23f5..2e8415e 100644 (file)
--- a/private.h
+++ b/private.h
 #define HAVE_DECL_ASCTIME_R 1
 #endif
 
+#if !defined HAVE_GENERIC && defined __has_extension
+# if __has_extension(c_generic_selections)
+#  define HAVE_GENERIC 1
+# else
+#  define HAVE_GENERIC 0
+# endif
+#endif
+/* _Generic is buggy in pre-4.9 GCC.  */
+#if !defined HAVE_GENERIC && defined __GNUC__
+# define HAVE_GENERIC (4 < __GNUC__ + (9 <= __GNUC_MINOR__))
+#endif
+#ifndef HAVE_GENERIC
+# define HAVE_GENERIC (201112 <= __STDC_VERSION__)
+#endif
+
 #ifndef HAVE_GETTEXT
 #define HAVE_GETTEXT           0
 #endif /* !defined HAVE_GETTEXT */
 
 #ifndef HAVE_INCOMPATIBLE_CTIME_R
 #define HAVE_INCOMPATIBLE_CTIME_R      0
-#endif /* !defined INCOMPATIBLE_CTIME_R */
+#endif
 
 #ifndef HAVE_LINK
 #define HAVE_LINK              1
 #define HAVE_POSIX_DECLS 1
 #endif
 
+#ifndef HAVE_STDBOOL_H
+#define HAVE_STDBOOL_H (199901 <= __STDC_VERSION__)
+#endif
+
 #ifndef HAVE_STRDUP
 #define HAVE_STRDUP 1
 #endif
 #define ctime_r _incompatible_ctime_r
 #endif /* HAVE_INCOMPATIBLE_CTIME_R */
 
-/* Enable tm_gmtoff and tm_zone on GNUish systems.  */
+/* Enable tm_gmtoff, tm_zone, and environ on GNUish systems.  */
 #define _GNU_SOURCE 1
 /* Fix asctime_r on Solaris 11.  */
 #define _POSIX_PTHREAD_SEMANTICS 1
 /* Enable strtoimax on pre-C99 Solaris 11.  */
 #define __EXTENSIONS__ 1
 
+/* To avoid having 'stat' fail unnecessarily with errno == EOVERFLOW,
+   enable large files on GNUish systems ...  */
+#ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+#endif
+/* ... and on AIX ...  */
+#define _LARGE_FILES 1
+/* ... and enable large inode numbers on Mac OS X 10.5 and later.  */
+#define _DARWIN_USE_64_BIT_INODE 1
+
 /*
 ** Nested includes
 */
 #undef tzfree
 
 #include <sys/types.h> /* for time_t */
-#include <stdio.h>
 #include <string.h>
 #include <limits.h>    /* for CHAR_BIT et al. */
 #include <stdlib.h>
 #include <libintl.h>
 #endif /* HAVE_GETTEXT */
 
-#if HAVE_SYS_WAIT_H
-#include <sys/wait.h>  /* for WIFEXITED and WEXITSTATUS */
-#endif /* HAVE_SYS_WAIT_H */
-
-#ifndef WIFEXITED
-#define WIFEXITED(status)      (((status) & 0xff) == 0)
-#endif /* !defined WIFEXITED */
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(status)    (((status) >> 8) & 0xff)
-#endif /* !defined WEXITSTATUS */
-
 #if HAVE_UNISTD_H
-#include <unistd.h>    /* for F_OK, R_OK, and other POSIX goodness */
+#include <unistd.h>    /* for R_OK, and other POSIX goodness */
 #endif /* HAVE_UNISTD_H */
 
 #ifndef HAVE_STRFTIME_L
 # endif
 #endif
 
-#ifndef F_OK
-#define F_OK   0
-#endif /* !defined F_OK */
+#ifndef USG_COMPAT
+# ifndef _XOPEN_VERSION
+#  define USG_COMPAT 0
+# else
+#  define USG_COMPAT 1
+# endif
+#endif
+
+#ifndef HAVE_TZNAME
+# if _POSIX_VERSION < 198808 && !USG_COMPAT
+#  define HAVE_TZNAME 0
+# else
+#  define HAVE_TZNAME 1
+# endif
+#endif
+
 #ifndef R_OK
 #define R_OK   4
 #endif /* !defined R_OK */
@@ -335,6 +365,12 @@ typedef unsigned long uintmax_t;
 ** typical platforms.
 */
 #if defined time_tz || EPOCH_LOCAL || EPOCH_OFFSET != 0
+# define TZ_TIME_T 1
+#else
+# define TZ_TIME_T 0
+#endif
+
+#if TZ_TIME_T
 # ifdef LOCALTIME_IMPLEMENTATION
 static time_t sys_time(time_t *x) { return time(x); }
 # endif
@@ -367,6 +403,8 @@ typedef time_tz tz_time_t;
 # define posix2time tz_posix2time
 # undef  posix2time_z
 # define posix2time_z tz_posix2time_z
+# undef  strftime
+# define strftime tz_strftime
 # undef  time
 # define time tz_time
 # undef  time2posix
@@ -389,10 +427,34 @@ typedef time_tz tz_time_t;
 # define tzset tz_tzset
 # undef  tzsetwall
 # define tzsetwall tz_tzsetwall
+# if HAVE_STRFTIME_L
+#  undef  strftime_l
+#  define strftime_l tz_strftime_l
+# endif
+# if HAVE_TZNAME
+#  undef  tzname
+#  define tzname tz_tzname
+# endif
+# if USG_COMPAT
+#  undef  daylight
+#  define daylight tz_daylight
+#  undef  timezone
+#  define timezone tz_timezone
+# endif
+# ifdef ALTZONE
+#  undef  altzone
+#  define altzone tz_altzone
+# endif
 
 char *ctime(time_t const *);
 char *ctime_r(time_t const *, char *);
-double difftime(time_t, time_t);
+double difftime(time_t, time_t) ATTRIBUTE_CONST;
+size_t strftime(char *restrict, size_t, char const *restrict,
+               struct tm const *restrict);
+# if HAVE_STRFTIME_L
+size_t strftime_l(char *restrict, size_t, char const *restrict,
+                 struct tm const *restrict, locale_t);
+# endif
 struct tm *gmtime(time_t const *);
 struct tm *gmtime_r(time_t const *restrict, struct tm *restrict);
 struct tm *localtime(time_t const *);
@@ -406,18 +468,29 @@ void tzset(void);
 extern char *asctime_r(struct tm const *restrict, char *restrict);
 #endif
 
-#if !HAVE_POSIX_DECLS
-# ifdef USG_COMPAT
-#  ifndef timezone
+#ifndef HAVE_DECL_ENVIRON
+# if defined environ || defined __USE_GNU
+#  define HAVE_DECL_ENVIRON 1
+# else
+#  define HAVE_DECL_ENVIRON 0
+# endif
+#endif
+
+#if !HAVE_DECL_ENVIRON
+extern char **environ;
+#endif
+
+#if TZ_TIME_T || !HAVE_POSIX_DECLS
+# if HAVE_TZNAME
+extern char *tzname[];
+# endif
+# if USG_COMPAT
 extern long timezone;
-#  endif
-#  ifndef daylight
 extern int daylight;
-#  endif
 # endif
 #endif
 
-#if defined ALTZONE && !defined altzone
+#ifdef ALTZONE
 extern long altzone;
 #endif
 
@@ -427,25 +500,25 @@ extern long altzone;
 */
 
 #ifdef STD_INSPIRED
-# if !defined tzsetwall || defined time_tz
+# if TZ_TIME_T || !defined tzsetwall
 void tzsetwall(void);
 # endif
-# if !defined offtime || defined time_tz
+# if TZ_TIME_T || !defined offtime
 struct tm *offtime(time_t const *, long);
 # endif
-# if !defined timegm || defined time_tz
+# if TZ_TIME_T || !defined timegm
 time_t timegm(struct tm *);
 # endif
-# if !defined timelocal || defined time_tz
+# if TZ_TIME_T || !defined timelocal
 time_t timelocal(struct tm *);
 # endif
-# if !defined timeoff || defined time_tz
+# if TZ_TIME_T || !defined timeoff
 time_t timeoff(struct tm *, long);
 # endif
-# if !defined time2posix || defined time_tz
+# if TZ_TIME_T || !defined time2posix
 time_t time2posix(time_t);
 # endif
-# if !defined posix2time || defined time_tz
+# if TZ_TIME_T || !defined posix2time
 time_t posix2time(time_t);
 # endif
 #endif
@@ -479,10 +552,10 @@ time_t mktime_z(timezone_t restrict, struct tm *restrict);
 timezone_t tzalloc(char const *);
 void tzfree(timezone_t);
 # ifdef STD_INSPIRED
-#  if !defined posix2time_z || defined time_tz
+#  if TZ_TIME_T || !defined posix2time_z
 time_t posix2time_z(timezone_t, time_t) ATTRIBUTE_PURE;
 #  endif
-#  if !defined time2posix_z || defined time_tz
+#  if TZ_TIME_T || !defined time2posix_z
 time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
 #  endif
 # endif
@@ -492,12 +565,12 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
 ** Finally, some convenience items.
 */
 
-#if __STDC_VERSION__ < 199901
+#if HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
 # define true 1
 # define false 0
 # define bool int
-#else
-# include <stdbool.h>
 #endif
 
 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
@@ -513,27 +586,32 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
 #define MINVAL(t, b)                                           \
   ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))
 
-/* The minimum and maximum finite time values.  This implementation
-   assumes no padding if time_t is signed and either the compiler is
-   pre-C11 or time_t is not one of the standard signed integer types.  */
-#if 201112 <= __STDC_VERSION__
-static time_t const time_t_min
-  = (TYPE_SIGNED(time_t)
-     ? _Generic((time_t) 0,
-               signed char: SCHAR_MIN, short: SHRT_MIN,
-               int: INT_MIN, long: LONG_MIN, long long: LLONG_MIN,
-               default: MINVAL(time_t, TYPE_BIT(time_t)))
-     : 0);
-static time_t const time_t_max
-  = (TYPE_SIGNED(time_t)
-     ? _Generic((time_t) 0,
-               signed char: SCHAR_MAX, short: SHRT_MAX,
-               int: INT_MAX, long: LONG_MAX, long long: LLONG_MAX,
-               default: MAXVAL(time_t, TYPE_BIT(time_t)))
-     : -1);
+/* The extreme time values, assuming no padding.  */
+#define TIME_T_MIN_NO_PADDING MINVAL(time_t, TYPE_BIT(time_t))
+#define TIME_T_MAX_NO_PADDING MAXVAL(time_t, TYPE_BIT(time_t))
+
+/* The extreme time values.  These are macros, not constants, so that
+   any portability problem occur only when compiling .c files that use
+   the macros, which is safer for applications that need only zdump and zic.
+   This implementation assumes no padding if time_t is signed and
+   either the compiler lacks support for _Generic or time_t is not one
+   of the standard signed integer types.  */
+#if HAVE_GENERIC
+# define TIME_T_MIN \
+    _Generic((time_t) 0, \
+            signed char: SCHAR_MIN, short: SHRT_MIN, \
+            int: INT_MIN, long: LONG_MIN, long long: LLONG_MIN, \
+            default: TIME_T_MIN_NO_PADDING)
+# define TIME_T_MAX \
+    (TYPE_SIGNED(time_t) \
+     ? _Generic((time_t) 0, \
+               signed char: SCHAR_MAX, short: SHRT_MAX, \
+               int: INT_MAX, long: LONG_MAX, long long: LLONG_MAX, \
+               default: TIME_T_MAX_NO_PADDING)                     \
+     : (time_t) -1)
 #else
-static time_t const time_t_min = MINVAL(time_t, TYPE_BIT(time_t));
-static time_t const time_t_max = MAXVAL(time_t, TYPE_BIT(time_t));
+# define TIME_T_MIN TIME_T_MIN_NO_PADDING
+# define TIME_T_MAX TIME_T_MAX_NO_PADDING
 #endif
 
 /*
@@ -550,7 +628,7 @@ static time_t const time_t_max = MAXVAL(time_t, TYPE_BIT(time_t));
 ** INITIALIZE(x)
 */
 
-#ifdef lint
+#ifdef GCC_LINT
 # define INITIALIZE(x) ((x) = 0)
 #else
 # define INITIALIZE(x)
@@ -633,7 +711,7 @@ char *ctime_r(time_t const *, char *);
 ** or
 **     isleap(a + b) == isleap(a % 400 + b % 400)
 ** This is true even if % means modulo rather than Fortran remainder
-** (which is allowed by C89 but not C99).
+** (which is allowed by C89 but not by C99 or later).
 ** We use this to avoid addition overflow problems.
 */
 
index 6038c3b..bbae226 100644 (file)
@@ -22,7 +22,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # These tables use numeric abbreviations like -03 and -0330 for
 # integer hour and minute UTC offsets.  Although earlier editions used
@@ -265,8 +265,8 @@ Rule        Arg     2008    only    -       Oct     Sun>=15 0:00    1:00    S
 #
 # Es inminente que en San Luis atrasen una hora los relojes
 # (It is imminent in San Luis clocks one hour delay)
-# http://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
-# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
+# https://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
+# http://www.worldtimezone.com/dst_news/dst_news_argentina02.html
 
 # From Jesper Nørgaard Welen (2008-01-18):
 # The page of the San Luis provincial government
@@ -385,7 +385,7 @@ Rule        Arg     2008    only    -       Oct     Sun>=15 0:00    1:00    S
 # Perhaps San Luis operates on the legal fiction that it is at -04
 # with perpetual summer time, but ordinary usage typically seems to
 # just say it's at -03; see, for example,
-# http://es.wikipedia.org/wiki/Hora_oficial_argentina
+# https://es.wikipedia.org/wiki/Hora_oficial_argentina
 # We've documented similar situations as being plain changes to
 # standard time, so let's do that here too.  This does not change UTC
 # offsets, only tm_isdst and the time zone abbreviations.  One minor
@@ -716,7 +716,7 @@ Zone        America/La_Paz  -4:32:36 -      LMT     1890
 # (Portuguese)
 #
 # We have a written a short article about it as well:
-# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
+# https://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
 #
 # From Alexander Krivenyshev (2011-10-04):
 # State Bahia will return to Daylight savings time this year after 8 years off.
@@ -725,7 +725,7 @@ Zone        America/La_Paz  -4:32:36 -      LMT     1890
 
 # In Portuguese:
 # http://g1.globo.com/bahia/noticia/2011/10/governador-jaques-wagner-confirma-horario-de-verao-na-bahia.html
-# http://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
+# https://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
 
 # From Guilherme Bernardes Rodrigues (2011-10-07):
 # There is news in the media, however there is still no decree about it.
@@ -751,16 +751,16 @@ Zone      America/La_Paz  -4:32:36 -      LMT     1890
 
 # From Rodrigo Severo (2012-10-16):
 # Tocantins state will have DST.
-# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
+# https://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
 
 # From Steffen Thorsen (2013-09-20):
 # Tocantins in Brazil is very likely not to observe DST from October....
 # http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
 # We will keep this article updated when this is confirmed:
-# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
+# https://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
 
 # From Steffen Thorsen (2013-10-17):
-# http://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
+# https://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
 # Senator Jorge Viana announced that Acre will change time zone on November 10.
 # He did not specify the time of the change, nor if western parts of Amazonas
 # will change as well.
@@ -1076,18 +1076,18 @@ Zone America/Rio_Branco -4:31:12 -      LMT     1914
 # the following source, cited by Oscar van Vlijmen (2006-10-08):
 # [1] Chile Law
 # http://www.webexhibits.org/daylightsaving/chile.html
-# This contains a copy of this official table:
+# This contains a copy of this official table:
 # Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
-# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
+# https://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
 # [1] needs several corrections, though.
 #
 # The first set of corrections is from:
 # [2] History of the Official Time of Chile
 # http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06).  See:
-# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
+# https://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
 # This is an English translation of:
 # Historia de la hora oficial de Chile (retrieved 2012-10-24).  See:
-# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
+# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
 # A fancier Spanish version (requiring mouse-clicking) is at:
 # http://www.horaoficial.cl/historia_hora.html
 # Conflicts between [1] and [2] were resolved as follows:
@@ -1363,10 +1363,10 @@ Link    America/Curacao America/Kralendijk      # Caribbean Netherlands
 # Milne says the Central and South American Telegraph Company used -5:24:15.
 #
 # From Alois Treindl (2016-12-15):
-# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
+# https://www.elcomercio.com/actualidad/hora-sixto-1993.html
 # ... Whether the law applied also to Galápagos, I do not know.
 # From Paul Eggert (2016-12-15):
-# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
+# https://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
 # This says President Sixto Durán Ballén signed decree No. 285, which
 # established DST from 1992-11-28 to 1993-02-05; it does not give transition
 # times.  The people called it "hora de Sixto" ("Sixto hour").  The change did
@@ -1778,7 +1778,7 @@ Zone America/Montevideo   -3:44:44 -      LMT     1898 Jun 28
 # hours of presidential broadcasts, hours of lines,' quipped comedian
 # Jean Mary Curró ...". See: Cawthorne A, Kai D. Venezuela scraps
 # half-hour time difference set by Chavez. Reuters 2016-04-15 14:50 -0400
-# http://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
+# https://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
 #
 # From Matt Johnson (2016-04-20):
 # ... published in the official Gazette [2016-04-18], here:
index 4b9fd2c..6da3fb9 100644 (file)
 
 #include <fcntl.h>
 #include <locale.h>
+#include <stdio.h>
+
+#ifndef DEPRECATE_TWO_DIGIT_YEARS
+# define DEPRECATE_TWO_DIGIT_YEARS false
+#endif
 
 struct lc_time_T {
        const char *    mon[MONSPERYEAR];
@@ -73,7 +78,7 @@ static const struct lc_time_T C_time_locale = {
 
        /*
        ** x_fmt
-       ** C99 requires this format.
+       ** C99 and later require this format.
        ** Using just numbers (as here) makes Quakers happier;
        ** it's also compatible with SVR4.
        */
@@ -81,7 +86,7 @@ static const struct lc_time_T C_time_locale = {
 
        /*
        ** c_fmt
-       ** C99 requires this format.
+       ** C99 and later require this format.
        ** Previously this code used "%D %X", but we now conform to C99.
        ** Note that
        **      "%a %b %d %H:%M:%S %Y"
@@ -99,25 +104,18 @@ static const struct lc_time_T      C_time_locale = {
        "%a %b %e %H:%M:%S %Z %Y"
 };
 
+enum warn { IN_NONE, IN_SOME, IN_THIS, IN_ALL };
+
 static char *  _add(const char *, char *, const char *);
 static char *  _conv(int, const char *, char *, const char *);
 static char *  _fmt(const char *, const struct tm *, char *, const char *,
-                       int *);
+                    enum warn *);
 static char *  _yconv(int, int, bool, bool, char *, char const *);
 
-#if !HAVE_POSIX_DECLS
-extern char *  tzname[];
-#endif
-
 #ifndef YEAR_2000_NAME
 #define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS"
 #endif /* !defined YEAR_2000_NAME */
 
-#define IN_NONE        0
-#define IN_SOME        1
-#define IN_THIS        2
-#define IN_ALL 3
-
 #if HAVE_STRFTIME_L
 size_t
 strftime_l(char *s, size_t maxsize, char const *format, struct tm const *t,
@@ -132,13 +130,12 @@ size_t
 strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
 {
        char *  p;
-       int     warn;
+       enum warn warn = IN_NONE;
 
        tzset();
-       warn = IN_NONE;
        p = _fmt(format, t, s, s + maxsize, &warn);
-#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
-       if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) {
+       if (DEPRECATE_TWO_DIGIT_YEARS
+           && warn != IN_NONE && getenv(YEAR_2000_NAME)) {
                fprintf(stderr, "\n");
                fprintf(stderr, "strftime format \"%s\" ", format);
                fprintf(stderr, "yields only two digits of years in ");
@@ -149,7 +146,6 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
                else    fprintf(stderr, "all locales");
                fprintf(stderr, "\n");
        }
-#endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */
        if (p == s + maxsize)
                return 0;
        *p = '\0';
@@ -158,7 +154,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
 
 static char *
 _fmt(const char *format, const struct tm *t, char *pt,
-     const char *ptlim, int *warnp)
+     const char *ptlim, enum warn *warnp)
 {
        for ( ; *format; ++format) {
                if (*format == '%') {
@@ -205,7 +201,7 @@ label:
                                continue;
                        case 'c':
                                {
-                               int warn2 = IN_SOME;
+                               enum warn warn2 = IN_SOME;
 
                                pt = _fmt(Locale->c_fmt, t, pt, ptlim, &warn2);
                                if (warn2 == IN_ALL)
@@ -223,7 +219,7 @@ label:
                        case 'E':
                        case 'O':
                                /*
-                               ** C99 locale modifiers.
+                               ** Locale modifiers of C99 and later.
                                ** The sequences
                                **      %Ec %EC %Ex %EX %Ey %EY
                                **      %Od %oe %OH %OI %Om %OM
@@ -356,7 +352,7 @@ label:
 ** (01-53)."
 ** (ado, 1993-05-24)
 **
-** From <http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html> by Markus Kuhn:
+** From <https://www.cl.cam.ac.uk/~mgk25/iso-time.html> by Markus Kuhn:
 ** "Week 01 of a year is per definition the first week which has the
 ** Thursday in this year, which is equivalent to the week which contains
 ** the fourth day of January. In other words, the first week of a new year
@@ -460,7 +456,7 @@ label:
                                continue;
                        case 'x':
                                {
-                               int     warn2 = IN_SOME;
+                               enum warn warn2 = IN_SOME;
 
                                pt = _fmt(Locale->x_fmt, t, pt, ptlim, &warn2);
                                if (warn2 == IN_ALL)
@@ -483,19 +479,19 @@ label:
                        case 'Z':
 #ifdef TM_ZONE
                                pt = _add(t->TM_ZONE, pt, ptlim);
-#else
+#elif HAVE_TZNAME
                                if (t->tm_isdst >= 0)
                                        pt = _add(tzname[t->tm_isdst != 0],
                                                pt, ptlim);
 #endif
                                /*
-                               ** C99 says that %Z must be replaced by the
-                               ** empty string if the time zone is not
-                               ** determinable.
+                               ** C99 and later say that %Z must be
+                               ** replaced by the empty string if the
+                               ** time zone is not determinable.
                                */
                                continue;
                        case 'z':
-#if defined TM_GMTOFF || defined USG_COMPAT || defined ALTZONE
+#if defined TM_GMTOFF || USG_COMPAT || defined ALTZONE
                                {
                                long            diff;
                                char const *    sign;
@@ -505,7 +501,7 @@ label:
                                diff = t->TM_GMTOFF;
 # else
                                /*
-                               ** C99 says that the UT offset must
+                               ** C99 and later say that the UT offset must
                                ** be computed by looking only at
                                ** tm_isdst. This requirement is
                                ** incorrect, since it means the code
@@ -513,20 +509,20 @@ label:
                                ** altzone and timezone), and the
                                ** magic might not have the correct
                                ** offset. Doing things correctly is
-                               ** tricky and requires disobeying C99;
+                               ** tricky and requires disobeying the standard;
                                ** see GNU C strftime for details.
                                ** For now, punt and conform to the
                                ** standard, even though it's incorrect.
                                **
-                               ** C99 says that %z must be replaced by the
-                               ** empty string if the time zone is not
+                               ** C99 and later say that %z must be replaced by
+                               ** the empty string if the time zone is not
                                ** determinable, so output nothing if the
                                ** appropriate variables are not available.
                                */
                                if (t->tm_isdst < 0)
                                        continue;
                                if (t->tm_isdst == 0)
-#  ifdef USG_COMPAT
+#  if USG_COMPAT
                                        diff = -timezone;
 #  else
                                        continue;
@@ -543,9 +539,11 @@ label:
 #ifdef TM_ZONE
                                  negative = t->TM_ZONE[0] == '-';
 #else
-                                 negative
-                                   = (t->tm_isdst < 0
-                                      || tzname[t->tm_isdst != 0][0] == '-');
+                                 negative = t->tm_isdst < 0;
+# if HAVE_TZNAME
+                                 if (tzname[t->tm_isdst != 0][0] == '-')
+                                   negative = true;
+# endif
 #endif
                                }
                                if (negative) {
diff --git a/theory.html b/theory.html
new file mode 100644 (file)
index 0000000..965135d
--- /dev/null
@@ -0,0 +1,1034 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <title>Theory and pragmatics of the tz code and data</title>
+  <meta charset="UTF-8">
+</head>
+
+<!-- The somewhat-unusal indenting style in this file is intended to
+     shrink the output of the shell command 'diff Theory Theory.html',
+     where 'Theory' was the plain text file that this file is derived
+     from.  The 'Theory' file used leading white space to indent, and
+     when possible that indentation is preserved here.  Eventually we
+     may stop doing this and remove this comment.  -->
+
+<body>
+  <h1>Theory and pragmatics of the tz code and data</h1>
+  <h3>Outline</h3>
+  <nav>
+    <ul>
+      <li><a href="#scope">Scope of the tz database</a></li>
+      <li><a href="#naming">Names of time zone rules</a></li>
+      <li><a href="#abbreviations">Time zone abbreviations</a></li>
+      <li><a href="#accuracy">Accuracy of the tz database</a></li>
+      <li><a href="#functions">Time and date functions</a></li>
+      <li><a href="#stability">Interface stability</a></li>
+      <li><a href="#calendar">Calendrical issues</a></li>
+      <li><a href="#planets">Time and time zones on other planets</a></li>
+    </ul>
+  </nav>
+
+
+  <section>
+    <h2 id="scope">Scope of the tz database</h2>
+<p>
+The tz database attempts to record the history and predicted future of
+all computer-based clocks that track civil time.  To represent this
+data, the world is partitioned into regions whose clocks all agree
+about timestamps that occur after the somewhat-arbitrary cutoff point
+of the POSIX Epoch (1970-01-01 00:00:00 UTC).  For each such region,
+the database records all known clock transitions, and labels the region
+with a notable location.  Although 1970 is a somewhat-arbitrary
+cutoff, there are significant challenges to moving the cutoff earlier
+even by a decade or two, due to the wide variety of local practices
+before computer timekeeping became prevalent.
+</p>
+
+<p>
+Clock transitions before 1970 are recorded for each such location,
+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
+applications requiring accurate handling of all past times everywhere,
+as it would take far too much effort and guesswork to record all
+details of pre-1970 civil timekeeping.
+</p>
+
+<p>
+As described below, reference source code for using the tz database is
+also available.  The tz code is upwards compatible with POSIX, an
+international standard for UNIX-like systems.  As of this writing, the
+current edition of POSIX is:
+  <a href="http://pubs.opengroup.org/onlinepubs/9699919799/">
+  The Open Group Base Specifications Issue 7</a>,
+  IEEE Std 1003.1-2008, 2016 Edition.
+</p>
+  </section>
+
+
+
+  <section>
+    <h2 id="naming">Names of time zone rules</h2>
+<p>
+Each of the database's time zone rules 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 'tzselect'
+program in the tz code.  The
+<a href="http://cldr.unicode.org/">Unicode Common Locale Data
+Repository</a> contains data that may be useful for other
+selection interfaces.
+</p>
+
+<p>
+The time zone rule naming conventions attempt to strike a balance
+among the following goals:
+</p>
+<ul>
+  <li>
+   Uniquely identify every region 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.
+  </li>
+  <li>
+   Be robust in the presence of political changes.  For example, names
+   of countries are ordinarily not used, to avoid incompatibilities
+   when countries change their name (e.g. Zaire&rarr;Congo) or when
+   locations change countries (e.g. Hong Kong from UK colony to
+   China).
+  </li>
+  <li>
+   Be portable to a wide variety of implementations.
+  </li>
+  <li>
+   Use a consistent naming conventions over the entire world.
+  </li>
+</ul>
+<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.  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>'.
+</p>
+
+<p>
+Here are the general rules used for choosing location names,
+in decreasing order of importance:
+</p>
+<ul>
+  <li>
+       Use only valid POSIX file name components (i.e., the parts of
+               names other than '<code>/</code>').  Do not use the file name
+               components '<code>.</code>' and '<code>..</code>'.
+               Within a file name component,
+               use only ASCII letters, '<code>.</code>',
+               '<code>-</code>' and '<code>_</code>'.  Do not use
+               digits, as that might create an ambiguity with POSIX
+               TZ strings.  A file name component must not exceed 14
+               characters or start with '<code>-</code>'.  E.g.,
+               prefer '<code>Brunei</code>' to
+               '<code>Bandar_Seri_Begawan</code>'.  Exceptions: see
+               the discussion
+               of legacy names below.
+  </li>
+  <li>
+       A name must not be empty, or contain '<code>//</code>', or
+       start or end with '<code>/</code>'.
+  </li>
+  <li>
+       Do not use names that differ only in case.  Although the reference
+               implementation is case-sensitive, some other implementations
+               are not, and they would mishandle names differing only in case.
+  </li>
+  <li>
+       If one name <var>A</var> is an initial prefix of another
+               name <var>AB</var> (ignoring case), then <var>B</var>
+               must not start with '<code>/</code>', as a
+               regular file cannot have
+               the same name as a directory in POSIX.  For example,
+               '<code>America/New_York</code>' precludes
+               '<code>America/New_York/Bronx</code>'.
+  </li>
+  <li>
+       Uninhabited regions like the North Pole and Bouvet Island
+               do not need locations, since local time is not defined there.
+  </li>
+  <li>
+       There should typically be at least one name for each ISO 3166-1
+               officially assigned two-letter code for an inhabited country
+               or territory.
+  </li>
+  <li>
+       If all the clocks in a region have agreed since 1970,
+               don't bother to include more than one location
+               even if subregions' clocks disagreed before 1970.
+               Otherwise these tables would become annoyingly large.
+  </li>
+  <li>
+       If a name is ambiguous, use a less ambiguous alternative;
+               e.g. many cities are named San José and Georgetown, so
+               prefer '<code>Costa_Rica</code>' to '<code>San_Jose</code>' and '<code>Guyana</code>' to '<code>Georgetown</code>'.
+  </li>
+  <li>
+       Keep locations compact.  Use cities or small islands, not countries
+               or regions, so that any future time zone changes do not split
+               locations into different time zones.  E.g. prefer
+               '<code>Paris</code>' to '<code>France</code>', since
+               France has had multiple time zones.
+  </li>
+  <li>
+       Use mainstream English spelling, e.g. prefer
+               '<code>Rome</code>' to '<code>Roma</code>', and prefer
+               '<code>Athens</code>' to the Greek
+               '<code>Αθήνα</code>' or the Romanized
+               '<code>Athína</code>'.
+               The POSIX file name restrictions encourage this rule.
+  </li>
+  <li>
+       Use the most populous among locations in a zone,
+               e.g. prefer '<code>Shanghai</code>' to
+               '<code>Beijing</code>'.  Among locations with
+               similar populations, pick the best-known location,
+               e.g. prefer '<code>Rome</code>' to '<code>Milan</code>'.
+  </li>
+  <li>
+       Use the singular form, e.g. prefer '<code>Canary</code>' to '<code>Canaries</code>'.
+  </li>
+  <li>
+       Omit common suffixes like '<code>_Islands</code>' and
+               '<code>_City</code>', unless that would lead to
+               ambiguity.  E.g. prefer '<code>Cayman</code>' to
+               '<code>Cayman_Islands</code>' and
+               '<code>Guatemala</code>' to
+               '<code>Guatemala_City</code>', but prefer
+               '<code>Mexico_City</code>' to '<code>Mexico</code>'
+               because the country
+               of Mexico has several time zones.
+  </li>
+  <li>
+       Use '<code>_</code>' to represent a space.
+  </li>
+  <li>
+       Omit '<code>.</code>' from abbreviations in names, e.g. prefer
+               '<code>St_Helena</code>' to '<code>St._Helena</code>'.
+  </li>
+  <li>
+       Do not change established names if they only marginally
+               violate the above rules.  For example, don't change
+               the existing name '<code>Rome</code>' to
+               '<code>Milan</code>' merely because
+               Milan's population has grown to be somewhat greater
+               than Rome's.
+  </li>
+  <li>
+       If a name is changed, put its old spelling in the
+               '<code>backward</code>' file.
+               This means old spellings will continue to work.
+  </li>
+</ul>
+
+<p>
+The file '<code>zone1970.tab</code>' lists geographical locations used
+to name time
+zone rules.  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.  Although a '<code>zone1970.tab</code>' location's longitude
+corresponds to its LMT offset with one hour for every 15 degrees east
+longitude, this relationship is not exact.
+</p>
+
+<p>
+Older versions of this package used a different naming scheme,
+and these older names are still supported.
+See the file '<code>backward</code>' for most of these older names
+(e.g., '<code>US/Eastern</code>' instead of '<code>America/New_York</code>').
+The other old-fashioned names still supported are
+'<code>WET</code>', '<code>CET</code>', '<code>MET</code>', and '<code>EET</code>' (see the file '<code>europe</code>').
+</p>
+
+<p>
+Older versions of this package defined legacy names that are
+incompatible with the first rule of location names, but which are
+still supported.  These legacy names are mostly defined in the file
+'<code>etcetera</code>'.  Also, the file '<code>backward</code>' defines the legacy names
+'<code>GMT0</code>', '<code>GMT-0</code>' and '<code>GMT+0</code>', and the file '<code>northamerica</code>' defines the
+legacy names '<code>EST5EDT</code>', '<code>CST6CDT</code>', '<code>MST7MDT</code>', and '<code>PST8PDT</code>'.
+</p>
+
+<p>
+Excluding '<code>backward</code>' should not affect the other data.  If
+'<code>backward</code>' is excluded, excluding '<code>etcetera</code>' should not affect the
+remaining data.
+</p>
+
+
+  </section>
+  <section>
+    <h2 id="abbreviations">Time zone abbreviations</h2>
+<p>
+When this package is installed, it generates time zone abbreviations
+like '<code>EST</code>' to be compatible with human tradition and POSIX.
+Here are the general rules used for choosing time zone abbreviations,
+in decreasing order of importance:
+<ul>
+  <li>
+       Use three or more characters that are ASCII alphanumerics or
+               '<code>+</code>' or '<code>-</code>'.
+               Previous editions of this database also used characters like
+               '<code> </code>' and '<code>?</code>', but these
+               characters have a special meaning to
+               the shell and cause commands like
+                       '<code>set `date`</code>'
+               to have unexpected effects.
+               Previous editions of this rule required upper-case letters,
+               but the Congressman who introduced Chamorro Standard Time
+               preferred "ChST", so lower-case letters are now allowed.
+               Also, POSIX from 2001 on relaxed the rule to allow
+               '<code>-</code>', '<code>+</code>',
+               and alphanumeric characters from the portable character set
+               in the current locale.  In practice ASCII alphanumerics and
+               '<code>+</code>' and '<code>-</code>' are safe in all locales.
+
+               In other words, in the C locale the POSIX extended regular
+               expression <code>[-+[:alnum:]]{3,}</code> should match
+               the abbreviation.
+               This guarantees that all abbreviations could have been
+               specified by a POSIX TZ string.
+  </li>
+  <li>
+       Use abbreviations that are in common use among English-speakers,
+               e.g. 'EST' for Eastern Standard Time in North America.
+               We assume that applications translate them to other languages
+               as part of the normal localization process; for example,
+               a French application might translate 'EST' to 'HNE'.
+  </li>
+  <li>
+       For zones whose times are taken from a city's longitude, use the
+               traditional <var>x</var>MT notation, e.g. 'PMT' for
+               Paris Mean Time.
+               The only name like this in current use is 'GMT'.
+  </li>
+  <li>
+       Use 'LMT' for local mean time of locations before the introduction
+               of standard time; see "<a href="#scope">Scope of the
+               tz database</a>".
+  </li>
+  <li>
+       If there is no common English abbreviation, use numeric offsets like
+               <code>-</code>05 and <code>+</code>0830 that are
+               generated by zic's <code>%z</code> notation.
+  </li>
+  <li>
+       Use current abbreviations for older timestamps to avoid confusion.
+               For example, in 1910 a common English abbreviation for UT +01
+               in central Europe was 'MEZ' (short for both "Middle European
+               Zone" and for "Mitteleuropäische Zeit" in German).  Nowadays
+               'CET' ("Central European Time") is more common in English, and
+               the database uses 'CET' even for circa-1910 timestamps as this
+               is less confusing for modern users and avoids the need for
+               determining when 'CET' supplanted 'MEZ' in common usage.
+  </li>
+  <li>
+       Use a consistent style in a zone's history.  For example, if a zone's
+               history tends to use numeric abbreviations and a particular
+               entry could go either way, use a numeric abbreviation.
+  </li>
+</ul>
+    [The remaining guidelines predate the introduction of <code>%z</code>.
+    They are problematic as they mean tz data entries invent
+    notation rather than record it.  These guidelines are now
+    deprecated and the plan is to gradually move to <code>%z</code> for
+    inhabited locations and to "<code>-</code>00" for uninhabited locations.]
+<ul>
+  <li>
+       If there is no common English abbreviation, abbreviate the English
+               translation of the usual phrase used by native speakers.
+               If this is not available or is a phrase mentioning the country
+               (e.g. "Cape Verde Time"), then:
+       <ul>
+         <li>
+               When a country is identified with a single or principal zone,
+                       append 'T' to the country's ISO code, e.g. 'CVT' for
+                       Cape Verde Time.  For summer time append 'ST';
+                       for double summer time append 'DST'; etc.
+         </li>
+         <li>
+               Otherwise, take the first three letters of an English place
+                       name identifying each zone and append 'T', 'ST', etc.
+                       as before; e.g. 'CHAST' for CHAtham Summer Time.
+         </li>
+       </ul>
+  </li>
+  <li>
+       Use UT (with time zone abbreviation '<code>-</code>00') for
+               locations while uninhabited.  The leading
+               '<code>-</code>' is a flag that the time
+               zone is in some sense undefined; this notation is
+               derived from Internet RFC 3339.
+  </li>
+</ul>
+<p>
+Application writers should note that these abbreviations are ambiguous
+in practice: e.g. 'CST' has a different meaning in China than
+it does in the United States.  In new applications, it's often better
+to use numeric UT offsets like '<code>-</code>0600' instead of time zone
+abbreviations like 'CST'; this avoids the ambiguity.
+</p>
+  </section>
+
+
+  <section>
+    <h2 id="accuracy">Accuracy of the tz database</h2>
+<p>
+The tz database is not authoritative, and it surely has errors.
+Corrections are welcome and encouraged; see the file CONTRIBUTING.
+Users requiring authoritative data should consult national standards
+bodies and the references cited in the database's comments.
+</p>
+
+<p>
+Errors in the tz database arise from many sources:
+</p>
+<ul>
+  <li>
+   The tz database predicts future timestamps, and current predictions
+   will be incorrect after future governments change the rules.
+   For example, if today someone schedules a meeting for 13:00 next
+   October 1, Casablanca time, and tomorrow Morocco changes its
+   daylight saving rules, software can mess up after the rule change
+   if it blithely relies on conversions made before the change.
+  </li>
+  <li>
+   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 zones would
+   be needed if the tz 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 into dozens
+   of entries, perhaps hundreds.  And in most of the world even this
+   approach would be misleading due to widespread disagreement or
+   indifference about what times should be observed.  In her 2015 book
+   <cite>The Global Transformation of Time, 1870-1950</cite>, Vanessa Ogle writes
+   "Outside of Europe and North America there was no system of time
+   zones at all, often not even a stable landscape of mean times,
+   prior to the middle decades of the twentieth century".  See:
+   Timothy Shenk, <a
+   href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanessa-ogle">Booked:
+   A Global History of Time</a>. <cite>Dissent</cite> 2015-12-17.
+  </li>
+  <li>
+   Most of the pre-1970 data entries come from unreliable sources, often
+   astrology books that lack citations and whose compilers evidently
+   invented entries when the true facts were unknown, without
+   reporting which entries were known and which were invented.
+   These books often contradict each other or give implausible entries,
+   and on the rare occasions when they are checked they are
+   typically found to be incorrect.
+  </li>
+  <li>
+   For the UK the tz database relies on years of first-class work done by
+   Joseph Myers and others; see
+   "<a href="https://www.polyomino.org.uk/british-time/">History of
+   legal time in Britain</a>".
+   Other countries are not done nearly as well.
+  </li>
+  <li>
+   Sometimes, different people in the same city would maintain clocks
+   that differed significantly.  Railway time was used by railroad
+   companies (which did not always agree with each other),
+   church-clock time was used for birth certificates, etc.
+   Often this was merely common practice, but sometimes it was set by law.
+   For example, from 1891 to 1911 the UT offset in France was legally
+   0:09:21 outside train stations and 0:04:21 inside.
+  </li>
+  <li>
+   Although a named location in the tz database stands for the
+   containing region, its pre-1970 data entries are often accurate for
+   only a small subset of that region.  For example, <code>Europe/London</code>
+   stands for the United Kingdom, but its pre-1847 times are valid
+   only for locations that have London's exact meridian, and its 1847
+   transition to GMT is known to be valid only for the L&amp;NW and the
+   Caledonian railways.
+  </li>
+  <li>
+   The tz database does not record the earliest time for which a zone'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 GMT was made the standard time, but the date of
+   standardization (1880-08-02) is not in the tz database, other than
+   in commentary.  For many zones the earliest time of validity is
+   unknown.
+  </li>
+  <li>
+   The tz database does not record a region's boundaries, and in many
+   cases the boundaries are not known.  For example, the zone
+   <code>America/Kentucky/Louisville</code> represents a region around
+   the city of
+   Louisville, the boundaries of which are unclear.
+  </li>
+  <li>
+   Changes that are modeled as instantaneous transitions in the tz
+   database were often spread out over hours, days, or even decades.
+  </li>
+  <li>
+   Even if the time is specified by law, locations sometimes
+   deliberately flout the law.
+  </li>
+  <li>
+   Early timekeeping practices, even assuming perfect clocks, were
+   often not specified to the accuracy that the tz database requires.
+  </li>
+  <li>
+   Sometimes historical timekeeping was specified more precisely
+   than what the tz database can handle.  For example, from 1909 to
+   1937 Netherlands clocks were legally UT +00:19:32.13, but the tz
+   database cannot represent the fractional second.
+  </li>
+  <li>
+   Even when all the timestamp transitions recorded by the tz database
+   are correct, the tz rules that generate them may not faithfully
+   reflect the historical rules.  For example, from 1922 until World
+   War II the UK moved clocks forward the day following the third
+   Saturday in April unless that was Easter, in which case it moved
+   clocks forward the previous Sunday.  Because the tz database has no
+   way to specify Easter, these exceptional years are entered as
+   separate tz Rule lines, even though the legal rules did not change.
+  </li>
+  <li>
+   The tz database models pre-standard time using the proleptic Gregorian
+   calendar and local mean time (LMT), but many people used other
+   calendars and other timescales.  For example, the Roman Empire used
+   the Julian calendar, and had 12 varying-length daytime hours with a
+   non-hour-based system at night.
+  </li>
+  <li>
+   Early clocks were less reliable, and data entries do not represent
+   clock error.
+  </li>
+  <li>
+   The tz database assumes Universal Time (UT) as an origin, even
+   though UT is not standardized for older timestamps.  In the tz
+   database commentary, UT denotes a family of time standards that
+   includes Coordinated Universal Time (UTC) along with other variants
+   such as UT1 and GMT, with days starting at midnight.  Although UT
+   equals UTC for modern timestamps, UTC was not defined until 1960,
+   so commentary uses the more-general abbreviation UT for timestamps
+   that might predate 1960.  Since UT, UT1, etc. disagree slightly,
+   and since pre-1972 UTC seconds varied in length, interpretation of
+   older timestamps can be problematic when subsecond accuracy is
+   needed.
+  </li>
+  <li>
+   Civil time was not based on atomic time before 1972, and we don't
+   know the history of earth's rotation accurately enough to map SI
+   seconds to historical solar time 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 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
+   href="https://eclipse.gsfc.nasa.gov/SEhelp/uncertainty2004.html">Uncertainty
+   in Delta T (ΔT)</a>.
+  </li>
+  <li>
+   The relationship between POSIX time (that is, UTC but ignoring leap
+   seconds) and UTC is not agreed upon after 1972.  Although the POSIX
+   clock officially stops during an inserted leap second, at least one
+   proposed standard has it jumping back a second instead; and in
+   practice POSIX clocks more typically either progress glacially during
+   a leap second, or are slightly slowed while near a leap second.
+  </li>
+  <li>
+   The tz database does not represent how uncertain its information is.
+   Ideally it would contain information about when data entries are
+   incomplete or dicey.  Partial temporal knowledge is a field of
+   active research, though, and it's not clear how to apply it here.
+  </li>
+</ul>
+<p>
+In short, many, perhaps most, of the tz database's pre-1970 and future
+timestamps are either wrong or misleading.  Any attempt to pass the
+tz database off as the definition of time should be unacceptable to
+anybody who cares about the facts.  In particular, the tz database's
+LMT offsets should not be considered meaningful, and should not prompt
+creation of zones merely because two locations differ in LMT or
+transitioned to standard time at different dates.
+</p>
+  </section>
+
+
+  <section>
+    <h2 id="functions">Time and date functions</h2>
+<p>
+The tz code contains time and date functions that are upwards
+compatible with those of POSIX.
+</p>
+
+<p>
+POSIX has the following properties and limitations.
+</p>
+<ul>
+  <li>
+    <p>
+       In POSIX, time display in a process is controlled by the
+       environment variable TZ.  Unfortunately, the POSIX TZ string takes
+       a form that is hard to describe and is error-prone in practice.
+       Also, POSIX TZ strings can't deal with other (for example, Israeli)
+       daylight saving time rules, or situations where more than two
+       time zone abbreviations are used in an area.
+    </p>
+    <p>
+      The POSIX TZ string takes the following form:
+    </p>
+    <p>
+      <var>stdoffset</var>[<var>dst</var>[<var>offset</var>][<code>,</code><var>date</var>[<code>/</code><var>time</var>]<code>,</code><var>date</var>[<code>/</code><var>time</var>]]]
+    </p>
+    <p>
+       where:
+    <dl>
+      <dt><var>std</var> and <var>dst</var></dt><dd>
+               are 3 or more characters specifying the standard
+               and daylight saving time (DST) zone names.
+               Starting with POSIX.1-2001, <var>std</var>
+               and <var>dst</var> may also be
+               in a quoted form like '<code>&lt;UTC+10&gt;</code>'; this allows
+               "<code>+</code>" and "<code>-</code>" in the names.
+      </dd>
+      <dt><var>offset</var></dt><dd>
+               is of the form
+               '<code>[&plusmn;]<var>hh</var>:[<var>mm</var>[:<var>ss</var>]]</code>'
+               and specifies the offset west of UT.  '<var>hh</var>'
+               may be a single digit; 0&le;<var>hh</var>&le;24.
+               The default DST offset is one hour ahead of standard time.
+      </dd>
+      <dt><var>date</var>[<code>/</code><var>time</var>]<code>,</code><var>date</var>[<code>/</code><var>time</var>]</dt><dd>
+               specifies the beginning and end of DST.  If this is absent,
+               the system supplies its own rules for DST, and these can
+               differ from year to year; typically US DST rules are used.
+      </dd>
+      <dt><var>time</var></dt><dd>
+               takes the form
+               '<var>hh</var><code>:</code>[<var>mm</var>[<code>:</code><var>ss</var>]]'
+               and defaults to 02:00.
+               This is the same format as the offset, except that a
+               leading '<code>+</code>' or '<code>-</code>' is not allowed.
+      </dd>
+      <dt><var>date</var></dt><dd>
+               takes one of the following forms:
+       <dl>
+         <dt>J<var>n</var> (1&le;<var>n</var>&le;365)</dt><dd>
+                       origin-1 day number not counting February 29
+          </dd>
+         <dt><var>n</var> (0&le;<var>n</var>&le;365)</dt><dd>
+                       origin-0 day number counting February 29 if present
+          </dd>
+         <dt><code>M</code><var>m</var><code>.</code><var>n</var><code>.</code><var>d</var> (0[Sunday]&le;<var>d</var>&le;6[Saturday], 1&le;<var>n</var>&le;5, 1&le;<var>m</var>&le;12)</dt><dd>
+                       for the <var>d</var>th day of
+                       week <var>n</var> of month <var>m</var> of the
+                       year, where week 1 is the first week in which
+                       day <var>d</var> appears, and '<code>5</code>'
+                       stands for the last week in which
+                       day <var>d</var> appears
+                       (which may be either the 4th or 5th week).
+                       Typically, this is the only useful form;
+                       the <var>n</var>
+                       and <code>J</code><var>n</var> forms are
+                       rarely used.
+         </dd>
+</dl>
+</dd>
+</dl>
+       Here is an example POSIX TZ string for New Zealand after 2007.
+       It says that standard time (NZST) is 12 hours ahead of UTC,
+       and that daylight saving time (NZDT) is observed from September's
+       last Sunday at 02:00 until April's first Sunday at 03:00:
+
+        <pre><code>TZ='NZST-12NZDT,M9.5.0,M4.1.0/3'</code></pre>
+
+       This POSIX TZ string is hard to remember, and mishandles some
+       timestamps before 2008.  With this package you can use this
+       instead:
+
+       <pre><code>TZ='Pacific/Auckland'</code></pre>
+  </li>
+  <li>
+       POSIX does not define the exact meaning of TZ values like
+       "<code>EST5EDT</code>".
+       Typically the current US DST rules are used to interpret such values,
+       but this means that the US DST rules are compiled into each program
+       that does time conversion.  This means that when US time conversion
+       rules change (as in the United States in 1987), all programs that
+       do time conversion must be recompiled to ensure proper results.
+  </li>
+  <li>
+       The TZ environment variable is process-global, which makes it hard
+       to write efficient, thread-safe applications that need access
+       to multiple time zones.
+  </li>
+  <li>
+       In POSIX, there's 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 used only at certain
+       times &ndash;
+       without regard to whether the user has fiddled the TZ environment
+       variable.  While an administrator can "do everything in UTC" 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.)
+  </li>
+  <li>
+       POSIX provides no convenient and efficient way to determine the UT
+       offset and time zone abbreviation of arbitrary timestamps,
+       particularly for time zone settings that do not fit into the
+       POSIX model.
+  </li>
+  <li>
+       POSIX requires that systems ignore leap seconds.
+  </li>
+  <li>
+       The tz code attempts to support all the <code>time_t</code>
+       implementations allowed by POSIX.  The <code>time_t</code>
+       type represents a nonnegative count of
+       seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds.
+       In practice, <code>time_t</code> is usually a signed 64- or
+       32-bit integer; 32-bit signed <code>time_t</code> values stop
+       working after 2038-01-19 03:14:07 UTC, so
+       new implementations these days typically use a signed 64-bit integer.
+       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, and POSIX.1-2013 and the tz code both
+       require <code>time_t</code>
+       to be an integer type.
+  </li>
+</ul>
+<p>
+These are the extensions that have been made to the POSIX functions:
+</p>
+<ul>
+  <li>
+    <p>
+       The TZ environment variable is used in generating the name of a file
+       from which time zone information is read (or is interpreted a la
+       POSIX); TZ is no longer constrained to be a three-letter time zone
+       name followed by a number of hours and an optional three-letter
+       daylight time zone name.  The daylight saving time rules to be used
+       for a particular time zone are encoded in the time zone file;
+       the format of the file allows U.S., Australian, and other rules to be
+       encoded, and allows for situations where more than two time zone
+       abbreviations are used.
+    </p>
+    <p>
+       It was recognized that allowing the TZ environment variable to
+       take on values such as '<code>America/New_York</code>' might
+       cause "old" programs
+       (that expect TZ to have a certain form) to operate incorrectly;
+       consideration was given to using some other environment variable
+       (for example, TIMEZONE) to hold the string used to generate the
+       time zone information file name.  In the end, however, it was decided
+       to continue using TZ: it is widely used for time zone purposes;
+       separately maintaining both TZ and TIMEZONE seemed a nuisance;
+       and systems where "new" forms of TZ might cause problems can simply
+       use TZ values such as "<code>EST5EDT</code>" which can be used both by
+       "new" programs (a la POSIX) and "old" programs (as zone names and
+       offsets).
+    </p>
+</li>
+<li>
+       The code supports platforms with a UT offset member
+       in <code>struct tm</code>,
+       e.g., <code>tm_gmtoff</code>.
+</li>
+<li>
+       The code supports platforms with a time zone abbreviation member in
+       <code>struct tm</code>, e.g., <code>tm_zone</code>.
+</li>
+<li>
+       Since the TZ environment variable can now be used to control time
+       conversion, the <code>daylight</code>
+       and <code>timezone</code> variables are no longer needed.
+       (These variables are defined and set by <code>tzset</code>;
+       however, their values will not be used
+       by <code>localtime</code>.)
+</li>
+<li>
+       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 zones.  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 like <code>localtime_r</code>
+       and <code>mktime</code> with an extra
+       <code>timezone_t</code> argument.  The functions were inspired
+       by NetBSD.
+</li>
+<li>
+       A function <code>tzsetwall</code> has been added to arrange
+       for the system's
+       best approximation to local wall clock time to be delivered by
+       subsequent calls to <code>localtime</code>.  Source code for portable
+       applications that "must" run on local wall clock time should call
+       <code>tzsetwall</code>; if such code is moved to "old" systems that don't
+       provide tzsetwall, you won't be able to generate an executable program.
+       (These time zone functions also arrange for local wall clock time to be
+       used if tzset is called &ndash; directly or indirectly &ndash;
+       and there's no TZ
+       environment variable; portable applications should not, however, rely
+       on this behavior since it's not the way SVR2 systems behave.)
+</li>
+<li>
+       Negative <code>time_t</code> values are supported, on systems
+       where <code>time_t</code> is signed.
+</li>
+<li>
+       These functions can account for leap seconds, thanks to Bradley White.
+</li>
+</ul>
+<p>
+Points of interest to folks with other systems:
+</p>
+<ul>
+  <li>
+       Code compatible with this package is already part of many platforms,
+       including GNU/Linux, Android, the BSDs, Chromium OS, Cygwin, AIX, iOS,
+       BlackBery 10, macOS, Microsoft Windows, OpenVMS, and Solaris.
+       On such hosts, the primary use of this package
+       is to update obsolete time zone rule tables.
+       To do this, you may need to compile the time zone compiler
+       '<code>zic</code>' supplied with this package instead of using
+       the system '<code>zic</code>', since the format
+       of <code>zic</code>'s input is occasionally extended, and a
+       platform may still be shipping an older <code>zic</code>.
+  </li>
+  <li>
+       The UNIX Version 7 <code>timezone</code> function is not
+       present in this package;
+       it's impossible to reliably map timezone's arguments (a "minutes west
+       of GMT" value and a "daylight saving time in effect" flag) to a
+       time zone abbreviation, and we refuse to guess.
+       Programs that in the past used the timezone function may now examine
+       <code>localtime(&amp;clock)-&gt;tm_zone</code>
+       (if <code>TM_ZONE</code> is defined) or
+       <code>tzname[localtime(&amp;clock)-&gt;tm_isdst]</code>
+       (if <code>HAVE_TZNAME</code> is defined)
+       to learn the correct time zone abbreviation to use.
+  </li>
+  <li>
+       The 4.2BSD <code>gettimeofday</code> function is not used in
+       this package.
+       This formerly let users obtain the current UTC offset and DST flag,
+       but this functionality was removed in later versions of BSD.
+  </li>
+  <li>
+       In SVR2, time conversion fails for near-minimum or near-maximum
+       <code>time_t</code> values when doing conversions for places
+       that don't use UT.
+       This package takes care to do these conversions correctly.
+       A comment in the source code tells how to get compatibly wrong
+       results.
+  </li>
+</ul>
+<p>
+The functions that are conditionally compiled
+if <code>STD_INSPIRED</code> is defined
+should, at this point, be looked on primarily as food for thought.  They are
+not in any sense "standard compatible" &ndash; some are not, in fact,
+specified in <em>any</em> standard.  They do, however, represent responses of
+various authors to
+standardization proposals.
+</p>
+
+<p>
+Other time conversion proposals, in particular the one developed by folks at
+Hewlett Packard, 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
+functions.  Rather, their absence reflects the decision to make this package
+contain valid extensions to POSIX, to ensure its broad acceptability.  If
+more powerful time conversion functions can be standardized, so much the
+better.
+</p>
+  </section>
+
+
+  <section>
+    <h2 id="stability">Interface stability</h2>
+<p>
+The tz code and data supply the following interfaces:
+</p>
+<ul>
+  <li>
+   A set of zone names as per "<a href="#naming">Names of time zone
+   rules</a>" above.
+  </li>
+  <li>
+   Library functions described in "<a href="#functions">Time and date
+   functions</a>" above.
+  </li>
+  <li>
+   The programs <code>tzselect</code>, <code>zdump</code>,
+   and <code>zic</code>, documented in their man pages.
+  </li>
+  <li>
+   The format of <code>zic</code> input files, documented in
+   the <code>zic</code> man page.
+  </li>
+  <li>
+   The format of <code>zic</code> output files, documented in
+   the <code>tzfile</code> man page.
+  </li>
+  <li>
+   The format of zone table files, documented in <code>zone1970.tab</code>.
+  </li>
+  <li>
+   The format of the country code file, documented in <code>iso3166.tab</code>.
+  </li>
+  <li>
+   The version number of the code and data, as the first line of
+   the text file '<code>version</code>' in each release.
+  </li>
+</ul>
+<p>
+Interface changes in a release attempt to preserve compatibility with
+recent releases.  For example, tz data files typically do not rely on
+recently-added <code>zic</code> features, so that users can run
+older <code>zic</code> versions to process newer data
+files.  <a href="tz-link.htm">Sources for time zone and daylight
+saving time data</a> describes how
+releases are tagged and distributed.
+</p>
+
+<p>
+Interfaces not listed above are less stable.  For example, users
+should not rely on particular UT offsets or abbreviations for
+timestamps, as data entries are often based on guesswork and these
+guesses may be corrected or improved.
+</p>
+  </section>
+
+
+  <section>
+    <h2 id="calendar">Calendrical issues</h2>
+<p>
+Calendrical issues are a bit out of scope for a time zone database,
+but they indicate the sort of problems that we would run into if we
+extended the time zone database further into the past.  An excellent
+resource in this area is Nachum Dershowitz and Edward M. Reingold,
+<cite><a href="https://www.cs.tau.ac.il/~nachum/calendar-book/third-edition/">Calendrical
+Calculations: Third Edition</a></cite>, Cambridge University Press (2008).
+Other information and sources are given in the file '<samp>calendars</samp>'
+in the tz distribution.  They sometimes disagree.
+</p>
+  </section>
+
+
+  <section>
+    <h2 id="planets">Time and time zones on other planets</h2>
+<p>
+Some people's work schedules use Mars time.  Jet Propulsion Laboratory
+(JPL) coordinators have kept Mars time on and off at least since 1997
+for the Mars Pathfinder mission.  Some of their family members have
+also adapted to Mars time.  Dozens of special Mars watches were built
+for JPL workers who kept Mars time during the Mars Exploration
+Rovers mission (2004).  These timepieces look like normal Seikos and
+Citizens but use Mars seconds rather than terrestrial seconds.
+</p>
+
+<p>
+A Mars solar day is called a "sol" and has a mean period equal to
+about 24 hours 39 minutes 35.244 seconds in terrestrial time.  It is
+divided into a conventional 24-hour clock, so each Mars second equals
+about 1.02749125 terrestrial seconds.
+</p>
+
+<p>
+The prime meridian of Mars goes through the center of the crater
+Airy-0, named in honor of the British astronomer who built the
+Greenwich telescope that defines Earth's prime meridian.  Mean solar
+time on the Mars prime meridian is called Mars Coordinated Time (MTC).
+</p>
+
+<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.
+For example, the Mars Exploration Rover project (2004) defined two
+time zones "Local Solar Time A" and "Local Solar Time B" for its two
+missions, each zone designed so that its time equals local true solar
+time at approximately the middle of the nominal mission.  Such a "time
+zone" is not particularly suited for any application other than the
+mission itself.
+</p>
+
+<p>
+Many calendars have been proposed for Mars, but none have achieved
+wide acceptance.  Astronomers often use Mars Sol Date (MSD) which is a
+sequential count of Mars solar days elapsed since about 1873-12-29
+12:00 GMT.
+</p>
+
+<p>
+In our solar system, Mars is the planet with time and calendar most
+like Earth's.  On other planets, Sun-based time and calendars would
+work quite differently.  For example, although Mercury's sidereal
+rotation period is 58.646 Earth days, Mercury revolves around the Sun
+so rapidly that an observer on Mercury's equator would see a sunrise
+only every 175.97 Earth days, i.e., a Mercury year is 0.5 of a Mercury
+day.  Venus is more complicated, partly because its rotation is
+slightly retrograde: its year is 1.92 of its days.  Gas giants like
+Jupiter are trickier still, as their polar and equatorial regions
+rotate at different rates, so that the length of a day depends on
+latitude.  This effect is most pronounced on Neptune, where the day is
+about 12 hours at the poles and 18 hours at the equator.
+</p>
+
+<p>
+Although the tz database does not support time on other planets, it is
+documented here in the hopes that support will be added eventually.
+</p>
+
+<p>
+Sources:
+</p>
+<ul>
+  <li>
+Michael Allison and Robert Schmunk,
+"<a href="https://www.giss.nasa.gov/tools/mars24/help/notes.html">Technical
+Notes on Mars Solar Time as Adopted by the Mars24 Sunclock</a>"
+(2012-08-08).
+  </li>
+  <li>
+Jia-Rui Chong,
+"<a href="http://articles.latimes.com/2004/jan/14/science/sci-marstime14">Workdays
+Fit for a Martian</a>", Los Angeles Times
+(2004-01-14), pp A1, A20-A21.
+  </li>
+  <li>
+Tom Chmielewski,
+"<a href="https://www.theatlantic.com/technology/archive/2015/02/jet-lag-is-worse-on-mars/386033/">Jet
+Lag Is Worse on Mars</a>", The Atlantic (2015-02-26)
+  </li>
+  <li>
+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).
+  </li>
+</ul>
+  </section>
+
+  <footer>
+    <hr>
+This file is in the public domain, so clarified as of 2009-05-17 by
+Arthur David Olson.
+  </footer>
+</body>
+</html>
index 377a384..920d6e7 100644 (file)
@@ -1,9 +1,7 @@
-<!DOCTYPE html
-PUBLIC "-//W3C//DTD HTML 4.01//EN"
-"http://www.w3.org/TR/html4/strict.dtd">
-<html>
+<!DOCTYPE html>
+<html lang="en">
 <head>
-<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
+<meta charset="UTF-8">
 <title>Time and the Arts</title>
 </head>
 <body>
@@ -20,8 +18,13 @@ Arizona's daylight-saving enclaves quite well.</li>
 with Time &amp; Timezones &ndash; Computerphile</a>" (2013; 10:12) delves
 into problems that programmers have with timekeeping.</li>
 <li>
-"About Time" (1962; 53 minutes) is part of the the
+<a href="https://www.rferl.org/a/28375932.html">All The Time In The World:
+Explaining The Mysteries Of Time Zones</a>" (2017; 2:15)
+briefly says why France has more time zones than Russia.
+<li>
+"About Time" (1962; 53 minutes) is part of the
 Bell Science extravaganza, with Frank Baxter, Richard Deacon, and Les Tremayne.
+Its advisor was Richard Feynman, and it was voiced by Mel Blanc.
 (<a href="http://www.imdb.com/title/tt0154110/">IMDb entry</a>.)</li>
 </ul>
 <h2>Movies</h2>
@@ -172,7 +175,7 @@ reading a paper.
 Available versions include
 <a href="http://www.literature.org/Works/Jules-Verne/eighty">an English
 translation</a>, and
-<a href="http://fourmilab.ch/etexts/www/tdm80j">the original French</a>
+<a href="https://fourmilab.ch/etexts/www/tdm80j">the original French</a>
 "with illustrations from the original 1873 French-language edition".
 </li>
 <li>
@@ -221,7 +224,7 @@ arranged by Russ Long and Karrin Allyson"</td></tr>
 <tr><td>ADO Rating</td><td>1 star</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/i-didnt-know-about-you-mw0000618657">AMG Rating</a></td><td>4 stars</td></tr>
 <tr><td>Penguin Rating</td><td>3.5 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Kevin Mahogany</td></tr>
 <tr><td>CD</td><td>Double Rainbow</td></tr>
 <tr><td>Copyright Date</td><td>1993</td></tr>
@@ -236,7 +239,7 @@ Lewis Nash, drums</td></tr>
 <tr><td>ADO Rating</td><td>1.5 stars</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/double-rainbow-mw0000620371">AMG Rating</a></td><td>3 stars</td></tr>
 <tr><td>Penguin Rating</td><td>3 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Joe Williams</td></tr>
 <tr><td>CD</td><td>Here's to Life</td></tr>
 <tr><td>Copyright Date</td><td>1994</td></tr>
@@ -250,7 +253,7 @@ Telarc, "Triple Play" (CD-83461)</td></tr>
 <tr><td>ADO Rating</td><td>black dot</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/heres-to-life-mw0000623648">AMG Rating</a></td><td>2 stars</td></tr>
 <tr><td>Penguin Rating</td><td>3 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Charles Fambrough</td></tr>
 <tr><td>CD</td><td>Keeper of the Spirit</td></tr>
 <tr><td>Copyright Date</td><td>1995</td></tr>
@@ -283,7 +286,7 @@ Tom Waits' "Purple Avenue"</td></tr>
 <tr><td>ADO Rating</td><td>2.5 stars</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/blame-it-on-my-youth-mw0000274303">AMG Rating</a></td><td>3 stars</td></tr>
 <tr><td>Penguin Rating</td><td>unrated</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Milt Hinton</td></tr>
 <tr><td>CD</td><td>Old Man Time</td></tr>
 <tr><td>Copyright Date</td><td>1990</td></tr>
@@ -314,7 +317,7 @@ is available.</td></tr>
 <tr><td>ADO Rating</td><td>3 stars</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/old-man-time-mw0000269353">AMG Rating</a></td><td>4.5 stars</td></tr>
 <tr><td>Penguin Rating</td><td>3 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Alan Broadbent</td></tr>
 <tr><td>CD</td><td>Pacific Standard Time</td></tr>
 <tr><td>Copyright Date</td><td>1995</td></tr>
@@ -328,7 +331,7 @@ Frank Gibson, Jr., drums</td></tr>
 <tr><td>ADO Rating</td><td>1 star</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/pacific-standard-time-mw0000645433">AMG Rating</a></td><td>4 stars</td></tr>
 <tr><td>Penguin Rating</td><td>3.5 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Anthony Braxton/Richard Teitelbaum</td></tr>
 <tr><td>CD</td><td>Silence/Time Zones</td></tr>
 <tr><td>Copyright Date</td><td>1996</td></tr>
@@ -342,7 +345,7 @@ Leroy Jenkins, violin and miscellaneous instruments;
 Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
 <tr><td>ADO Rating</td><td>black dot</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/silence-time-zones-mw0000595735">AMG Rating</a></td><td>4 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Charles Gayle</td></tr>
 <tr><td>CD</td><td>Time Zones</td></tr>
 <tr><td>Copyright Date</td><td>2006</td></tr>
@@ -352,7 +355,7 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
 <tr><td>Personnel</td><td>Charles Gayle, piano</td></tr>
 <tr><td>ADO Rating</td><td>1 star</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/time-zones-mw0000349642">AMG Rating</a></td><td>4.5 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>The Get Up Kids</td></tr>
 <tr><td>CD</td><td>Eudora</td></tr>
 <tr><td>Copyright Date</td><td>2001</td></tr>
@@ -361,7 +364,7 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
 <tr><td>Total Time</td><td>65:12</td></tr>
 <tr><td>Notes</td><td>Includes the song "Central Standard Time." Thanks to Colin Bowern for this information.</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/eudora-mw0000592063">AMG Rating</a></td><td>2.5 stars</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>Coldplay</td></tr>
 <tr><td>Song</td><td>Clocks</td></tr>
@@ -373,7 +376,7 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
 Grammy Awards. Co-written and performed by Chris Martin,
 great-great-grandson of DST inventor William Willett. The song's first
 line is "Lights go out and I can't be saved".</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>Jaime Guevara</td></tr>
 <tr><td>Song</td><td><a
@@ -385,7 +388,7 @@ hora es</a></td></tr>
 (1992&ndash;3). Its lyrics include "Amanec&iacute;a en mitad de la noche, los
 guaguas iban a clase sin sol" ("It was dawning in the middle of the
 night, the buses went to class without sun").
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>Irving Kahal and Harry Richman</td></tr>
 <tr><td>Song</td><td>There Ought to be a Moonlight Saving Time</td></tr>
@@ -396,7 +399,7 @@ and many others. The phrase "Moonlight saving time" also appears in
 the 1995 country song "Not Enough Hours in the Night" written by Aaron
 Barker, Kim Williams and Rob Harbin and performed by Doug
 Supernaw.</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>The Microscopic Septet</td></tr>
 <tr><td>CD</td><td>Lobster Leaps In</td></tr>
@@ -408,7 +411,7 @@ Supernaw.</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/lobster-leaps-in-mw0000794929">AMG Rating</a></td><td>3.5 stars</td></tr>
 <tr><td>ADO Rating</td><td>2 stars</td></tr>
 
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>Bob Dylan</td></tr>
 <tr><td>CD</td><td>The Times They Are a-Changin'</td></tr>
@@ -419,7 +422,7 @@ Supernaw.</td></tr>
 <tr><td><a href="http://www.allmusic.com/album/the-times-they-a-changin-mw0000202344">AMG Rating</a></td><td>4.5 stars</td></tr>
 <tr><td>ADO Rating</td><td>1.5 stars</td></tr>
 <tr><td>Notes<td>The title song is also available on "Bob Dylan's Greatest Hits" and "The Essential Bob Dylan."</td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 
 <tr><td>Artist</td><td>Luciana Souza</td></tr>
 <tr><td>CD</td><td>Tide</td></tr>
@@ -432,7 +435,7 @@ Supernaw.</td></tr>
 <tr><td>Notes<td>Includes the song "Fire and Wood" with the lyric
 "The clocks were turned back you remember/Think it's still November."
 </td></tr>
-<tr><td>&nbsp;</td></tr>
+<tr><td>&nbsp;</td><td></td></tr>
 <tr><td>Artist</td><td>Ken Nordine</td></tr>
 <tr><td>CD</td><td>You're Getting Better: The Word Jazz Dot Masters</td></tr>
 <tr><td>Copyright Date</td><td>2005</td></tr>
@@ -453,9 +456,10 @@ The webcomic <em>xkcd</em> has the strip
 "<a href='https://xkcd.com/1061/'>EST</a>" (2012-05-28),
 "<a href='https://xkcd.com/1179/'>ISO 8601</a>" (2013-02-27),
 "<a href='https://xkcd.com/1335/'>Now</a>" (2014-02-26),
-"<a href='https://xkcd.com/1655/'>Doomsday Clock</a>" (2016-03-14), and
+"<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).
+(2017-02-15), and
+"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30).
 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>
@@ -465,9 +469,12 @@ href="http://www.gocomics.com/pearlsbeforeswine/2016/11/06"><em>Pearls
 Before Swine</em> (2016-11-06)</a>.
 </li>
 <li>
-The syndicated comic strip <em>Dilbert</em> featured an
-<a href='http://dilbert.com/strip/1998-03-14'>example of
-time zone humor</a> on 1998-03-14.
+Stonehenge is abandoned in <a
+href='http://www.gocomics.com/nonsequitur/2017/03/12'><em>Non Sequitur</em>
+(2017-03-12)</a>.
+<li>
+The boss freaks out in <a
+href='http://dilbert.com/strip/1998-03-14'><em>Dilbert</em> (1998-03-14)</a>.
 </li>
 <li>
 Peppermint Patty: "What if the world comes to an end tonight, Marcie?"
@@ -541,6 +548,22 @@ yesterday daylight [saving] time ended. Right now it's basically
 midnight." (Conan O'Brien on the 2010-11-08 premiere of <em>Conan</em>.)
 </li>
 <li>
+"The best method, I told folks, was to hang a large clock high on a
+barn wall where all the cows could see it. If you have Holsteins, you
+will need to use an analog clock." (Jerry Nelson, <a
+href="http://www.agriculture.com/family/farm-humor/how-to-adjust-dairy-cows-to-daylight-savings-time">How
+to adjust dairy cows to daylight saving time</a>", <em>Successful Farming</em>,
+2017-10-09.)
+</li>
+<li>
+"And now, driving to California, I find that I must enter a password
+in order to change the time zone on my laptop clock. Evidently,
+someone is out to mess up my schedule and my clock must be secured."
+(Garrison Keillor,
+"<a href="http://www.garrisonkeillor.com/weve-never-been-here-before/">We've
+never been here before</a>", 2017-08-22)
+</li>
+<li>
 "Well, in my time zone that's all the time I have,
 but maybe in your time zone I haven't finished yet. So stay tuned!"
 (Goldie Hawn, <em>Rowan &amp; Martin's Laugh-In</em> No. 65, 1970-03-09)
index a94759e..6007c5e 100644 (file)
@@ -2,7 +2,10 @@
        PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
 <html>
-<head><title>How to Read the tz Database</title></head>
+<head>
+<title>How to Read the tz Database</title>
+<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
+</head>
 <body>
 <h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
 Database</a> Source Files</h2>
@@ -519,7 +522,7 @@ 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
 &ldquo;HST&rdquo; for &ldquo;Hawaii standard time&rdquo; even though the
-<a href="http://www.law.cornell.edu/uscode/html/uscode15/usc_sec_15_00000263----000-.html">legal</a>
+<a href="https://www.law.cornell.edu/uscode/text/15/263">legal</a>
 name for that time zone is &ldquo;Hawaii-Aleutian standard time.&rdquo;
 This author has read that there are also some places in Australia where
 popular time zone names differ from the legal ones.
@@ -531,7 +534,7 @@ the abbreviations. They are intended to be the values returned through the
 <a href="https://en.wikipedia.org/wiki/C_(programming_language)">C</a>&rsquo;s
 <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html"><code>strftime</code></a>
 function in the
-<a href="http://www.chemie.fu-berlin.de/chemnet/use/info/libc/libc_19.html#SEC324">&ldquo;C&rdquo; locale</a>.
+<a href="http://kirste.userpage.fu-berlin.de/chemnet/use/info/libc/libc_19.html#SEC324">&ldquo;C&rdquo; locale</a>.
 
 <li>If there is no generally-accepted abbreviation for a time zone,
 a numeric offset is used instead, e.g., <code>+07</code> for 7 hours
index e9aed38..e7a7c8f 100644 (file)
@@ -1,22 +1,8 @@
-<!DOCTYPE html
-       PUBLIC "-//W3C//DTD HTML 4.01//EN"
-       "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
+<!DOCTYPE html>
+<html lang="en">
+<head>
 <title>Sources for time zone and daylight saving time data</title>
-<link rel="schema.DC" href="http://purl.org/DC/elements/1.1/">
-<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
-<meta name="DC.Title"
- content="Sources for time zone and daylight saving time data">
-<meta name="DC.Creator" content="Eggert, Paul">
-<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2017-02-28">
-<meta name="DC.Description"
- content="Sources of information about time zones and daylight saving time">
-<meta name="DC.Identifier"
- content="https://www.iana.org/time-zones/repository/tz-link.htm">
-<meta name="Keywords"
- content="database,daylight saving,DST,time zone,timezone,tz,zoneinfo">
+<meta charset="UTF-8">
 </head>
 <body>
 <h1>Sources for time zone and daylight saving time data</h1>
@@ -51,21 +37,22 @@ C Library</a> (used in
 <abbr title="Operating System">OS</abbr></a>,
 <a href="https://www.freebsd.org">Free<abbr
 title="Berkeley Software Distribution">BSD</abbr></a>,
-<a href="http://netbsd.org">Net<abbr>BSD</abbr></a>,
-<a href="http://www.openbsd.org">Open<abbr>BSD</abbr></a>,
-<a href="http://www.chromium.org/chromium-os">Chromium OS</a>,
+<a href="https://netbsd.org">Net<abbr>BSD</abbr></a>,
+<a href="https://www.openbsd.org">Open<abbr>BSD</abbr></a>,
+<a href="https://www.chromium.org/chromium-os">Chromium OS</a>,
 <a href="https://cygwin.com">Cygwin</a>,
 <a href="http://www.delorie.com/djgpp/"><abbr
 title="DJ's GNU Programming Platform">DJGPP</abbr></a>,
 <a href="https://en.wikipedia.org/wiki/MINIX">MINIX</a>,
+<a href="https://www.mysql.com">MySQL</a>,
 <a href="https://en.wikipedia.org/wiki/WebOS"><abbr
 title="Web Operating System">webOS</abbr></a>,
-<a href="http://ibm.com/aix"><abbr
+<a href="https://ibm.com/aix"><abbr
 title="Advanced Interactive eXecutive">AIX</abbr></a>,
 <a href="https://en.wikipedia.org/wiki/BlackBerry_10">BlackBerry 10</a>,
-<a href="http://www.apple.com/ios/"><abbr
+<a href="https://www.apple.com/ios/"><abbr
 title="iPhone OS">iOS</abbr></a>,
-<a href="http://www.apple.com/macos/">macOS</a>,
+<a href="https://www.apple.com/macos/">macOS</a>,
 <a href="https://www.microsoft.com/en-us/windows">Microsoft Windows</a>,
 <a href="https://www.hpe.com/info/openvms">Open<abbr
 title="Virtual Memory System">VMS</abbr></a>,
@@ -104,6 +91,7 @@ Universal Time</a> (<abbr>UTC</abbr>).
 The database also records when daylight saving time was in use,
 along with some time zone abbreviations such as <abbr>EST</abbr>
 for Eastern Standard Time in the <abbr>US</abbr>.</p>
+<h2 id="download">Downloading the <code><abbr>tz</abbr></code> database</h2>
 <p>
 The following <a
 href="https://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
@@ -163,19 +151,46 @@ location.</p>
 <p>
 The <code><abbr>tz</abbr></code> code and data
 are by no means authoritative. If you find errors, please
-send changes to the <a href="mailto:tz@iana.org">time zone
-mailing list</a>. You can also <a
+send changes to <a href="mailto:tz@iana.org"><code>tz@iana.org</code></a>,
+the time zone mailing list. You can also <a
 href="https://mm.icann.org/mailman/listinfo/tz">subscribe</a> to it
 and browse the <a
 href="https://mm.icann.org/pipermail/tz/">archive of old
 messages</a>.</p>
 <p>
 If your government plans to change its time zone boundaries or
-daylight saving rules, let the mailing list know well in advance. With
+daylight saving rules, inform <code>tz@iana.org</code> well in
+advance, as this will coordinate updates to many cell phones,
+computers, and other devices around the world. With
 less than a year's notice there is a good chance that some
 computer-based clocks will operate incorrectly after the change, due
 to delays in propagating updates to software and data. The shorter
-the notice, the more likely clock problems will arise.
+the notice, the more likely clock problems will arise; see "<a
+href="https://codeofmatt.com/2016/04/23/on-the-timing-of-time-zone-changes/">On
+the Timing of Time Zone Changes</a>" for examples.
+</p>
+<p>
+Changes to the <code><abbr>tz</abbr></code> code and data are often
+propagated to clients via operating system updates, so
+client <code><abbr>tz</abbr></code> data can often be corrected by
+applying these updates. With GNU/Linux and similar systems, if your
+maintenance provider has not yet adopted the
+latest <code><abbr>tz</abbr></code> data, you can often short-circuit
+the process by tailoring the generic instructions in
+the <code><abbr>tz</abbr> README</code> file and installing the latest
+data yourself. System-specific instructions for installing the
+latest <code><abbr>tz</abbr></code> data have also been published
+for <a href="https://www.ibm.com/developerworks/aix/library/au-aix-olson-time-zone/index.html"><abbr>AIX</abbr></a>,
+<a
+href="http://userguide.icu-project.org/datetime/timezone"><abbr
+title="International Components for Unicode">ICU</abbr></a>,
+<a href="https://developer.ibm.com/javasdk/support/dst/jtzu/"><abbr>IBM</abbr></a>
+and <a
+href="http://www.oracle.com/technetwork/java/javase/tzupdater-readme-136440.html">Oracle</a>
+Java, <a href="http://www.joda.org/joda-time/tz_update.html">Joda-Time</a>, <a
+href="https://dev.mysql.com/doc/refman/en/time-zone-support.html">MySQL</a>,
+and <a
+href="http://nodatime.org/userguide/tzdb">Noda Time</a> (see below).
 </p>
 <p>Sources for the <code><abbr>tz</abbr></code> database are
 <a href="https://en.wikipedia.org/wiki/UTF-8"><abbr
@@ -186,19 +201,22 @@ title="linefeed">LF</abbr></a>,
 which can be modified by common text editors such
 as <a href="https://www.gnu.org/software/emacs/">GNU Emacs</a>,
 <a href="https://wiki.gnome.org/Apps/Gedit">gedit</a>, and
-<a href="http://www.vim.org">vim</a>. One
-editor has a package to simplify editing further:</p>
-<ul>
-<li><a href="https://packagecontrol.io/packages/zoneinfo">Sublime
-zoneinfo</a> is a <a href="http://www.sublimetext.com">Sublime
-Text</a> package for syntax highlighting <code><abbr>tz</abbr></code>
-source files.</li>
-</ul>
+<a href="http://www.vim.org">vim</a>.
+Specialized source-file editing can be done via the
+<a href="https://packagecontrol.io/packages/zoneinfo">Sublime
+zoneinfo</a> package for <a
+href="https://www.sublimetext.com">Sublime Text</a> and the <a
+href="https://marketplace.visualstudio.com/items?itemName=gilmoreorless.vscode-zoneinfo">VSCode
+zoneinfo</a> extension for <a href="https://code.visualstudio.com">Visual
+Studio Code</a>.
+</p>
 <p>
 For further information about updates, please see
 <a href="https://tools.ietf.org/html/rfc6557">Procedures for
 Maintaining the Time Zone Database</a> (Internet <abbr
-title="Request For Comments">RFC</abbr> 6557).</p>
+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>.
+</p>
 <h2 id="commentary">Commentary on the <code><abbr>tz</abbr></code> database</h2>
 <ul>
 <li>The article
@@ -208,11 +226,6 @@ an encyclopedic summary.</li>
 tz Database Source Files</a> explains the <code><abbr>tz</abbr></code>
 database format.</li>
 <li><a
-href="http://codeofmatt.com/2016/04/23/on-the-timing-of-time-zone-changes/">On
-the Timing of Time Zone Changes</a> gives examples of problems caused
-by inadequate notice by governments of time zone and daylight saving
-rule changes.</li>
-<li><a
 href="https://blog.jonudell.net/2009/10/23/a-literary-appreciation-of-the-olsonzoneinfotz-database/">A
 literary appreciation of the Olson/Zoneinfo/tz database</a> comments on the
 database's style.</li>
@@ -223,7 +236,7 @@ database's style.</li>
 These are listed roughly in ascending order of complexity and fanciness.
 </p>
 <ul>
-<li><a href="http://time.is">Time.is</a> shows locations'
+<li><a href="https://time.is">Time.is</a> shows locations'
 time and zones in a simple format.</li>
 <li><a href="https://www.timejones.com">TimeJones.com</a> is a simple
 time zone converter.</li>
@@ -238,7 +251,7 @@ Converter</a>
 uses a pulldown menu.</li>
 <li><a href="http://home.kpn.nl/vanadovv/time/TZworld.html">Complete
 timezone information for all countries</a> displays tables of DST rules.
-<li><a href="http://www.timeanddate.com/worldclock/">The World Clock &ndash;
+<li><a href="https://www.timeanddate.com/worldclock/">The World Clock &ndash;
 Worldwide</a> lets you sort zone names and convert times.</li>
 <li><a href="http://www.zeitverschiebung.net/en/">Time Difference</a>
 calculates the current time difference between locations.</li>
@@ -254,9 +267,10 @@ 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 name="TZDIST-Geolocate"
+transferring time zone data by reference. The (expired) draft <a
+id="TZDIST-Geolocate"
 href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-00">TZDIST
-Geolocate Extension</a> lets a client determine its time zone region
+Geolocate Extension</a> would have let a client determine its time zone region
 from its geographic location using a <a
 href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>.</li>
 <li>The <a href="https://tools.ietf.org/html/rfc5545">
@@ -303,9 +317,9 @@ transition in the <code><abbr>tz</abbr></code> database.</li>
 Database Parser</a> is a
 <a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a> parser and
 runtime library. It is freely available under the
-<a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons
+<a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons
 Attribution 4.0 International Public License</a>.</li>
-<li><a name="ICU" href="http://site.icu-project.org">International Components for
+<li><a id="ICU" href="http://site.icu-project.org">International Components for
 Unicode (<abbr>ICU</abbr>)</a> contains C/C++ and <a
 href="https://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>
 libraries for internationalization that
@@ -316,7 +330,7 @@ into an <abbr>ICU</abbr>-specific format.
 <abbr>ICU</abbr> is freely available under a
 <abbr>BSD</abbr>-style license.</li>
 <li>The <a href="https://github.com/lau/tzdata">Tzdata</a> package for
-the <a href="http://elixir-lang.org">Elixir</a> language downloads
+the <a href="https://elixir-lang.org">Elixir</a> language downloads
 and compiles tz source and exposes <abbr
 title="Application Program Interface">API</abbr>s for use. It is
 freely available under the <abbr
@@ -338,7 +352,7 @@ and time <abbr>API</abbr></a> contains a class
 <code><abbr>tz</abbr></code> source into a binary format. It inspired
 Java 8 <code>java.time</code>, which its users should migrate to once
 they can assume Java 8 or later. It is available under the <a
-href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a>.</li>
+href="https://www.apache.org/licenses/LICENSE-2.0">Apache License</a>.</li>
 <li><a href="https://github.com/MenoData/Time4J/">Time4J &ndash;
 Advanced date, time and interval library for Java</a> contains a class
 <code>net.time4j.tool.TimezoneRepositoryCompiler</code> that compiles
@@ -360,8 +374,8 @@ and a <abbr>BSD</abbr>-style license, respectively.</li>
 <li><a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>-based
 compilers and libraries include:
 <ul>
-<li><a href="http://momentjs.com/timezone/">Moment Timezone</a> is a
-plugin for the <a href="http://momentjs.com">Moment.js</a> date
+<li><a href="https://momentjs.com/timezone/">Moment Timezone</a> is a
+plugin for the <a href="https://momentjs.com">Moment.js</a> date
 manipulation library. It is freely available under the <abbr>MIT</abbr>
 license.</li>
 <li><a href="https://github.com/mde/timezone-js">TimezoneJS.Date</a>'s
@@ -373,13 +387,13 @@ the <abbr>MIT</abbr> license.</li>
 </ul>
 <li><a href="https://github.com/JuliaTime/">JuliaTime</a> contains a
 compiler from <code><abbr>tz</abbr></code> source into
-<a href="http://julialang.org/">Julia</a>. It is freely available
+<a href="https://julialang.org/">Julia</a>. It is freely available
 under the <abbr>MIT</abbr> license.</li>
 <li><a href="http://pytz.sourceforge.net">pytz &ndash; World Timezone
 Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
 <a href="https://www.python.org">Python</a>.
 It is freely available under a <abbr>BSD</abbr>-style license.</li>
-<li><a href="http://tzinfo.github.io">TZInfo &ndash;
+<li><a href="https://tzinfo.github.io">TZInfo &ndash;
 Ruby Timezone Library</a>
 compiles <code><abbr>tz</abbr></code> source into
 <a href="https://www.ruby-lang.org/en/">Ruby</a>.
@@ -391,7 +405,7 @@ library that compiles <code><abbr>tz</abbr></code> source into a time
 zone repository whose format
 is either proprietary or an <abbr>XML</abbr>-encoded
 representation.</li>
-<li><a name="Tcl" href="http://tcl.tk">Tcl</a>
+<li><a id="Tcl" href="https://tcl.tk">Tcl</a>
 contains a developer-oriented parser that compiles <code><abbr>tz</abbr></code>
 source into text files, along with a runtime that can read those
 files. Tcl is freely available under a <abbr>BSD</abbr>-style
@@ -442,7 +456,7 @@ converts <code><abbr>tz</abbr></code> binary data into
 in its JavaScript library for time zone conversion. Dates before 1970
 are not supported.</li>
 <li>The <a
-href="http://hackage.haskell.org/package/timezone-olson">timezone-olson</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
 available under a <abbr>BSD</abbr>-style license.</li>
@@ -474,16 +488,16 @@ data (mentioned <a href="#CLDR">below</a>) used by
 <a href="https://en.wikipedia.org/wiki/Windows_Runtime">Windows Runtime</a>
 classes such as <a
 href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.globalization.datetimeformatting.datetimeformatter.aspx"><code>DateTimeFormatter</code></a>.
-<a name="System.TimeZoneInfo"
+<a id="System.TimeZoneInfo"
 href="https://blogs.msdn.microsoft.com/bclteam/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free/">Exploring
 Windows Time Zones with <code>System.TimeZoneInfo</code></a> describes
 the older, proprietary method of Microsoft Windows 2000 and later,
 which stores time zone data in the
 <a href="https://en.wikipedia.org/wiki/Windows_Registry">Windows Registry</a>. The
 <a
-href="http://www.unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
+href="http://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
 Tzid table</a> or <a
-href="http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml"><abbr>XML</abbr>
+href="https://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml"><abbr>XML</abbr>
 file</a> of the <abbr>CLDR</abbr> data maps proprietary zone IDs
 to <code><abbr>tz</abbr></code> names.
 <li><a
@@ -491,9 +505,6 @@ 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://kimmo.suominen.com/sw/timezone/">Time Zone</a> is
-a <a href="https://wordpress.org">WordPress</a> plugin. It is freely
-available under a <abbr>BSD</abbr>-style license.</li>
 <li><a href="http://www.relativedata.com/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
@@ -506,7 +517,7 @@ licenses</a> to <code><abbr>tz</abbr></code> contributors.</li>
 </ul>
 <h2 id="other-dbs">Other time zone databases</h2>
 <ul>
-<li><a href="http://www.astro.com/atlas">Time-zone Atlas</a>
+<li><a href="https://www.astro.com/atlas">Time-zone Atlas</a>
 is Astrodienst's Web version of Shanks and Pottenger's
 time zone history atlases also published in <a
 href="http://astrocom.com/astrology-products/software/acs-atlas-software">software</a>
@@ -524,7 +535,7 @@ is another time zone database.</li>
 contains data from the Time Service Department of the
 <abbr>US</abbr> Naval Observatory.</li>
 <li>The <a
-href="http://www.iata.org/publications/store/Pages/standard-schedules-information.aspx">Standard
+href="https://www.iata.org/publications/store/Pages/standard-schedules-information.aspx">Standard
 Schedules Information Manual</a> of the
 International Air Transport Association
 gives current time zone rules for airports served by commercial aviation.</li>
@@ -537,7 +548,7 @@ title="Central Intelligence Agency">CIA</abbr>)</a> publishes a <a
 href="https://www.cia.gov/library/publications/the-world-factbook/graphics/ref_maps/physical/pdf/standard_time_zones_of_the_world.pdf">time
 zone map</a>; the
 <a
-href="http://www.lib.utexas.edu/maps/world.html">Perry&ndash;Casta&ntilde;eda
+href="https://www.lib.utexas.edu/maps/world.html">Perry&ndash;Casta&ntilde;eda
 Library Map Collection</a>
 of the University of Texas at Austin has copies of
 recent editions.
@@ -565,18 +576,19 @@ services and other sources.</p>
 <ul>
 <li><a href="https://github.com/evansiroky/timezone-boundary-builder">Timezone
 Boundary Builder</a> extracts
-<a href="http://www.openstreetmap.org">Open Street Map</a> data to build
+<a href="https://www.openstreetmap.org">Open Street Map</a> data to build
 boundaries of <code><abbr>tz</abbr></code> regions.
 Its code is freely available under the <abbr>MIT</abbr> license, and
 its data entries are freely available under the
-<a href="http://opendatacommons.org/licenses/odbl/">Open Data Commons
+<a href="https://opendatacommons.org/licenses/odbl/">Open Data Commons
 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
 <a href="http://efele.net/maps/tz/world/">tz_world</a>, a shapefile
-for all the world's regions</li>
+for all the world's regions. 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>
 is in <a href="https://tools.ietf.org/html/rfc7946">GeoJSON</a> format
@@ -620,12 +632,9 @@ the <a href="https://timezonedb.com">Time Zone Database &amp; API</a>.
 Commercial network API access is provided
 by <a href="https://askgeo.com">AskGeo</a>
 and <a href="https://www.geogarage.com/blog/news-1/post/geogarage-time-zone-api-31">GeoGarage</a>.
-Also, an <a
-href="https://mm.icann.org/pipermail/tz/2016-October/024309.html">experimental
-server</a> is available for the TZDIST Geolocate Extension mentioned
-<a href="#TZDIST-Geolocate">above</a>.</li>
+</li>
 <li>"<a
-href="http://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates/16086964">How
+href="https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates/16086964">How
 to get a time zone from a location using latitude and longitude
 coordinates?</a>" discusses other geolocation possibilities.</li>
 <li><a href="http://statoids.com/statoids.html">Administrative
@@ -635,13 +644,10 @@ political subdivision data related to time zones.</li>
 zone boundaries for multizone countries</a> summarizes legal
 boundaries between time zones within countries.</li>
 <li>Manifold.net's <a
-href="http://manifold.net/info/freestuff.shtml">Free Stuff for
+href="http://manifold.net/info/freestuff.shtml">Free Downloads for
 Manifold System Users</a> includes a Manifold-format map of
 world time zone boundaries distributed under the
 <abbr>GPL</abbr>.</li>
-<li>The GeoCommunity lists several commercial sources for <a
-href="http://spatialnews.geocomm.com/features/timezones/">International
-Time Zones and Time Zone Data</a>.</li>
 <li>A ship within the <a
 href="https://en.wikipedia.org/wiki/Territorial_waters">territorial
 waters</a> of any nation uses that nation's time. In international
@@ -655,7 +661,7 @@ common.</li>
 </ul>
 <h2 id="civil">Civil time concepts and history</h2>
 <ul>
-<li><a href="http://physics.nist.gov/time">A
+<li><a href="https://www.nist.gov/pml/time-and-frequency-division/popular-links/walk-through-time">A
 Walk through Time</a>
 surveys the evolution of timekeeping.</li>
 <li><a href="http://www.webexhibits.org/daylightsaving/">About Daylight
@@ -667,7 +673,7 @@ deal with civil time.</li>
 <li><a href="http://seizethedaylight.com/dst/">A Brief
 History of Daylight Saving Time</a> summarizes some of the contentious
 history of <abbr>DST</abbr>.</li>
-<li><a href="http://www.staff.science.uu.nl/~gent0113/idl/idl.htm">A History of
+<li><a href="https://www.staff.science.uu.nl/~gent0113/idl/idl.htm">A History of
 the International Date Line</a> tells the story of the most important
 time zone boundary.</li>
 <li><a href="http://statoids.com/tconcept.html">Basic Time
@@ -677,7 +683,7 @@ Zone Concepts</a> discusses terminological issues behind time zones.</li>
 <dl>
 <dt>Australia</dt>
 <dd>The Parliamentary Library has commissioned a <a
-href="http://www.aph.gov.au/binaries/library/pubs/rp/2009-10/10rp10.pdf">research
+href="https://www.aph.gov.au/binaries/library/pubs/rp/2009-10/10rp10.pdf">research
 paper on daylight saving time in Australia</a>.
 The Bureau of Meteorology publishes a list of <a
 href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">Implementation
@@ -694,7 +700,7 @@ Portuguese)</a>.</dd>
 <dt>Canada</dt>
 <dd>National Research Council Canada publishes current
 and some older information about <a
-href="http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html">time
+href="https://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html">time
 zones &amp; daylight saving time</a>.</dd>
 <dt>Chile</dt>
 <dd>The Hydrographic and Oceanographic Service of the Chilean Navy publishes a
@@ -702,7 +708,7 @@ zones &amp; daylight saving time</a>.</dd>
 Chile's official time (in Spanish)</a>.</dd>
 <dt>Germany</dt>
 <dd>The National Institute for Science and Technology maintains the <a
-href="http://www.ptb.de/cms/en/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany.html">Realisation
+href="https://www.ptb.de/cms/en/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany.html">Realisation
 of Legal Time in Germany</a>.</dd>
 <dt>Israel</dt>
 <dd>The Interior Ministry periodically issues <a
@@ -710,7 +716,7 @@ 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.inrim.it/res/tf/ora_legale_i.shtml">table of civil time
+<a href="http://www.nanospin.eu/res/tf/ora_legale_i.shtml">table of civil time
 (in Italian)</a>.</dd>
 <dt>Mexico</dt>
 <dd>The Investigation and Analysis Service of the Mexican Library of
@@ -720,7 +726,7 @@ 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="http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
+<dd><a href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
 hreflang="nl">Legal time in the Netherlands (in Dutch)</a>
 covers the history of local time in the Netherlands from ancient times.</dd>
 <dt>New Zealand</dt>
@@ -730,7 +736,7 @@ Daylight Saving</a>. The privately-maintained <a
 href="http://astrologyschool.com/nztime.html">History of New Zealand
 time</a> has more details.</dd>
 <dt>Singapore</dt>
-<dd><a name="Singapore"
+<dd><a id="Singapore"
 href="http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html">Why
 is Singapore in the "Wrong" Time Zone?</a> details the
 history of legal time in Singapore and Malaysia.</dd>
@@ -750,7 +756,7 @@ Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
 <h2 id="precision">Precision timekeeping</h2>
 <ul>
 <li><a
-href="http://literature.agilent.com/litweb/pdf/5965-7984E.pdf">The
+href="http://leapsecond.com/hpan/an1289.pdf">The
 Science of Timekeeping</a> is a thorough introduction
 to the theory and practice of precision timekeeping.</li>
 <li><a href="http://www.ntp.org"><abbr
@@ -818,10 +824,10 @@ cloud service providers.</li>
 <li>The <a
 href="https://pairlist6.pair.net/mailman/listinfo/leapsecs">Leap
 Second Discussion List</a> covers <a
-href="http://www2.unb.ca/gge/Resources/gpsworld.november99.pdf">McCarthy
+href="https://www2.unb.ca/gge/Resources/gpsworld.november99.pdf">McCarthy
 and Klepczynski's 1999 proposal to discontinue leap seconds</a>,
 discussed further in
-<a href="http://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The
+<a href="https://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The
 leap second: its history and possible future</a>.
 <a href="http://www.ucolick.org/~sla/leapsecs/"><abbr>UTC</abbr>
 might be redefined
@@ -831,18 +837,18 @@ again.</li>
 </ul>
 <h2 id="notation">Time notation</h2>
 <ul>
-<li>The <a name="CLDR" href="http://cldr.unicode.org">Unicode Common Locale Data
+<li>The <a id="CLDR" href="http://cldr.unicode.org">Unicode Common Locale Data
 Repository (<abbr>CLDR</abbr>) Project</a> has localizations for time
 zone names, abbreviations, identifiers, and formats. For example, it
 contains French translations for "Eastern European Summer Time",
 "<abbr title="Eastern European Summer Time">EEST</abbr>", and
 "Bucharest". Its
-<a href="http://www.unicode.org/cldr/charts/latest/by_type/">by-type
+<a href="http://unicode.org/cldr/charts/latest/by_type/">by-type
 charts</a> show these values for many locales. Data values are available in
 both <abbr title="Locale Data Markup Language">LDML</abbr>
 (an <abbr>XML</abbr> format) and <abbr>JSON</abbr>.
 <li>
-<a href="http://www.cl.cam.ac.uk/~mgk25/iso-time.html">A summary of
+<a href="https://www.cl.cam.ac.uk/~mgk25/iso-time.html">A summary of
 the international standard date and time notation</a> is a good
 summary of
 <a
@@ -869,10 +875,6 @@ protocols.</li>
 <a href="https://www.hackcraft.net/web/datetime/">Date &amp; Time
 Formats on the Web</a> surveys web- and Internet-oriented date and time
 formats.</li>
-<li>
-<a href="http://exit109.com/~ghealton/y2k/yrexamples.html">The
-Best of Dates, the Worst of Dates</a> covers many problems encountered
-by software developers when handling dates and time stamps.</li>
 <li>Alphabetic time zone abbreviations should not be used as unique
 identifiers for <abbr>UTC</abbr> offsets as they are ambiguous in
 practice. For example, in English-speaking North America
@@ -904,6 +906,7 @@ is called "<abbr>GMT</abbr>".</li>
 </ul>
 <h2 id="see-also">See also</h2>
 <ul>
+<li><a href="theory.html">Theory and pragmatics of the tz code and data</a></li>
 <li><a href="tz-art.htm">Time and the Arts</a></li>
 </ul>
 <hr>
index 0c907bc..3a4dd2b 100644 (file)
--- a/tzfile.5
+++ b/tzfile.5
@@ -10,17 +10,29 @@ tzfile \- time zone information
 \\$3\*(lq\\$1\*(rq\\$2
 ..
 The time zone information files used by
-.IR tzset (3)
-begin with the magic characters "TZif" to identify them as
-time zone information files,
-followed by a character identifying the version of the file's format
-(as of 2013, either an ASCII NUL, or '2', or '3')
-followed by fifteen bytes containing zeroes reserved for future use,
-followed by six four-byte integer values
+.BR tzset (3)
+are typically found under a directory with a name like
+.IR /usr/share/zoneinfo .
+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.
+.IP *
+A byte identifying the version of the file's format
+(as of 2017, either an ASCII NUL, or
+.q "2",
+or
+.q "3" ).
+.IP *
+Fifteen bytes containing zeros reserved for future use.
+.IP *
+Six four-byte integer values
 written in a standard byte order
 (the high-order byte of the value is written first).
 These values are,
 in order:
+.RS
 .TP
 .I tzh_ttisgmtcnt
 The number of UT/local indicators stored in the file.
@@ -40,28 +52,30 @@ The number of local time types for which data entries are stored
 in the file (must not be zero).
 .TP
 .I tzh_charcnt
-The number of characters of time zone abbreviation strings
+The number of bytes of time zone abbreviation strings
 stored in the file.
+.RE
 .PP
-The above header is followed by
+The above header is followed by the following fields, whose lengths
+depend on the contents of the header:
+.IP * 2
 .I tzh_timecnt
 four-byte signed integer values sorted in ascending order.
 These values are written in standard byte order.
 Each is used as a transition time (as returned by
-.IR time (2))
+.BR time (2))
 at which the rules for computing local time change.
-Next come
+.IP *
 .I 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 an array of
-.I ttinfo
-structures (with
+These values serve as indices into the next field.
+.IP *
 .I tzh_typecnt
-entries) that appears next in the file;
-these structures are defined as follows:
+.I ttinfo
+entries, each defined as follows:
 .in +.5i
 .sp
 .nf
@@ -87,36 +101,35 @@ gives the number of seconds to be added to UT,
 tells whether
 .I tm_isdst
 should be set by
-.I localtime (3)
+.BR localtime (3)
 and
 .I tt_abbrind
-serves as an index into the array of time zone abbreviation characters
+serves as an index into the array of time zone abbreviation bytes
 that follow the
 .I ttinfo
 structure(s) in the file.
-.PP
-Then there are
+.IP *
 .I tzh_leapcnt
 pairs of four-byte values, written in standard byte order;
-the first value of each pair gives the time
+the first value of each pair gives the nonnegative time
 (as returned by
-.IR time(2))
+.BR time (2))
 at which a leap second occurs;
 the second gives the
 .I total
 number of leap seconds to be applied during the time period
 starting at the given time.
 The pairs of values are sorted in ascending order by time.
-.PP
-Then there are
+Each transition is for one leap second, either positive or negative;
+transitions always separated by at least 28 days minus 1 second.
+.IP *
 .I tzh_ttisstdcnt
 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.
-.PP
-Finally there are
+.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
@@ -124,7 +137,9 @@ 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.
 .PP
-.I Localtime
+The
+.BR localtime (3)
+function
 uses the first standard-time
 .I ttinfo
 structure in the file
@@ -135,27 +150,28 @@ if either
 .I tzh_timecnt
 is zero or the time argument is less than the first transition time recorded
 in the file.
-.PP
+.SS Version 2 format
 For version-2-format time zone 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 must agree with the local time type after
+The POSIX-style string must agree with the local time type after
 both data's last transition times; for example, given the string
 .q "WET0WEST,M3.5.0,M10.5.0/3"
 then if a last transition time is in July, the transition's local time
 type must specify a daylight-saving time abbreviated
 .q "WEST"
 that is one hour east of UT.
-.PP
+.SS Version 3 format
 For version-3-format time zone files, the POSIX-TZ-style string may
 use two minor extensions to the POSIX TZ format, as described in
-.IR newtzset (3).
+.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
@@ -164,6 +180,11 @@ between daylight saving and standard time.
 .PP
 Future changes to the format may append more data.
 .SH SEE ALSO
-newctime(3), newtzset(3), zdump(8), zic(8)
+.BR time (2),
+.BR localtime (3),
+.BR tzset (3),
+.BR tzselect (8),
+.BR zdump (8),
+.BR zic (8)
 .\" This file is in the public domain, so clarified as of
 .\" 1996-06-05 by Arthur David Olson.
index ca632ea..e6eb68e 100644 (file)
@@ -4,98 +4,115 @@ NAME
        tzfile - time zone information
 
 DESCRIPTION
-       The time zone information files used by tzset(3) begin with the magic
-       characters "TZif" to identify them as time zone information files,
-       followed by a character identifying the version of the file's format
-       (as of 2013, either an ASCII NUL, or '2', or '3') followed by fifteen
-       bytes containing zeroes reserved for future use, followed by six four-
-       byte integer values written in a standard byte order (the high-order
-       byte of the value is written first).  These values are, in order:
-
-       tzh_ttisgmtcnt
-              The number of UT/local indicators stored in the file.
-
-       tzh_ttisstdcnt
-              The number of standard/wall indicators stored in the file.
-
-       tzh_leapcnt
-              The number of leap seconds for which data entries are stored in
-              the file.
-
-       tzh_timecnt
-              The number of transition times for which data entries are stored
-              in the file.
-
-       tzh_typecnt
-              The number of local time types for which data entries are stored
-              in the file (must not be zero).
-
-       tzh_charcnt
-              The number of characters of time zone abbreviation strings
-              stored in the file.
-
-       The above header is followed by tzh_timecnt four-byte signed integer
-       values sorted in ascending order.  These values are written in standard
-       byte order.  Each is used as a transition time (as returned by time(2))
-       at which the rules for computing local time change.  Next come
-       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 an array of ttinfo
-       structures (with tzh_typecnt entries) that appears next in the file;
-       these structures are defined as follows:
-
-            struct ttinfo {
-                 int32_t        tt_gmtoff;
-                 unsigned char  tt_isdst;
-                 unsigned char  tt_abbrind;
-            };
-
-       Each structure is written as a four-byte signed integer value for
-       tt_gmtoff, in a standard byte order, followed by a one-byte value for
-       tt_isdst and a one-byte value for tt_abbrind.  In each structure,
-       tt_gmtoff gives the number of seconds to be added to UT, tt_isdst tells
-       whether tm_isdst should be set by localtime (3) and tt_abbrind serves
-       as an index into the array of time zone abbreviation characters that
-       follow the ttinfo structure(s) in the file.
-
-       Then there are tzh_leapcnt pairs of four-byte values, written in
-       standard byte order; the first value of each pair gives the time (as
-       returned by time(2)) at which a leap second occurs; the second gives
-       the total number of leap seconds to be applied during the time period
-       starting at the given time.  The pairs of values are sorted in
-       ascending order by time.
-
-       Then there are 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.
-
-       Finally there are 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.
-
-       Localtime uses the first standard-time ttinfo structure in the file (or
-       simply the first ttinfo structure in the absence of a standard-time
-       structure) if either tzh_timecnt is zero or the time argument is less
-       than the first transition time recorded in the file.
-
+       The time zone 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.
+
+       * A byte identifying the version of the file's format (as of 2017,
+         either an ASCII NUL, or "2", or "3").
+
+       * Fifteen bytes containing zeros reserved for future use.
+
+       * Six four-byte integer values written in a standard byte order (the
+         high-order byte of the value is written first).  These values are, in
+         order:
+
+         tzh_ttisgmtcnt
+                The number of UT/local indicators stored in the file.
+
+         tzh_ttisstdcnt
+                The number of standard/wall indicators stored in the file.
+
+         tzh_leapcnt
+                The number of leap seconds for which data entries are stored
+                in the file.
+
+         tzh_timecnt
+                The number of transition times for which data entries are
+                stored in the file.
+
+         tzh_typecnt
+                The number of local time types for which data entries are
+                stored in the file (must not be zero).
+
+         tzh_charcnt
+                The number of bytes of time zone abbreviation strings stored
+                in the file.
+
+       The above header is followed by the following fields, whose lengths
+       depend on the contents of the header:
+
+       * tzh_timecnt four-byte signed integer values sorted in ascending
+         order.  These values are written in standard byte order.  Each is
+         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_typecnt ttinfo entries, each defined as follows:
+
+              struct ttinfo {
+                   int32_t        tt_gmtoff;
+                   unsigned char  tt_isdst;
+                   unsigned char  tt_abbrind;
+              };
+
+         Each structure is written as a four-byte signed integer value for
+         tt_gmtoff, in a standard byte order, followed by a one-byte value for
+         tt_isdst and a one-byte value for tt_abbrind.  In each structure,
+         tt_gmtoff gives the number of seconds to be added to UT, tt_isdst
+         tells whether tm_isdst should be set by localtime(3) and tt_abbrind
+         serves as an index into the array of time zone abbreviation bytes
+         that follow the ttinfo structure(s) in the file.
+
+       * tzh_leapcnt pairs of four-byte values, written in standard byte
+         order; the first value of each pair gives the nonnegative time (as
+         returned by time(2)) at which a leap second occurs; the second gives
+         the total number of leap seconds to be applied during the time period
+         starting at the given time.  The pairs of values are sorted in
+         ascending order by time.  Each transition is for one leap second,
+         either positive or negative; transitions always separated by at least
+         28 days minus 1 second.
+
+       * 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.
+
+       * 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.
+
+       The localtime(3) function uses the first standard-time ttinfo structure
+       in the file (or simply the first ttinfo structure in the absence of a
+       standard-time structure) if either tzh_timecnt is zero or the time
+       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
        followed by a second header and data, identical in format except that
        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 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.
-
+       (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.
+
+   Version 3 format
        For version-3-format time zone files, the POSIX-TZ-style string may use
        two minor extensions to the POSIX TZ format, as described in
        newtzset(3).  First, the hours part of its transition times may be
@@ -107,6 +124,6 @@ DESCRIPTION
        Future changes to the format may append more data.
 
 SEE ALSO
-       newctime(3), newtzset(3), zdump(8), zic(8)
+       time(2), localtime(3), tzset(3), tzselect(8), zdump(8), zic(8)
 
                                                                      TZFILE(5)
index d2c3a6d..759ba5f 100644 (file)
@@ -17,9 +17,9 @@ REPORT_BUGS_TO=tz@iana.org
 # If your host lacks both Bash and the Korn shell, you can get their
 # source from one of these locations:
 #
-#      Bash <http://www.gnu.org/software/bash/bash.html>
+#      Bash <https://www.gnu.org/software/bash/>
 #      Korn Shell <http://www.kornshell.com/>
-#      Public Domain Korn Shell <http://www.cs.mun.ca/~michael/pdksh/>
+#      MirBSD Korn Shell <https://www.mirbsd.org/mksh.htm>
 #
 # For portability to Solaris 9 /bin/sh this script avoids some POSIX
 # features and common extensions, such as $(...) (which works sometimes
@@ -29,8 +29,8 @@ REPORT_BUGS_TO=tz@iana.org
 # If your host lacks awk, or has an old awk that does not conform to Posix,
 # you can use either of the following free programs instead:
 #
-#      Gawk (GNU awk) <http://www.gnu.org/software/gawk/>
-#      mawk <http://invisible-island.net/mawk/>
+#      Gawk (GNU awk) <https://www.gnu.org/software/gawk/>
+#      mawk <https://invisible-island.net/mawk/>
 
 
 # Specify default values for environment variables if they are unset.
diff --git a/version b/version
index c5bbdc4..198e36d 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-2017b
+2017c
diff --git a/zdump.c b/zdump.c
index bf75800..8e3bf3e 100644 (file)
--- a/zdump.c
+++ b/zdump.c
 #endif
 
 #include "private.h"
+#include <stdio.h>
+
+#ifndef HAVE_SNPRINTF
+# define HAVE_SNPRINTF (199901 <= __STDC_VERSION__)
+#endif
 
 #ifndef HAVE_LOCALTIME_R
 # define HAVE_LOCALTIME_R 1
@@ -72,14 +77,11 @@ enum { SECSPER400YEARS_FITS = SECSPERLYEAR <= INTMAX_MAX / 400 };
 # define timezone_t char **
 #endif
 
-extern char ** environ;
-
 #if !HAVE_POSIX_DECLS
 extern int     getopt(int argc, char * const argv[],
                        const char * options);
 extern char *  optarg;
 extern int     optind;
-extern char *  tzname[];
 #endif
 
 /* The minimum and maximum finite time values.  */
@@ -685,17 +687,15 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit)
 }
 
 /*
-** Thanks to Paul Eggert for logic used in delta.
+** Thanks to Paul Eggert for logic used in delta_nonneg.
 */
 
 static intmax_t
-delta(struct tm * newp, struct tm *oldp)
+delta_nonneg(struct tm *newp, struct tm *oldp)
 {
        register intmax_t       result;
        register int            tmy;
 
-       if (newp->tm_year < oldp->tm_year)
-               return -delta(oldp, newp);
        result = 0;
        for (tmy = oldp->tm_year; tmy < newp->tm_year; ++tmy)
                result += DAYSPERNYEAR + isleap_sum(tmy, TM_YEAR_BASE);
@@ -709,6 +709,14 @@ delta(struct tm * newp, struct tm *oldp)
        return result;
 }
 
+static intmax_t
+delta(struct tm *newp, struct tm *oldp)
+{
+  return (newp->tm_year < oldp->tm_year
+         ? -delta_nonneg(oldp, newp)
+         : delta_nonneg(newp, oldp));
+}
+
 #ifndef TM_GMTOFF
 /* Return A->tm_yday, adjusted to compare it fairly to B->tm_yday.
    Assume A and B differ by at most one year.  */
@@ -787,6 +795,38 @@ show(timezone_t tz, char *zone, time_t t, bool v)
                abbrok(abbr(tmp), zone);
 }
 
+#if !HAVE_SNPRINTF
+# include <stdarg.h>
+
+/* A substitute for snprintf that is good enough for zdump.  */
+static int
+snprintf(char *s, size_t size, char const *format, ...)
+{
+  int n;
+  va_list args;
+  char const *arg;
+  size_t arglen, slen;
+  char buf[1024];
+  va_start(args, format);
+  if (strcmp(format, "%s") == 0) {
+    arg = va_arg(args, char const *);
+    arglen = strlen(arg);
+  } else {
+    n = vsprintf(buf, format, args);
+    if (n < 0)
+      return n;
+    arg = buf;
+    arglen = n;
+  }
+  slen = arglen < size ? arglen : size - 1;
+  memcpy(s, arg, slen);
+  s[slen] = '\0';
+  n = arglen <= INT_MAX ? arglen : -1;
+  va_end(args);
+  return n;
+}
+#endif
+
 /* Store into BUF, of size SIZE, a formatted local time taken from *TM.
    Use ISO 8601 format +HH:MM:SS.  Omit :SS if SS is zero, and omit
    :MM too if MM is also zero.
@@ -993,9 +1033,11 @@ abbr(struct tm const *tmp)
 #ifdef TM_ZONE
        return tmp->TM_ZONE;
 #else
-       return (0 <= tmp->tm_isdst && tzname[0 < tmp->tm_isdst]
-               ? tzname[0 < tmp->tm_isdst]
-               : "");
+# if HAVE_TZNAME
+       if (0 <= tmp->tm_isdst && tzname[0 < tmp->tm_isdst])
+         return tzname[0 < tmp->tm_isdst];
+# endif
+       return "";
 #endif
 }
 
@@ -1030,10 +1072,10 @@ tformat(void)
 static void
 dumptime(register const struct tm *timeptr)
 {
-       static const char       wday_name[][3] = {
+       static const char       wday_name[][4] = {
                "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
        };
-       static const char       mon_name[][3] = {
+       static const char       mon_name[][4] = {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun",
                "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
        };
@@ -1059,7 +1101,7 @@ dumptime(register const struct tm *timeptr)
                (int) (sizeof mon_name / sizeof mon_name[0]))
                        mn = "???";
        else            mn = mon_name[timeptr->tm_mon];
-       printf("%.3s %.3s%3d %.2d:%.2d:%.2d ",
+       printf("%s %s%3d %.2d:%.2d:%.2d ",
                wn, mn,
                timeptr->tm_mday, timeptr->tm_hour,
                timeptr->tm_min, timeptr->tm_sec);
diff --git a/zic.8 b/zic.8
index e5e71f5..ab95b08 100644 (file)
--- a/zic.8
+++ b/zic.8
@@ -147,8 +147,16 @@ Any line that is blank (after comment stripping) is ignored.
 Non-blank lines are expected to be of one of three types:
 rule lines, zone lines, and link lines.
 .PP
-Names (such as month names) must be in English and are case insensitive.
-Abbreviations, if used, must be unambiguous in context.
+Names must be in English and are case insensitive.
+They appear in several contexts, and include month and weekday names
+and keywords such as
+.BR "maximum" ,
+.BR "only" ,
+.BR "Rolling" ,
+and
+.BR "Zone" .
+A name can be abbreviated by omitting all but an initial prefix; any
+abbreviation must be unambiguous in context.
 .PP
 A rule line has the form
 .nf
@@ -221,7 +229,13 @@ Sun<=25    last Sunday on or before the 25th
 .fi
 .in -.5i
 .sp
-Names of days of the week may be abbreviated or spelled out in full.
+A weekday name (e.g.,
+.BR "Sunday" )
+or a weekday name preceded by
+.q "last"
+(e.g.,
+.BR "lastSunday" )
+may be abbreviated or spelled out in full.
 Note that there must be no spaces within the
 .B ON
 field.
@@ -459,17 +473,6 @@ if a second was added
 or
 .q "\*-"
 if a second was skipped.
-.\" There's no need to document the following, since it's impossible for more
-.\" than one leap second to be inserted or deleted at a time.
-.\" The C Standard is in error in suggesting the possibility.
-.\" See Terry J Quinn, The BIPM and the accurate measure of time,
-.\" Proc IEEE 79, 7 (July 1991), 894-905.
-.\"    or
-.\"    .q ++
-.\"    if two seconds were added
-.\"    or
-.\"    .q --
-.\"    if two seconds were skipped.
 The
 .B R/S
 field
index a0e185a..ab498b0 100644 (file)
--- a/zic.8.txt
+++ b/zic.8.txt
@@ -99,8 +99,11 @@ DESCRIPTION
        lines are expected to be of one of three types: rule lines, zone lines,
        and link lines.
 
-       Names (such as month names) must be in English and are case
-       insensitive.  Abbreviations, if used, must be unambiguous in context.
+       Names must be in English and are case insensitive.  They appear in
+       several contexts, and include month and weekday names and keywords such
+       as maximum, only, Rolling, and Zone.  A name can be abbreviated by
+       omitting all but an initial prefix; any abbreviation must be
+       unambiguous in context.
 
        A rule line has the form
 
@@ -145,7 +148,8 @@ DESCRIPTION
                     Sun>=8   first Sunday on or after the eighth
                     Sun<=25  last Sunday on or before the 25th
 
-               Names of days of the week may be abbreviated or spelled out in
+               A weekday name (e.g., Sunday) or a weekday name preceded by
+               "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.
diff --git a/zic.c b/zic.c
index 068fb43..a3d7383 100644 (file)
--- a/zic.c
+++ b/zic.c
@@ -11,6 +11,7 @@
 #include <locale.h>
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 
 #define        ZIC_VERSION_PRE_2013 '2'
 #define        ZIC_VERSION     '3'
@@ -41,14 +42,26 @@ typedef int_fast64_t        zic_t;
 #define MKDIR_UMASK 0755
 #endif
 
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>  /* for WIFEXITED and WEXITSTATUS */
+#endif /* HAVE_SYS_WAIT_H */
+
+#ifndef WIFEXITED
+#define WIFEXITED(status)      (((status) & 0xff) == 0)
+#endif /* !defined WIFEXITED */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(status)    (((status) >> 8) & 0xff)
+#endif /* !defined WEXITSTATUS */
+
 /* The maximum ptrdiff_t value, for pre-C99 platforms.  */
 #ifndef PTRDIFF_MAX
 static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t));
 #endif
 
-/* The type and printf format for line numbers.  */
+/* The type for line numbers.  Use PRIdMAX to format them; formerly
+   there was also "#define PRIdLINENO PRIdMAX" and formats used
+   PRIdLINENO, but xgettext cannot grok that.  */
 typedef intmax_t lineno;
-#define PRIdLINENO PRIdMAX
 
 struct rule {
        const char *    r_filename;
@@ -298,10 +311,13 @@ struct lookup {
 static struct lookup const *   byword(const char * string,
                                        const struct lookup * lp);
 
-static struct lookup const     line_codes[] = {
+static struct lookup const zi_line_codes[] = {
        { "Rule",       LC_RULE },
        { "Zone",       LC_ZONE },
        { "Link",       LC_LINK },
+       { NULL,         0 }
+};
+static struct lookup const leap_line_codes[] = {
        { "Leap",       LC_LEAP },
        { NULL,         0}
 };
@@ -415,7 +431,7 @@ strdup(char const *str)
 }
 #endif
 
-static ATTRIBUTE_PURE void *
+static void *
 memcheck(void *ptr)
 {
        if (ptr == NULL)
@@ -484,10 +500,10 @@ verror(const char *const string, va_list args)
        ** on BSD systems.
        */
        if (filename)
-         fprintf(stderr, _("\"%s\", line %"PRIdLINENO": "), filename, linenum);
+         fprintf(stderr, _("\"%s\", line %"PRIdMAX": "), filename, linenum);
        vfprintf(stderr, string, args);
        if (rfilename != NULL)
-               fprintf(stderr, _(" (rule from \"%s\", line %"PRIdLINENO")"),
+               fprintf(stderr, _(" (rule from \"%s\", line %"PRIdMAX")"),
                        rfilename, rlinenum);
        fprintf(stderr, "\n");
 }
@@ -632,9 +648,10 @@ _("%s: More than one -p option specified\n"),
                                }
                                break;
                        case 'y':
-                               if (yitcommand == NULL)
+                               if (yitcommand == NULL) {
+                                       warning(_("-y is obsolescent"));
                                        yitcommand = optarg;
-                               else {
+                               else {
                                        fprintf(stderr,
 _("%s: More than one -y option specified\n"),
                                                progname);
@@ -917,7 +934,7 @@ static zic_t const max_time = MAXVAL(zic_t, TIME_T_BITS_IN_FILE);
    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
-   <http://arxiv.org/pdf/1303.5062v1> [PDF]
+   <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.
@@ -1113,6 +1130,8 @@ infile(const char *name)
                } else if (wantcont) {
                        wantcont = inzcont(fields, nfields);
                } else {
+                       struct lookup const *line_codes
+                         = name == leapsec ? leap_line_codes : zi_line_codes;
                        lp = byword(fields[0], line_codes);
                        if (lp == NULL)
                                error(_("input line of unknown type"));
@@ -1129,11 +1148,7 @@ infile(const char *name)
                                        wantcont = false;
                                        break;
                                case LC_LEAP:
-                                       if (name != leapsec)
-                                         warning(_("%s: Leap line in non leap"
-                                                   " seconds file %s"),
-                                                 progname, name);
-                                       else    inleap(fields, nfields);
+                                       inleap(fields, nfields);
                                        wantcont = false;
                                        break;
                                default:        /* "cannot happen" */
@@ -1250,7 +1265,7 @@ _("\"Zone %s\" line and -p option are mutually exclusive"),
                if (zones[i].z_name != NULL &&
                        strcmp(zones[i].z_name, fields[ZF_NAME]) == 0) {
                                error(_("duplicate zone name %s"
-                                       " (file \"%s\", line %"PRIdLINENO")"),
+                                       " (file \"%s\", line %"PRIdMAX")"),
                                        fields[ZF_NAME],
                                        zones[i].z_filename,
                                        zones[i].z_linenum);
@@ -1434,15 +1449,9 @@ inleap(char **fields, int nfields)
                if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */
                        positive = false;
                        count = 1;
-               } else if (strcmp(cp, "--") == 0) {
-                       positive = false;
-                       count = 2;
                } else if (strcmp(cp, "+") == 0) {
                        positive = true;
                        count = 1;
-               } else if (strcmp(cp, "++") == 0) {
-                       positive = true;
-                       count = 2;
                } else {
                        error(_("illegal CORRECTION field on Leap line"));
                        return;
@@ -1454,8 +1463,8 @@ inleap(char **fields, int nfields)
                        return;
                }
                t = tadd(t, tod);
-               if (t < early_time) {
-                       error(_("leap second precedes Big Bang"));
+               if (t < 0) {
+                       error(_("leap second precedes Epoch"));
                        return;
                }
                leapadd(t, positive, lp->l_value, count);
@@ -1583,13 +1592,16 @@ rulesub(struct rule *rp, const char *loyearp, const char *hiyearp,
                        error(_("typed single year"));
                        return;
                }
+               warning(_("year type \"%s\" is obsolete; use \"-\" instead"),
+                       typep);
                rp->r_yrtype = ecpyalloc(typep);
        }
        /*
        ** Day work.
        ** Accept things such as:
        **      1
-       **      last-Sunday
+       **      lastSunday
+       **      last-Sunday (undocumented; warn about this)
        **      Sun<=20
        **      Sun>=7
        */
@@ -2753,13 +2765,8 @@ leapadd(zic_t t, bool positive, int rolling, int count)
                exit(EXIT_FAILURE);
        }
        for (i = 0; i < leapcnt; ++i)
-               if (t <= trans[i]) {
-                       if (t == trans[i]) {
-                               error(_("repeated leap second moment"));
-                               exit(EXIT_FAILURE);
-                       }
+               if (t <= trans[i])
                        break;
-               }
        do {
                for (j = leapcnt; j > i; --j) {
                        trans[j] = trans[j - 1];
@@ -2778,11 +2785,17 @@ adjleap(void)
 {
        register int    i;
        register zic_t  last = 0;
+       register zic_t  prevtrans = 0;
 
        /*
        ** propagate leap seconds forward
        */
        for (i = 0; i < leapcnt; ++i) {
+               if (trans[i] - prevtrans < 28 * SECSPERDAY) {
+                 error(_("Leap seconds too close together"));
+                 exit(EXIT_FAILURE);
+               }
+               prevtrans = trans[i];
                trans[i] = tadd(trans[i], last);
                last = corr[i] += last;
        }
@@ -2883,7 +2896,7 @@ lowerit(char a)
 }
 
 /* case-insensitive equality */
-static ATTRIBUTE_PURE bool
+static bool
 ciequal(register const char *ap, register const char *bp)
 {
        while (lowerit(*ap) == lowerit(*bp++))
@@ -2892,7 +2905,7 @@ ciequal(register const char *ap, register const char *bp)
        return false;
 }
 
-static ATTRIBUTE_PURE bool
+static bool
 itsabbr(register const char *abbr, register const char *word)
 {
        if (lowerit(*abbr) != lowerit(*word))
@@ -2906,7 +2919,20 @@ itsabbr(register const char *abbr, register const char *word)
        return true;
 }
 
-static ATTRIBUTE_PURE const struct lookup *
+/* Return true if ABBR is an initial prefix of WORD, ignoring ASCII case.  */
+
+static bool
+ciprefix(char const *abbr, char const *word)
+{
+  do
+    if (!*abbr)
+      return true;
+  while (lowerit(*abbr++) == lowerit(*word++));
+
+  return false;
+}
+
+static const struct lookup *
 byword(const char *word, const struct lookup *table)
 {
        register const struct lookup *  foundlp;
@@ -2914,6 +2940,20 @@ byword(const char *word, const struct lookup *table)
 
        if (word == NULL || table == NULL)
                return NULL;
+
+       /* If TABLE is LASTS and the word starts with "last" followed
+          by a non-'-', skip the "last" and look in WDAY_NAMES instead.
+          Warn about any usage of the undocumented prefix "last-".  */
+       if (table == lasts && ciprefix("last", word) && word[4]) {
+         if (word[4] == '-')
+           warning(_("\"%s\" is undocumented; use \"last%s\" instead"),
+                   word, word + 5);
+         else {
+           word += 4;
+           table = wday_names;
+         }
+       }
+
        /*
        ** Look for exact match.
        */
@@ -2925,11 +2965,25 @@ byword(const char *word, const struct lookup *table)
        */
        foundlp = NULL;
        for (lp = table; lp->l_word != NULL; ++lp)
-               if (itsabbr(word, lp->l_word)) {
+               if (ciprefix(word, lp->l_word)) {
                        if (foundlp == NULL)
                                foundlp = lp;
                        else    return NULL;    /* multiple inexact matches */
                }
+
+       /* Warn about any backward-compatibility issue with pre-2017c zic.  */
+       if (foundlp) {
+         bool pre_2017c_match = false;
+         for (lp = table; lp->l_word; lp++)
+           if (itsabbr(word, lp->l_word)) {
+             if (pre_2017c_match) {
+               warning(_("\"%s\" is ambiguous in pre-2017c zic"), word);
+               break;
+             }
+             pre_2017c_match = true;
+           }
+       }
+
        return foundlp;
 }
 
@@ -3133,11 +3187,14 @@ mkdirs(char const *argname, bool ancestors)
 
        cp = name = ecpyalloc(argname);
 
+       /* On MS-Windows systems, do not worry about drive letters or
+          backslashes, as this should suffice in practice.  Time zone
+          names do not use drive letters and backslashes.  If the -d
+          option of zic does not name an already-existing directory,
+          it can use slashes to separate the already-existing
+          ancestor prefix from the to-be-created subdirectories.  */
+
        /* Do not mkdir a root directory, as it must exist.  */
-#ifdef HAVE_DOS_FILE_NAMES
-       if (is_alpha(name[0]) && name[1] == ':')
-         cp += 2;
-#endif
        while (*cp == '/')
          cp++;
 
diff --git a/zishrink.awk b/zishrink.awk
new file mode 100644 (file)
index 0000000..02c883a
--- /dev/null
@@ -0,0 +1,156 @@
+# Convert tzdata source into a smaller version of itself.
+
+# Contributed by Paul Eggert.  This file is in the public domain.
+
+# This is not a general-purpose converter; it is designed for current tzdata.
+# 'zic' should treat this script's output as if it were identical to
+# this script's input.
+
+
+# Return a new rule name.
+# N_RULE_NAMES keeps track of how many rule names have been generated.
+
+function gen_rule_name(alphabet, base, rule_name, n, digit)
+{
+  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
+}
+
+# Process an input line and save it for later output.
+
+function process_input_line(line, field, end, i, n, startdef)
+{
+  # Remove comments, normalize spaces, and append a space to each line.
+  sub(/#.*/, "", line)
+  line = line " "
+  gsub(/[[:space:]]+/, " ", line)
+
+  # Abbreviate keywords.  Do not abbreviate "Link" to just "L",
+  # as pre-2017c zic erroneously diagnoses "Li" as ambiguous.
+  sub(/^Link /, "Li ", line)
+  sub(/^Rule /, "R ", line)
+  sub(/^Zone /, "Z ", line)
+
+  # SystemV rules are not needed.
+  if (line ~ /^R SystemV /) return
+
+  # Replace FooAsia rules with the same rules without "Asia", as they
+  # are duplicates.
+  if (match(line, /[^ ]Asia /)) {
+    if (line ~ /^R /) return
+    line = substr(line, 1, RSTART) substr(line, RSTART + 5)
+  }
+
+  # Abbreviate times.
+  while (match(line, /[: ]0+[0-9]/))
+    line = substr(line, 1, RSTART) substr(line, RSTART + RLENGTH - 1)
+  while (match(line, /:0[^:]/))
+    line = substr(line, 1, RSTART - 1) substr(line, RSTART + 2)
+
+  # Abbreviate weekday names.  Do not abbreviate "Sun" and "Sat", as
+  # pre-2017c zic erroneously diagnoses "Su" and "Sa" as ambiguous.
+  while (match(line, / (last)?(Mon|Wed|Fri)[ <>]/)) {
+    end = RSTART + RLENGTH
+    line = substr(line, 1, end - 4) substr(line, end - 1)
+  }
+  while (match(line, / (last)?(Tue|Thu)[ <>]/)) {
+    end = RSTART + RLENGTH
+    line = substr(line, 1, end - 3) substr(line, end - 1)
+  }
+
+  # Abbreviate "max", "only" and month names.
+  # Do not abbreviate "min", as pre-2017c zic erroneously diagnoses "mi"
+  # as ambiguous.
+  gsub(/ max /, " ma ", line)
+  gsub(/ only /, " o ", line)
+  gsub(/ Jan /, " Ja ", line)
+  gsub(/ Feb /, " F ", line)
+  gsub(/ Apr /, " Ap ", line)
+  gsub(/ Aug /, " Au ", line)
+  gsub(/ Sep /, " S ", line)
+  gsub(/ Oct /, " O ", line)
+  gsub(/ Nov /, " N ", line)
+  gsub(/ Dec /, " D ", line)
+
+  # Strip leading and trailing space.
+  sub(/^ /, "", line)
+  sub(/ $/, "", line)
+
+  # Remove unnecessary trailing zero fields.
+  sub(/ 0+$/, "", line)
+
+  # Remove unnecessary trailing days-of-month "1".
+  if (match(line, /[[:alpha:]] 1$/))
+    line = substr(line, 1, RSTART)
+
+  # Remove unnecessary trailing " Ja" (for January).
+  sub(/ Ja$/, "", line)
+
+  n = split(line, field)
+
+  # Abbreviate rule names.
+  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()
+    field[i] = rule[field[i]]
+  }
+
+  # If this zone supersedes an earlier one, delete the earlier one
+  # from the saved output lines.
+  startdef = ""
+  if (field[1] == "Z")
+    zonename = startdef = field[2]
+  else if (field[1] == "Li")
+    zonename = startdef = field[3]
+  else if (field[1] == "R")
+    zonename = ""
+  if (startdef) {
+    i = zonedef[startdef]
+    if (i) {
+      do
+       output_line[i - 1] = ""
+      while (output_line[i++] ~ /^[-+0-9]/);
+    }
+  }
+  zonedef[zonename] = nout + 1
+
+  # Save the line for later output.
+  line = field[1]
+  for (i = 2; i <= n; i++)
+    line = line " " field[i]
+  output_line[nout++] = line
+}
+
+function output_saved_lines(i)
+{
+  for (i = 0; i < nout; i++)
+    if (output_line[i])
+      print output_line[i]
+}
+
+BEGIN {
+  print "# This zic input file is in the public domain."
+}
+
+/^[[:space:]]*[^#[:space:]]/ {
+  process_input_line($0)
+}
+
+END {
+  output_saved_lines()
+}
index 204048c..2d0b26b 100644 (file)
--- a/zone.tab
+++ b/zone.tab
@@ -186,7 +186,7 @@ GB  +513030-0000731 Europe/London
 GD     +1203-06145     America/Grenada
 GE     +4143+04449     Asia/Tbilisi
 GF     +0456-05220     America/Cayenne
-GG     +4927-00232     Europe/Guernsey
+GG     +492717-0023210 Europe/Guernsey
 GH     +0533-00013     Africa/Accra
 GI     +3608-00521     Europe/Gibraltar
 GL     +6411-05144     America/Godthab Greenland (most areas)
@@ -221,7 +221,7 @@ IQ  +3321+04425     Asia/Baghdad
 IR     +3540+05126     Asia/Tehran
 IS     +6409-02151     Atlantic/Reykjavik
 IT     +4154+01229     Europe/Rome
-JE     +4912-00207     Europe/Jersey
+JE     +491101-0020624 Europe/Jersey
 JM     +175805-0764736 America/Jamaica
 JO     +3157+03556     Asia/Amman
 JP     +353916+1394441 Asia/Tokyo
index 2bcdc64..455e797 100644 (file)
@@ -2,7 +2,7 @@
 #
 # This file is in the public domain.
 #
-# From Paul Eggert (2014-07-31):
+# 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
 # a single tab.  Lines beginning with '#' are comments.  All text uses
@@ -15,7 +15,7 @@
 #     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' file for how zone names are chosen.
+#     Please see the theory.html file for how zone names are chosen.
 #     If multiple zones 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.
@@ -316,10 +316,11 @@ RU        +6445+17729     Asia/Anadyr     MSK+09 - Bering Sea
 SA,KW,YE       +2438+04643     Asia/Riyadh
 SB     -0932+16012     Pacific/Guadalcanal
 SC     -0440+05528     Indian/Mahe
-SD,SS  +1536+03232     Africa/Khartoum
+SD     +1536+03232     Africa/Khartoum
 SE     +5920+01803     Europe/Stockholm
 SG     +0117+10351     Asia/Singapore
 SR     +0550-05510     America/Paramaribo
+SS     +0451+03137     Africa/Juba
 SV     +1342-08912     America/El_Salvador
 SY     +3330+03618     Asia/Damascus
 TC     +2128-07108     America/Grand_Turk