summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2018-10-19 23:05:35 +0000
committerchristos <christos@NetBSD.org>2018-10-19 23:05:35 +0000
commitbc4e3aa0bcf761a4e8cd0c43367986f3ae0b199f (patch)
treee49173c0a35ae60839ba4db16d94ff9dec18cb54
parent73e87e7a47ad06f1f3110d3c32fbc2ccbb33204d (diff)
Update to 2018f:
Changes to code zic now always generates TZif files where time type 0 is used for timestamps before the first transition. This simplifies the reading of TZif files and should not affect behavior of existing TZif readers because the same set of time types is used; only their internal indexes may have changed. This affects only the legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and EET, which previously used nonzero types for these timestamps. Because of the type 0 change, zic no longer outputs a dummy transition at time -2**59 (before the Big Bang), as clients should no longer need this to handle historical timestamps correctly. This reverts a change introduced in 2013d and shrinks most TZif files by a few bytes. zic now supports negative time-of-day in Rule and Leap lines, e.g., "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition occurs at 18:00 on the Saturday before the last Sunday in April. This behavior was documented in 2018a but the code did not entirely match the documentation. localtime.c no longer requires at least one time type in TZif files that lack transitions or have a POSIX-style TZ string. This future-proofs the code against possible future extensions to the format that would allow TZif files with POSIX-style TZ strings and without transitions or time types. A read-access subscript error in localtime.c has been fixed. It could occur only in TZif files with timecnt == 0, something that does not happen in practice now but could happen in future versions. localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last transition (or for all time stamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, and supports leap seconds at the ends of months other than June and December. (Inspired by suggestions from Chris Woodbury.) Changes to documentation New restrictions: A Rule name must start with a character that is neither an ASCII digit nor "-" nor "+", and an unquoted name should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~". The latter restriction makes room for future extensions (a possibility noted by Tom Lane). tzfile.5 now documents what time types apply before the first and after the last transition, if any. Documentation now uses the spelling "timezone" for a TZ setting that determines timestamp history, and "time zone" for a geographic region currently sharing the same standard time. The name "TZif" is now used for the tz binary data format. tz-link.htm now mentions the A0 TimeZone Migration utilities. (Thanks to Aldrin Martoq for the link.)
-rw-r--r--lib/libc/time/CONTRIBUTING13
-rw-r--r--lib/libc/time/Makefile330
-rw-r--r--lib/libc/time/NEWS311
-rw-r--r--lib/libc/time/README16
-rw-r--r--lib/libc/time/ctime.318
-rw-r--r--lib/libc/time/difftime.c6
-rw-r--r--lib/libc/time/localtime.c95
-rw-r--r--lib/libc/time/private.h4
-rw-r--r--lib/libc/time/strftime.310
-rw-r--r--lib/libc/time/strftime.c7
-rw-r--r--lib/libc/time/theory.html203
-rw-r--r--lib/libc/time/tz-art.html10
-rw-r--r--lib/libc/time/tz-how-to.html5
-rw-r--r--lib/libc/time/tz-link.html114
-rw-r--r--lib/libc/time/tzfile.544
-rw-r--r--lib/libc/time/tzselect.814
-rw-r--r--lib/libc/time/tzselect.ksh26
-rw-r--r--lib/libc/time/tzset.324
-rw-r--r--lib/libc/time/version2
-rw-r--r--lib/libc/time/zdump.837
-rw-r--r--lib/libc/time/zdump.c8
-rw-r--r--lib/libc/time/zic.8118
22 files changed, 880 insertions, 535 deletions
diff --git a/lib/libc/time/CONTRIBUTING b/lib/libc/time/CONTRIBUTING
index 4d84a760a75..2174b2cab20 100644
--- a/lib/libc/time/CONTRIBUTING
+++ b/lib/libc/time/CONTRIBUTING
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell command like
'diff -u old/europe new/europe >myfix.patch', and attach
myfix.patch to the email.
-For more-elaborate changes, please read the theory.html file and browse
-the mailing list archives <https://mm.icann.org/pipermail/tz/> for
-examples of patches that tend to work well. Additions to
-data should contain commentary citing reliable sources as
-justification. Citations should use https: URLs if available.
+For more-elaborate or possibly-controversial changes,
+such as renaming, adding or removing zones, please read
+<https://www.iana.org/time-zones/repository/theory.html> or the file
+theory.html. It is also good to browse the mailing list archives
+<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
+to work well. Additions to data should contain commentary citing
+reliable sources as justification. Citations should use https: URLs
+if available.
Please submit changes against either the latest release in
<https://www.iana.org/time-zones> or the master branch of the development
diff --git a/lib/libc/time/Makefile b/lib/libc/time/Makefile
index 21fa4889a3e..d56a198fb4f 100644
--- a/lib/libc/time/Makefile
+++ b/lib/libc/time/Makefile
@@ -1,3 +1,5 @@
+# Make and install tzdb code and data.
+
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -19,9 +21,9 @@ BUGEMAIL= tz@iana.org
# DATAFORM= rearguard
DATAFORM= main
-# Change the line below for your time zone (after finding the zone you want in
-# the time zone files, or adding it to a time zone file).
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Change the line below for your timezone (after finding the one you want in
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
# zic -l rightzone
# to correct things.
# Use the command
@@ -31,14 +33,14 @@ DATAFORM= main
LOCALTIME= GMT
# If you want something other than Eastern United States time as a template
-# for handling POSIX-style time zone environment variables,
-# change the line below (after finding the zone you want in the
-# time zone files, or adding it to a time zone file).
+# for handling POSIX-style timezone environment variables,
+# change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
# When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# daylight saving time.
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Alternatively, if you discover you've got the wrong timezone, you can just
# zic -p rightzone
# to correct things.
# Use the command
@@ -75,7 +77,7 @@ DESTDIR =
# TOPDIR should be empty or an absolute name unless you're just testing.
TOPDIR =
-# The default local time zone is taken from the file TZDEFAULT.
+# The default local timezone is taken from the file TZDEFAULT.
TZDEFAULT = $(TOPDIR)/etc/localtime
# The subdirectory containing installed program and data files, and
@@ -84,7 +86,7 @@ TZDEFAULT = $(TOPDIR)/etc/localtime
USRDIR = usr
USRSHAREDIR = $(USRDIR)/share
-# "Compiled" time zone information is placed in the "TZDIR" directory
+# "Compiled" timezone information is placed in the "TZDIR" directory
# (and subdirectories).
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
TZDIR_BASENAME= zoneinfo
@@ -106,9 +108,13 @@ MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
LIBDIR = $(TOPDIR)/$(USRDIR)/lib
-# Types to try, as an alternative to time_t. int64_t should be first.
-TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
+# Types to try, as an alternative to time_t.
+TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
+TIME_T_ALTERNATIVES_HEAD = int64_t
+TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
+# What kind of TZif data files to generate.
+# (TZif is the binary time zone data format that zic generates.)
# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
# REDO= posix_only
@@ -129,7 +135,7 @@ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
REDO= posix_right
-# To install data in text form that has all the information of the binary data,
+# To install data in text form that has all the information of the TZif data,
# (optionally incorporating leap second information), use
# TZDATA_TEXT= tzdata.zi leapseconds
# To install text data without leap second information (e.g., because
@@ -171,7 +177,6 @@ LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed to override
# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1".
-# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
# formats that generate only the last two digits of year numbers
# -DEPOCH_LOCAL if the 'time' function returns local time not UT
@@ -295,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
-# time (rather than the time specified in the TZ environment variable)
+# time (rather than the timezone specified in the TZ environment variable)
# to be used.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
@@ -318,7 +323,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
# "posix2time_z" and "time2posix_z" are added as well.
# The functions ending in "_z" (or "_rz") are like their unsuffixed
# (or suffixed-by-"_r") counterparts, except with an extra first
-# argument of opaque type timezone_t that specifies the time zone.
+# argument of opaque type timezone_t that specifies the timezone.
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
#
# If you want to allocate state structures in localtime, add
@@ -357,11 +362,14 @@ ZIC= $(zic) $(ZFLAGS)
ZFLAGS=
-# How to use zic to install tz binary files.
+# How to use zic to install TZif files.
ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
# The name of a Posix-compliant 'awk' on your system.
+# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core;
+# on Ubuntu you can work around this with
+# AWK= gawk
AWK= awk
# The full path name of a Posix-compliant shell, preferably one that supports
@@ -410,10 +418,16 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]'
+# These characters are Latin-1, and so are likely to be displayable
+# even in editors with limited character sets.
+UNUSUAL_OK_LATIN_1 = «°±»½¾×
+# This IPA symbol is represented in Unicode as the composition of
+# U+0075 and U+032F, and U+032F is not considered alphabetic by some
+# grep implementations that do not grok composition.
+UNUSUAL_OK_IPA = u̯
# Non-ASCII non-letters that OK_CHAR allows, as these characters are
-# useful in commentary. XEmacs 21.5.34 displays them correctly,
-# presumably because they are Latin-1.
-UNUSUAL_OK_CHARSET= °±½¾×
+# useful in commentary.
+UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
@@ -492,11 +506,14 @@ AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
ziguard.awk zishrink.awk
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
TZS_YEAR= 2050
+TZS_CUTOFF_FLAG= -c $(TZS_YEAR)
TZS= to$(TZS_YEAR).tzs
TZS_NEW= to$(TZS_YEAR)new.tzs
TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \
private.h tzfile.h zdump.c zic.c
-ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi
+# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
+EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
+ENCHILADA = $(EIGHT_YARDS) $(TZS)
# Consult these files when deciding whether to rebuild the 'version' file.
# This list is not the same as the output of 'git ls-files', since
@@ -560,14 +577,21 @@ version: $(VERSION_DEPS)
printf '%s\n' "$$V" >$@.out
mv $@.out $@
-# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
+# These files can be tailored by setting BACKWARD and PACKRATDATA.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
$(TDATA) $(PACKRATDATA) >$@.out
mv $@.out $@
-tzdata.zi: $(DATAFORM).zi version
+# This file has a version comment that attempts to capture any tailoring
+# via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
+tzdata.zi: $(DATAFORM).zi version zishrink.awk
version=`sed 1q version` && \
- LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
+ LC_ALL=C $(AWK) \
+ -v dataform='$(DATAFORM)' \
+ -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
+ -v redo='$(REDO)' \
+ -v version="$$version" \
+ -f zishrink.awk \
$(DATAFORM).zi >$@.out
mv $@.out $@
@@ -605,14 +629,16 @@ INSTALLARGS = \
YEARISTYPE='$(YEARISTYPE)' \
ZIC='$(ZIC)'
-# 'make install_data' installs one set of tz binary files.
-install_data: zic leapseconds yearistype tzdata.zi
+INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
+
+# 'make install_data' installs one set of TZif files.
+install_data: $(INSTALL_DATA_DEPS)
$(ZIC_INSTALL) tzdata.zi
-posix_only:
+posix_only: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
-right_only:
+right_only: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
install_data
@@ -639,7 +665,7 @@ posix_right: posix_only
# This obsolescent rule is present for backwards compatibility with
# tz releases 2014g through 2015g. It should go away eventually.
-posix_packrat:
+posix_packrat: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
zones: $(REDO)
@@ -650,29 +676,33 @@ ZDS = dummy.zd
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
# It is separate so that GNU 'make -j' can run instances in parallel.
$(ZDS): zdump
- ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@
-
-$(TZS_NEW): tzdata.zi zdump zic
- rm -fr tzs.dir
- mkdir tzs.dir
- $(zic) -d tzs.dir tzdata.zi
+ ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
+ >$@
+
+TZS_NEW_DEPS = tzdata.zi zdump zic
+$(TZS_NEW): $(TZS_NEW_DEPS)
+ rm -fr tzs$(TZS_YEAR).dir
+ mkdir tzs$(TZS_YEAR).dir
+ $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
tzdata.zi | LC_ALL=C sort >$@.out
wd=`pwd` && \
- set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
+ x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
+ tzdata.zi \
| LC_ALL=C sort -t . -k 2,2` && \
+ set x $$x && \
shift && \
ZDS=$$* && \
- $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
- sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out
- rm -fr tzs.dir
+ $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
+ ZDS="$$ZDS" $$ZDS && \
+ sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
+ rm -fr tzs$(TZS_YEAR).dir
mv $@.out $@
-# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
-# If it exists but 'make check_tzs' fails, a maintainer should inspect the
+# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
$(TZS):
- $(MAKE) force_tzs
+ touch $@
force_tzs: $(TZS_NEW)
cp $(TZS_NEW) $(TZS)
@@ -711,18 +741,21 @@ check_character_set: $(ENCHILADA)
$(MISC) $(SOURCES) $(WEB_PAGES) \
CONTRIBUTING LICENSE README \
version tzdata.zi && \
- ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
+ ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
Makefile && \
! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
leapseconds yearistype.sh zone.tab && \
! grep -Env $(OK_LINE) $(ENCHILADA); \
}
+ touch $@
check_white_space: $(ENCHILADA)
patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
- ! grep -En "$$pat" $(ENCHILADA)
+ ! grep -En "$$pat" \
+ $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
! grep -n '[[:space:]]$$' \
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
+ touch $@
PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
FILE_NAME_COMPONENT_TOO_LONG = \
@@ -731,6 +764,7 @@ FILE_NAME_COMPONENT_TOO_LONG = \
check_name_lengths: $(TDATA_TO_CHECK) backzone
! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
$(TDATA_TO_CHECK) backzone
+ touch $@
CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
@@ -743,52 +777,61 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
LC_ALL=C sort -c
$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
LC_ALL=C sort -cu
+ touch $@
check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
$(AWK) -f checklinks.awk tzdata.zi
+ touch $@
check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
for tab in $(ZONETABLES); do \
$(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
|| exit; \
done
+ touch $@
check_tzs: $(TZS) $(TZS_NEW)
- diff -u $(TZS) $(TZS_NEW)
+ if test -s $(TZS); then \
+ diff -u $(TZS) $(TZS_NEW); \
+ else \
+ cp $(TZS_NEW) $(TZS); \
+ fi
+ touch $@
# This checks only the HTML 4.01 strict page.
# To check the the other pages, use <https://validator.w3.org/>.
check_web: tz-how-to.html
$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
+ touch $@
# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
-check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
- $(DATAFORM).zi tzdata.zi
- for type in posix right; do \
- mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
- time_t.dir/$$type-shrunk && \
- case $$type in \
- right) leap='-L leapseconds';; \
- *) leap=;; \
- esac && \
- $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
+check_zishrink: check_zishrink_posix check_zishrink_right
+check_zishrink_posix check_zishrink_right: \
+ zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
+ rm -fr $@.dir $@-t.dir $@-shrunk.dir
+ mkdir $@.dir $@-t.dir $@-shrunk.dir
+ case $@ in \
+ *_right) leap='-L leapseconds';; \
+ *) leap=;; \
+ esac && \
+ $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
+ $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
case $(DATAFORM) in \
main) \
- $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
+ $(ZIC) $$leap -d $@-t.dir $(TDATA) && \
$(AWK) '/^Rule/' $(TDATA) | \
- $(ZIC) $$leap -d time_t.dir/$$type-t - \
- $(PACKRATDATA) && \
- diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
- esac && \
- $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
- diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
- done
- rm -fr time_t.dir
+ $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
+ diff -r $@.dir $@-t.dir;; \
+ esac
+ diff -r $@.dir $@-shrunk.dir
+ rm -fr $@.dir $@-t.dir $@-shrunk.dir
+ touch $@
clean_misc:
- rm -f core *.o *.out \
+ rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
+ check_* core typecheck_* \
date tzselect version.h zdump zic yearistype libtz.a
clean: clean_misc
rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
@@ -818,17 +861,17 @@ $(MANTXTS): workman.sh
LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
mv $@.out $@
-# Set the time stamps to those of the git repository, if available,
+# Set the timestamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
# Also, set the timestamp of each prebuilt file like 'leapseconds'
# to be the maximum of the files it depends on.
-set-timestamps.out: $(ENCHILADA)
+set-timestamps.out: $(EIGHT_YARDS)
rm -f $@
if (type git) >/dev/null 2>&1 && \
- files=`git ls-files $(ENCHILADA)` && \
+ files=`git ls-files $(EIGHT_YARDS)` && \
touch -md @1 test.out; then \
rm -f test.out && \
for file in $$files; do \
@@ -846,83 +889,100 @@ set-timestamps.out: $(ENCHILADA)
exit; \
done
touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
- touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
touch $@
+set-tzs-timestamp.out: $(TZS)
+ touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
+ touch $@
# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.
-check_public:
- $(MAKE) maintainer-clean
- $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
- mkdir -p public.dir
- for i in $(TDATA_TO_CHECK) tzdata.zi; do \
- $(zic) -v -d public.dir $$i 2>&1 || exit; \
+check_public: $(VERSION_DEPS)
+ rm -fr public.dir
+ mkdir public.dir
+ ln $(VERSION_DEPS) public.dir
+ cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
+ for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \
+ public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
done
- $(zic) -v -d public.dir $(TDATA_TO_CHECK)
+ public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
rm -fr public.dir
+ touch $@
# Check that the code works under various alternative
# implementations of time_t.
-check_time_t_alternatives:
- if diff -q Makefile Makefile 2>/dev/null; then \
- quiet_option='-q'; \
- else \
- quiet_option=''; \
- fi && \
+check_time_t_alternatives: $(TIME_T_ALTERNATIVES)
+$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD)
+$(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
+ rm -fr $@.dir
+ mkdir $@.dir
+ ln $(VERSION_DEPS) $@.dir
+ case $@ in \
+ int32_t) range=-2147483648,2147483648;; \
+ u*) range=0,4294967296;; \
+ *) range=-4294967296,4294967296;; \
+ esac && \
wd=`pwd` && \
zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
- for type in $(TIME_T_ALTERNATIVES); do \
- mkdir -p time_t.dir/$$type && \
- $(MAKE) clean_misc && \
- $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
- CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
+ if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \
+ range_target=; \
+ else \
+ range_target=to$$range.tzs; \
+ fi && \
+ (cd $@.dir && \
+ $(MAKE) TOPDIR="$$wd/$@.dir" \
+ CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \
REDO='$(REDO)' \
- install && \
- diff $$quiet_option -r \
- time_t.dir/int64_t/etc \
- time_t.dir/$$type/etc && \
- diff $$quiet_option -r \
- time_t.dir/int64_t/usr/share \
- time_t.dir/$$type/usr/share && \
- case $$type in \
- int32_t) range=-2147483648,2147483647;; \
- uint32_t) range=0,4294967296;; \
- int64_t) continue;; \
- *u*) range=0,10000000000;; \
- *) range=-10000000000,10000000000;; \
- esac && \
- echo checking $$type zones ... && \
- time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
- >time_t.dir/int64_t.out && \
- time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
- >time_t.dir/$$type.out && \
- diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
- || exit; \
- done
- rm -fr time_t.dir
+ D=$$wd/$@.dir \
+ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
+ install $$range_target) && \
+ test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \
+ (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \
+ $(MAKE) TOPDIR="$$wd/$@.dir" \
+ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
+ D=$$wd/$@.dir \
+ to$$range.tzs) && \
+ diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \
+ $@.dir/to$$range.tzs && \
+ if diff -q Makefile Makefile 2>/dev/null; then \
+ quiet_option='-q'; \
+ else \
+ quiet_option=''; \
+ fi && \
+ diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \
+ $@.dir/etc && \
+ diff $$quiet_option -r \
+ $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \
+ $@.dir/usr/share; \
+ }
+ touch $@
TRADITIONAL_ASC = \
tzcode$(VERSION).tar.gz.asc \
tzdata$(VERSION).tar.gz.asc
-ALL_ASC = $(TRADITIONAL_ASC) \
- tzdata$(VERSION)-rearguard.tar.gz.asc \
+REARGUARD_ASC = \
+ tzdata$(VERSION)-rearguard.tar.gz.asc
+ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
tzdb-$(VERSION).tar.lz.asc
-tarballs traditional_tarballs signatures traditional_signatures: version
+tarballs rearguard_tarballs traditional_tarballs \
+signatures rearguard_signatures traditional_signatures: \
+ version set-timestamps.out rearguard.zi
VERSION=`cat version` && \
$(MAKE) VERSION="$$VERSION" $@_version
# These *_version rules are intended for use if VERSION is set by some
# other means. Ordinarily these rules are used only by the above
# non-_version rules, which set VERSION on the 'make' command line.
-tarballs_version: traditional_tarballs_version \
- tzdata$(VERSION)-rearguard.tar.gz \
+tarballs_version: traditional_tarballs_version rearguard_tarballs_version \
tzdb-$(VERSION).tar.lz
+rearguard_tarballs_version: \
+ tzdata$(VERSION)-rearguard.tar.gz
traditional_tarballs_version: \
tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
signatures_version: $(ALL_ASC)
+rearguard_signatures_version: $(REARGUARD_ASC)
traditional_signatures_version: $(TRADITIONAL_ASC)
tzcode$(VERSION).tar.gz: set-timestamps.out
@@ -958,7 +1018,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
gzip $(GZIPFLAGS)) >$@.out
mv $@.out $@
-tzdb-$(VERSION).tar.lz: set-timestamps.out
+tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
rm -fr tzdb-$(VERSION)
mkdir tzdb-$(VERSION)
ln $(ENCHILADA) tzdb-$(VERSION)
@@ -972,16 +1032,26 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
$(ALL_ASC):
- gpg --armor --detach-sign $?
-
-typecheck:
- $(MAKE) clean
- for i in "long long" unsigned; \
- do \
- $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
- ./zdump -v Europe/Rome ; \
- $(MAKE) clean ; \
- done
+ gpg2 --armor --detach-sign $?
+
+TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
+typecheck: typecheck_long_long typecheck_unsigned
+typecheck_long_long typecheck_unsigned: $(VERSION_DEPS)
+ rm -fr $@.dir
+ mkdir $@.dir
+ ln $(VERSION_DEPS) $@.dir
+ cd $@.dir && \
+ case $@ in \
+ *_long_long) i="long long";; \
+ *_unsigned ) i="unsigned" ;; \
+ esac && \
+ typecheck_cflags='' && \
+ $(MAKE) \
+ CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \
+ TOPDIR="`pwd`" \
+ install
+ $@.dir/zdump -i -c 1970,1971 Europe/Rome
+ touch $@
zonenames: tzdata.zi
@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
@@ -997,14 +1067,14 @@ zic.o: private.h tzfile.h version.h
.KEEP_STATE:
.PHONY: ALL INSTALL all
-.PHONY: check check_character_set check_links check_name_lengths
-.PHONY: check_public check_sorted check_tables
-.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
+.PHONY: check check_time_t_alternatives
.PHONY: check_zishrink
.PHONY: clean clean_misc dummy.zd force_tzs
.PHONY: install install_data maintainer-clean names
-.PHONY: posix_only posix_packrat posix_right
-.PHONY: public right_only right_posix signatures signatures_version
+.PHONY: posix_only posix_packrat posix_right public
+.PHONY: rearguard_signatures rearguard_signatures_version
+.PHONY: rearguard_tarballs rearguard_tarballs_version
+.PHONY: right_only right_posix signatures signatures_version
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
diff --git a/lib/libc/time/NEWS b/lib/libc/time/NEWS
index 9c445cd0be8..aeeef10f8cd 100644
--- a/lib/libc/time/NEWS
+++ b/lib/libc/time/NEWS
@@ -1,5 +1,136 @@
News for the tz database
+Release 2018f - 2018-10-18 00:14:18 -0700
+
+ Briefly:
+ Volgograd moves from +03 to +04 on 2018-10-28.
+ Fiji ends DST 2019-01-13, not 2019-01-20.
+ Most of Chile changes DST dates, effective 2019-04-06.
+
+ Changes to future timestamps
+
+ Volgograd moves from +03 to +04 on 2018-10-28 at 02:00.
+ (Thanks to Alexander Fetisov and Stepan Golosunov.)
+
+ Fiji ends DST 2019-01-13 instead of the 2019-01-20 previously
+ predicted. (Thanks to Raymond Kumar.) Adjust future predictions
+ accordingly.
+
+ Most of Chile will end DST on the first Saturday in April at 24:00 mainland
+ time, and resume DST on the first Saturday in September at 24:00 mainland
+ time. The changes are effective from 2019-04-06, and do not affect the
+ Magallanes region modeled by America/Punta_Arenas. (Thanks to Juan Correa
+ and Tim Parenti.) Adjust future predictions accordingly.
+
+ Changes to past timestamps
+
+ The 2018-05-05 North Korea 30-minute time zone change took place
+ at 23:30 the previous day, not at 00:00 that day.
+
+ China's 1988 spring-forward transition was on April 17, not
+ April 10. Its DST transitions in 1986/91 were at 02:00, not 00:00.
+ (Thanks to P Chan.)
+
+ Fix several issues for Macau before 1992. Macau's pre-1904 LMT
+ was off by 10 s. Macau switched to +08 in 1904 not 1912, and
+ temporarily switched to +09/+10 during World War II. Macau
+ observed DST in 1942/79, not 1961/80, and there were several
+ errors for transition times and dates. (Thanks to P Chan.)
+
+ The 1948-1951 fallback transitions in Japan were at 25:00 on
+ September's second Saturday, not at 24:00. (Thanks to Phake Nick.)
+ zic turns this into 01:00 on the day after September's second
+ Saturday, which is the best that POSIX or C platforms can do.
+
+ Incorporate 1940-1949 Asia/Shanghai DST transitions from a 2014
+ paper by Li Yu, replacing more-questionable data from Shanks.
+
+ Changes to time zone abbreviations
+
+ Use "PST" and "PDT" for Philippine time. (Thanks to Paul Goyette.)
+
+ Changes to code
+
+ zic now always generates TZif files where time type 0 is used for
+ timestamps before the first transition. This simplifies the
+ reading of TZif files and should not affect behavior of existing
+ TZif readers because the same set of time types is used; only
+ their internal indexes may have changed. This affects only the
+ legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and
+ EET, which previously used nonzero types for these timestamps.
+
+ Because of the type 0 change, zic no longer outputs a dummy
+ transition at time -2**59 (before the Big Bang), as clients should
+ no longer need this to handle historical timestamps correctly.
+ This reverts a change introduced in 2013d and shrinks most TZif
+ files by a few bytes.
+
+ zic now supports negative time-of-day in Rule and Leap lines, e.g.,
+ "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition
+ occurs at 18:00 on the Saturday before the last Sunday in April.
+ This behavior was documented in 2018a but the code did not
+ entirely match the documentation.
+
+ localtime.c no longer requires at least one time type in TZif
+ files that lack transitions or have a POSIX-style TZ string. This
+ future-proofs the code against possible future extensions to the
+ format that would allow TZif files with POSIX-style TZ strings and
+ without transitions or time types.
+
+ A read-access subscript error in localtime.c has been fixed.
+ It could occur only in TZif files with timecnt == 0, something that
+ does not happen in practice now but could happen in future versions.
+
+ localtime.c no longer ignores TZif POSIX-style TZ strings that
+ specify only standard time. Instead, these TZ strings now
+ override the default time type for timestamps after the last
+ transition (or for all time stamps if there are no transitions),
+ just as DST strings specifying DST have always done.
+
+ leapseconds.awk now outputs "#updated" and "#expires" comments,
+ and supports leap seconds at the ends of months other than June
+ and December. (Inspired by suggestions from Chris Woodbury.)
+
+ Changes to documentation
+
+ New restrictions: A Rule name must start with a character that
+ is neither an ASCII digit nor "-" nor "+", and an unquoted name
+ should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~".
+ The latter restriction makes room for future extensions (a
+ possibility noted by Tom Lane).
+
+ tzfile.5 now documents what time types apply before the first and
+ after the last transition, if any.
+
+ Documentation now uses the spelling "timezone" for a TZ setting
+ that determines timestamp history, and "time zone" for a
+ geographic region currently sharing the same standard time.
+
+ The name "TZif" is now used for the tz binary data format.
+
+ tz-link.htm now mentions the A0 TimeZone Migration utilities.
+ (Thanks to Aldrin Martoq for the link.)
+
+ Changes to build procedure
+
+ New 'make' target 'rearguard_tarballs' to build the rearguard
+ tarball only. This is a convenience on platforms that lack lzip
+ if you want to build the rearguard tarball. (Problem reported by
+ Deborah Goldsmith.)
+
+ tzdata.zi is now more stable from release to release. (Problem
+ noted by Tom Lane.) It is also a bit shorter.
+
+ tzdata.zi now can contain comment lines documenting configuration
+ information, such as which data format was selected, which input
+ files were used, and how leap seconds are treated. (Problems
+ noted by Lester Caine and Brian Inglis.) If the Makefile defaults
+ are used these comment lines are absent, for backward
+ compatibility. A redistributor intending to alter its copy of the
+ files should also append "-LABEL" to the 'version' file's first
+ line, where "LABEL" identifies the redistributor's change.
+
+
Release 2018e - 2018-05-01 23:42:51 -0700
Briefly:
@@ -9,7 +140,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
'make tarballs' now also builds a rearguard tarball.
New 's' and 'd' suffixes in SAVE columns of Rule and Zone lines.
- Changes to past and future time stamps
+ Changes to past and future timestamps
North Korea switches back from +0830 to +09 on 2018-05-05.
(Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon,
@@ -17,9 +148,9 @@ Release 2018e - 2018-05-01 23:42:51 -0700
Bring back the negative-DST changes of 2018a, except be more
compatible with data parsers that do not support negative DST.
- Also, this now affects historical time stamps in Namibia and the
+ Also, this now affects historical timestamps in Namibia and the
former Czechoslovakia, not just Ireland. The main format now uses
- negative DST to model time stamps in Europe/Dublin (from 1971 on),
+ negative DST to model timestamps in Europe/Dublin (from 1971 on),
Europe/Prague (1946/7), and Africa/Windhoek (1994/2017). This
does not affect UT offsets, only time zone abbreviations and the
tm_isdst flag. Also, this does not affect rearguard or vanguard
@@ -44,7 +175,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
in tzdata, it could be used to specify the legal time in Namibia
1994-2017, as opposed to the popular time (see below).
- Changes to past time stamps
+ Changes to past timestamps
From 1994 through 2017 Namibia observed DST in winter, not summer.
That is, it used negative DST, as Ireland still does. This change
@@ -54,12 +185,12 @@ Release 2018e - 2018-05-01 23:42:51 -0700
both simply called "standard time" in Namibian law, in common
practice winter time was considered to be DST (as noted by Stephen
Colebourne). The full effect of this change is only in vanguard
- format; in rearguard and main format, the tm_isdst flag is still
+ and main format; in rearguard format, the tm_isdst flag is still
zero in winter and nonzero in summer.
In 1946/7 Czechoslovakia also observed negative DST in winter.
- The full effect of this change is only in vanguard format; in
- rearguard and main formats, it is modeled as plain GMT without
+ The full effect of this change is only in vanguard and main
+ formats; in rearguard format, it is modeled as plain GMT without
daylight saving. Also, the dates of some 1944/5 DST transitions
in Czechoslovakia have been changed.
@@ -72,17 +203,17 @@ Release 2018d - 2018-03-22 07:05:46 -0700
Add support for vanguard and rearguard data consumers.
Add subsecond precision to source data format, though not to data.
- Changes to future time stamps
+ Changes to future timestamps
In 2018, Palestine starts DST on March 24, not March 31.
Adjust future predictions accordingly. (Thanks to Sharef Mustafa.)
- Changes to past and future time stamps
+ Changes to past and future timestamps
Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
at 04:00. (Thanks to Steffen Thorsen.)
- Changes to past time stamps
+ Changes to past timestamps
Historical transitions for Uruguay, represented by
America/Montevideo, have been updated per official legal documents,
@@ -224,7 +355,7 @@ Release 2018c - 2018-01-22 23:00:44 -0800
change is reapplied. (Problems reported by Deborah Goldsmith and
Stephen Colebourne.)
- Changes to past time stamps
+ Changes to past timestamps
Japanese DST transitions (1948-1951) were Sundays at 00:00, not
Saturdays or Sundays at 02:00. (Thanks to Takayuki Nikai.)
@@ -256,18 +387,18 @@ Release 2018a - 2018-01-12 22:29:21 -0800
Use Debian-style installation locations, instead of 4.3BSD-style.
New zic option -t.
- Changes to past and future time stamps
+ Changes to past and future timestamps
São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at
01:00. (Thanks to Steffen Thorsen and Michael Deckers.)
- Changes to future time stamps
+ Changes to future timestamps
Starting in 2018 southern Brazil will begin DST on November's
first Sunday instead of October's third Sunday. (Thanks to
Steffen Thorsen.)
- Changes to past time stamps
+ Changes to past timestamps
A discrepancy of 4 s in timestamps before 1931 in South Sudan has
been corrected. The 'backzone' and 'zone.tab' files did not agree
@@ -355,7 +486,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
A new file tzdata.zi now holds a small text copy of all data.
The zic input format has been regularized slightly.
- Changes to future time stamps
+ Changes to future timestamps
Northern Cyprus has decided to resume EU rules starting
2017-10-29, thus reinstituting winter time.
@@ -381,7 +512,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
2018-03-11 at 03:00. This affects UT offsets starting 2018-11-04
at 02:00. (Thanks to Steffen Thorsen.)
- Changes to past time stamps
+ Changes to past timestamps
Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03.
(Thanks to Arthur David Olson.)
@@ -511,11 +642,11 @@ Release 2017b - 2017-03-17 07:30:38 -0700
Briefly: Haiti has resumed DST.
- Changes to past and future time stamps
+ Changes to past and future timestamps
Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.)
- Changes to past time stamps
+ Changes to past timestamps
Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
@@ -527,7 +658,7 @@ Release 2017b - 2017-03-17 07:30:38 -0700
The reference localtime implementation now falls back on the
current US daylight-saving transition rules rather than the
1987-2006 rules. This fallback occurs only when (1) the TZ
- environment variable's value has a name like "AST4ADT" that asks
+ environment variable has a value like "AST4ADT" that asks
for daylight saving time but does not specify the rules, (2) there
is no file by that name, and (3) the TZDEFRULES file cannot be
loaded. (Thanks to Tom Lane.)
@@ -538,7 +669,7 @@ Release 2017a - 2017-02-28 00:05:36 -0800
Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
discontinues DST.
- Changes to future time stamps
+ Changes to future timestamps
Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.)
@@ -549,12 +680,12 @@ Release 2017a - 2017-02-28 00:05:36 -0800
assume it's permanent. (Thanks to Juan Correa and Deborah
Goldsmith.) This also affects Antarctica/Palmer.
- Changes to past time stamps
+ Changes to past timestamps
- Fix many entries for historical time stamps for Europe/Madrid
+ Fix many entries for historical timestamps for Europe/Madrid
before 1979, to agree with tables compiled by Pere Planesas of the
National Astronomical Observatory of Spain. As a side effect,
- this changes some time stamps for Africa/Ceuta before 1929, which
+ this changes some timestamps for Africa/Ceuta before 1929, which
are probably guesswork anyway. (Thanks to Steve Allen and
Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
correcting the 1901 transition.)
@@ -645,13 +776,13 @@ Release 2016j - 2016-11-22 23:17:13 -0800
Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04.
- Changes to future time stamps
+ Changes to future timestamps
Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00.
This hives off a new zone Europe/Saratov from Europe/Volgograd.
(Thanks to Yuri Konotopov and Stepan Golosunov.)
- Changes to past time stamps
+ Changes to past timestamps
The new zone Asia/Atyrau for Atyraū Region, Kazakhstan, is like
Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring
@@ -687,7 +818,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga
reintroduces DST on 2016-11-06.
- Changes to future time stamps
+ Changes to future timestamps
Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on
2017-01-15 at 03:00. Assume future observances in Tonga will be
@@ -695,7 +826,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
January, like Fiji. (Thanks to Pulu ʻAnau.) Switch to numeric
time zone abbreviations for this zone.
- Changes to past and future time stamps
+ Changes to past and future timestamps
Northern Cyprus is now +03 year round, causing a split in Cyprus
time zones starting 2016-10-30 at 04:00. This creates a zone
@@ -704,9 +835,9 @@ Release 2016i - 2016-11-01 23:19:52 -0700
Antarctica/Casey switched from +08 to +11 on 2016-10-22.
(Thanks to Steffen Thorsen.)
- Changes to past time stamps
+ Changes to past timestamps
- Several corrections were made for pre-1975 time stamps in Italy.
+ Several corrections were made for pre-1975 timestamps in Italy.
These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and
Europe/Vatican.
@@ -744,7 +875,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
Release 2016h - 2016-10-19 23:17:57 -0700
- Changes to future time stamps
+ Changes to future timestamps
Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not
2016-10-21 at 00:00. (Thanks to Sharef Mustafa.) Predict that
@@ -752,7 +883,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
at 01:00, which is consistent with predicted spring transitions
on the last Saturday of March. (Thanks to Tim Parenti.)
- Changes to past time stamps
+ Changes to past timestamps
In Turkey, transitions in 1986-1990 were at 01:00 standard time
not at 02:00, and the spring 1994 transition was on March 20, not
@@ -801,7 +932,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
Release 2016g - 2016-09-13 08:56:38 -0700
- Changes to future time stamps
+ Changes to future timestamps
Turkey switched from EET/EEST (+02/+03) to permanent +03,
effective 2016-09-07. (Thanks to Burak AYDIN.) Use "+03" rather
@@ -810,7 +941,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
New leap second 2016-12-31 23:59:60 UTC as per IERS Bulletin C 52.
(Thanks to Tim Parenti.)
- Changes to past time stamps
+ Changes to past timestamps
For America/Los_Angeles, spring-forward transition times have been
corrected from 02:00 to 02:01 in 1948, and from 02:00 to 01:00 in
@@ -859,9 +990,9 @@ Release 2016g - 2016-09-13 08:56:38 -0700
zic no longer generates binary files containing POSIX TZ-like
strings that disagree with the local time type after the last
explicit transition in the data. This fixes a bug with
- Africa/Casablanca and Africa/El_Aaiun in some year-2037 time
- stamps on the reference platform. (Thanks to Alexander Belopolsky
- for reporting the bug and suggesting a way forward.)
+ Africa/Casablanca and Africa/El_Aaiun in some year-2037 timestamps
+ on the reference platform. (Thanks to Alexander Belopolsky for
+ reporting the bug and suggesting a way forward.)
If the installed localtime and/or posixrules files are symbolic
links, zic now keeps them symbolic links when updating them, for
@@ -924,7 +1055,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
Release 2016f - 2016-07-05 16:26:51 +0200
- Changes affecting future time stamps
+ Changes affecting future timestamps
The Egyptian government changed its mind on short notice, and
Africa/Cairo will not introduce DST starting 2016-07-07 after all.
@@ -933,12 +1064,12 @@ Release 2016f - 2016-07-05 16:26:51 +0200
Asia/Novosibirsk switches from +06 to +07 on 2016-07-24 at 02:00.
(Thanks to Stepan Golosunov.)
- Changes to past and future time stamps
+ Changes to past and future timestamps
Asia/Novokuznetsk and Asia/Novosibirsk now use numeric time zone
abbreviations instead of invented ones.
- Changes affecting past time stamps
+ Changes affecting past timestamps
Europe/Minsk's 1992-03-29 spring-forward transition was at 02:00 not 00:00.
(Thanks to Stepan Golosunov.)
@@ -946,14 +1077,14 @@ Release 2016f - 2016-07-05 16:26:51 +0200
Release 2016e - 2016-06-14 08:46:16 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Africa/Cairo observes DST in 2016 from July 7 to the end of October.
Guess October 27 and 24:00 transitions. (Thanks to Steffen Thorsen.)
For future years, guess April's last Thursday to October's last
Thursday except for Ramadan.
- Changes affecting past time stamps
+ Changes affecting past timestamps
Locations while uninhabited now use '-00', not 'zzz', as a
placeholder time zone abbreviation. This is inspired by Internet
@@ -982,7 +1113,7 @@ Release 2016e - 2016-06-14 08:46:16 -0700
Release 2016d - 2016-04-17 22:50:29 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
America/Caracas switches from -0430 to -04 on 2016-05-01 at 02:30.
(Thanks to Alexander Krivenyshev for the heads-up.)
@@ -994,7 +1125,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
Tomsk Oblast, Russia, which switches from +06 to +07 on 2016-05-29
at 02:00. (Thanks to Stepan Golosunov.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
New zone Europe/Kirov, split off from Europe/Volgograd. It covers
Kirov Oblast, Russia, which switched from +04/+05 to +03/+04 on
@@ -1017,7 +1148,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
Release 2016c - 2016-03-23 00:51:27 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Azerbaijan no longer observes DST. (Thanks to Steffen Thorsen.)
@@ -1028,7 +1159,7 @@ Release 2016c - 2016-03-23 00:51:27 -0700
2014-09-07 through 2016-05-14 daylight saving time instead of
standard time, as that seems more appropriate now.
- Changes affecting past time stamps
+ Changes affecting past timestamps
Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
+02/+03 on 1989-03-26, not 1991-03-31. Europe/Volgograd changed
@@ -1053,7 +1184,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
POSIX.1-1988 that was removed in POSIX.1-2001. One way to suppress the
warnings is to upgrade to zic derived from tz releases 2015f and later.
- Changes affecting future time stamps
+ Changes affecting future timestamps
New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
@@ -1077,7 +1208,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
(Thanks to Hannah Kreitem.) Guess future transitions will be March's last
Saturday at 01:00, not March's last Friday at 24:00.
- Changes affecting past time stamps
+ Changes affecting past timestamps
Europe/Chisinau observed DST during 1990, and switched from +04 to
+03 at 1990-05-06 02:00, instead of switching from +03 to +02.
@@ -1112,7 +1243,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
Release 2016a - 2016-01-26 23:28:02 -0800
- Changes affecting future time stamps
+ Changes affecting future timestamps
America/Cayman will not observe daylight saving this year after all.
Revert our guess that it would. (Thanks to Matt Johnson.)
@@ -1124,7 +1255,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
to be March 21 00:00 to September 21 00:00. This is likely better
than predicting no DST, albeit off by a day every now and then.
- Changes affecting past and future time stamps
+ Changes affecting past and future timestamps
America/Metlakatla switched from PST all year to AKST/AKDT on
2015-11-01 at 02:00. (Thanks to Steffen Thorsen.)
@@ -1133,7 +1264,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
backward compatibility link to America/Tijuana. Its contents were
apparently based on a misreading of Mexican legislation.
- Changes affecting past time stamps
+ Changes affecting past timestamps
Asia/Karachi's two transition times in 2002 were off by a minute.
(Thanks to Matt Johnson.)
@@ -1167,7 +1298,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
Release 2015g - 2015-10-01 00:39:51 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.
(Thanks to Fatih.)
@@ -1182,7 +1313,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
New zone America/Fort_Nelson. (Thanks to Matt Johnson.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
Norfolk observed DST from 1974-10-27 02:00 to 1975-03-02 02:00.
@@ -1212,7 +1343,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
Release 2015f - 2015-08-10 18:06:56 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
North Korea switches to +0830 on 2015-08-15. (Thanks to Steffen Thorsen.)
The abbreviation remains "KST". (Thanks to Robert Elz.)
@@ -1220,7 +1351,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
Uruguay no longer observes DST. (Thanks to Steffen Thorsen
and Pablo Camargo.)
- Changes affecting past and future time stamps
+ Changes affecting past and future timestamps
Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC.
(Thanks to Roman Tudos.)
@@ -1279,7 +1410,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
Release 2015e - 2015-06-13 10:56:02 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
not 06-13 and 07-18 as we had guessed. (Thanks to Milamber.)
@@ -1307,13 +1438,13 @@ Release 2015e - 2015-06-13 10:56:02 -0700
Release 2015d - 2015-04-24 08:09:46 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Egypt will not observe DST in 2015 and will consider canceling it
permanently. For now, assume no DST indefinitely.
(Thanks to Ahmed Nazmy and Tim Parenti.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
America/Whitehorse switched from UT -09 to -08 on 1967-05-28, not
1966-07-01. Also, Yukon's time zone history is documented better.
@@ -1333,16 +1464,16 @@ Release 2015d - 2015-04-24 08:09:46 -0700
Release 2015c - 2015-04-11 08:55:55 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Egypt's spring-forward transition is at 24:00 on April's last Thursday,
not 00:00 on April's last Friday. 2015's transition will therefore be on
Thursday, April 30 at 24:00, not Friday, April 24 at 00:00. Similar fixes
apply to 2026, 2037, 2043, etc. (Thanks to Steffen Thorsen.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
- The following changes affect some pre-1991 Chile-related time stamps
+ The following changes affect some pre-1991 Chile-related timestamps
in America/Santiago, Antarctica/Palmer, and Pacific/Easter.
The 1910 transition was January 10, not January 1.
@@ -1367,8 +1498,8 @@ Release 2015c - 2015-04-11 08:55:55 -0700
since we have no data suggesting that they existed.
One more zone has been turned into a link, as it differed
- from an existing zone only for older time stamps. As usual,
- this change affects UT offsets in pre-1970 time stamps only.
+ from an existing zone only for older timestamps. As usual,
+ this change affects UT offsets in pre-1970 timestamps only.
The zone's old contents have been moved to the 'backzone' file.
The affected zone is America/Montreal.
@@ -1381,7 +1512,7 @@ Release 2015c - 2015-04-11 08:55:55 -0700
Release 2015b - 2015-03-19 23:28:11 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Mongolia will start observing DST again this year, from the last
Saturday in March at 02:00 to the last Saturday in September at 00:00.
@@ -1391,14 +1522,14 @@ Release 2015b - 2015-03-19 23:28:11 -0700
correct the fall 2014 transition from September 26 to October 24.
Adjust future predictions accordingly. (Thanks to Steffen Thorsen.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
regression. (Thanks to Stuart Bishop for reporting the problem.)
Some more zones have been turned into links, when they differed
- from existing zones only for older time stamps. As usual,
- these changes affect UT offsets in pre-1970 time stamps only.
+ from existing zones only for older timestamps. As usual,
+ these changes affect UT offsets in pre-1970 timestamps only.
Their old contents have been moved to the 'backzone' file.
The affected zones are: America/Antigua, America/Cayman,
Pacific/Midway, and Pacific/Saipan.
@@ -1429,7 +1560,7 @@ Release 2015b - 2015-03-19 23:28:11 -0700
Release 2015a - 2015-01-29 22:35:20 -0800
- Changes affecting future time stamps
+ Changes affecting future timestamps
The Mexican state of Quintana Roo, represented by America/Cancun,
will shift from Central Time with DST to Eastern Time without DST
@@ -1442,15 +1573,15 @@ Release 2015a - 2015-01-29 22:35:20 -0800
New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
(Thanks to Tim Parenti.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
Iceland observed DST in 1919 and 1921, and its 1939 fallback
transition was Oct. 29, not Nov. 29. Remove incorrect data from
Shanks about time in Iceland between 1837 and 1908.
Some more zones have been turned into links, when they differed
- from existing zones only for older time stamps. As usual,
- these changes affect UT offsets in pre-1970 time stamps only.
+ from existing zones only for older timestamps. As usual,
+ these changes affect UT offsets in pre-1970 timestamps only.
Their old contents have been moved to the 'backzone' file.
The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
and Asia/Muscat.
@@ -1481,23 +1612,23 @@ Release 2015a - 2015-01-29 22:35:20 -0800
Release 2014j - 2014-11-10 17:37:11 -0800
- Changes affecting current and future time stamps
+ Changes affecting current and future timestamps
Turks & Caicos' switch from US eastern time to UT -04 year-round
did not occur on 2014-11-02 at 02:00. It's currently scheduled
for 2015-11-01 at 02:00. (Thanks to Chris Walton.)
- Changes affecting past time stamps
+ Changes affecting past timestamps
- Many pre-1989 time stamps have been corrected for Asia/Seoul and
+ Many pre-1989 timestamps have been corrected for Asia/Seoul and
Asia/Pyongyang, based on sources for the Korean-language Wikipedia
entry for time in Korea. (Thanks to Sanghyuk Jung.) Also, no
longer guess that Pyongyang mimicked Seoul time after World War II,
as this is politically implausible.
Some more zones have been turned into links, when they differed
- from existing zones only for older time stamps. As usual,
- these changes affect UT offsets in pre-1970 time stamps only.
+ from existing zones only for older timestamps. As usual,
+ these changes affect UT offsets in pre-1970 timestamps only.
Their old contents have been moved to the 'backzone' file.
The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
@@ -1512,7 +1643,7 @@ Release 2014j - 2014-11-10 17:37:11 -0800
Release 2014i - 2014-10-21 22:04:57 -0700
- Changes affecting future time stamps
+ Changes affecting future timestamps
Pacific/Fiji will observe DST from 2014-11-02 02:00 to 2015-01-18 03:00.
(Thanks to Ken Rylander for the heads-up.) Guess that future
@@ -1532,17 +1663,17 @@ Release 2014i - 2014-10-21 22:04:57 -0700
The new abbreviation IDT stands for the pre-1976 use of UT +08 in
Indochina, to distinguish it better from ICT (+07).
- Changes affecting past time stamps
+ Changes affecting past timestamps
- Many time stamps have been corrected for Asia/Ho_Chi_Minh before 1976
+ Many timestamps have been corrected for Asia/Ho_Chi_Minh before 1976
(thanks to Trần Ngọc Quân for an indirect pointer to Trần Tiến Bình's
authoritative book). Asia/Ho_Chi_Minh has been added to
zone1970.tab, to give tzselect users in Vietnam two choices,
since north and south Vietnam disagreed after our 1970 cutoff.
Asia/Phnom_Penh and Asia/Vientiane have been turned into links, as
- they differed from existing zones only for older time stamps. As
- usual, these changes affect pre-1970 time stamps only. Their old
+ they differed from existing zones only for older timestamps. As
+ usual, these changes affect pre-1970 timestamps only. Their old
contents have been moved to the 'backzone' file.
Changes affecting code
@@ -1682,7 +1813,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
Unless NETBSD_INSPIRED is defined to 0, the tz library now
supplies functions for creating and using objects that represent
- time zones. The new functions are tzalloc, tzfree, localtime_rz,
+ timezones. The new functions are tzalloc, tzfree, localtime_rz,
mktime_z, and (if STD_INSPIRED is also defined) posix2time_z and
time2posix_z. They are intended for performance: for example,
localtime_rz (unlike localtime_r) is trivially thread-safe without
@@ -1696,7 +1827,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
TZDOBJS=zdump.o CHECK_TIME_T_ALTERNATIVES='.
zdump now uses localtime_rz if available, as it's significantly faster,
- and it can help zdump better diagnose invalid time zone names.
+ and it can help zdump better diagnose invalid timezone names.
Define HAVE_LOCALTIME_RZ to 0 to suppress this. HAVE_LOCALTIME_RZ
defaults to 1 if NETBSD_INSPIRED && USE_LTZ. When localtime_rz is
not available, zdump now uses localtime_r and tzset if available,
@@ -1712,7 +1843,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
invalid or outlandish input.
The tz library no longer mishandles leap seconds on platforms with
- unsigned time_t in time zones that lack ordinary transitions after 1970.
+ unsigned time_t in timezones that lack ordinary transitions after 1970.
The tz code now attempts to infer TM_GMTOFF and TM_ZONE if not
already defined, to make it easier to configure on common platforms.
@@ -2036,8 +2167,8 @@ Release 2014d - 2014-05-27 21:34:40 -0700
Changes affecting code
zic no longer generates files containing timestamps before the Big Bang.
- This works around GNOME bug 730332
- <https://bugzilla.gnome.org/show_bug.cgi?id=730332>.
+ This works around GNOME glib bug 878
+ <https://gitlab.gnome.org/GNOME/glib/issues/878>
(Thanks to Leonardo Chiquitto for reporting the bug, and to
Arthur David Olson and James Cloos for suggesting improvements to the fix.)
@@ -3490,7 +3621,7 @@ Release 2005j - 2005-06-13 14:34:13 -0400
These reflect changes to limit the length of time zone abbreviations
and the characters used in those abbreviations.
- There are also changes to handle POSIX-style "quoted" time zone
+ There are also changes to handle POSIX-style "quoted" timezone
environment variables.
The changes were circulated on the time zone mailing list; the only
@@ -3816,7 +3947,7 @@ Release 1999f - 1999-09-23 09:48:14 -0400
Release 1999e - 1999-08-17 15:20:54 -0400
changes circulated by Paul Eggert, although the change to handling
- of DST-specifying time zone names has been commented out for now
+ of DST-specifying timezone names has been commented out for now
(search for "XXX" in "localtime.c" for details). These files also
do not make any changes to the start of DST in Brazil.
@@ -3941,7 +4072,7 @@ Release code1997i-data1997k - 1997-12-29 09:53:41 -0500
Release code1997h-data1997j - 1997-12-18 17:47:35 -0500
- minor changes to put "TZif" at the start of each time zone information file
+ minor changes to put "TZif" at the start of each timezone information file
a rule has also been added to the Makefile so you can
make zones
@@ -4451,8 +4582,8 @@ consisting of a single tarball tzdb-R.tar.lz with extra data.
Release timestamps are taken from the release's commit (for newer,
Git-based releases), from the newest file in the tarball (for older
releases, where this info is available) or from the email announcing
-the release (if all else fails; these are marked with a time zone of
--0000 and an "is missing!" comment).
+the release (if all else fails; these are marked with a time zone
+abbreviation of -0000 and an "is missing!" comment).
Earlier versions of the code and data were not announced on the tz
list and are not summarized here.
diff --git a/lib/libc/time/README b/lib/libc/time/README
index ab8e47b63ef..efe7a17f21a 100644
--- a/lib/libc/time/README
+++ b/lib/libc/time/README
@@ -4,7 +4,7 @@ README for the tz distribution
"Any time you want it to be." -- Frank Baxter as The Scientist
(from the Bell System film "About Time")
-The Time Zone Database (often called tz or zoneinfo) contains code and
+The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
data that represent the history of local time for many representative
locations around the globe. It is updated periodically to reflect
changes made by political bodies to time zone boundaries, UTC offsets,
@@ -20,17 +20,15 @@ substituting your desired installation directory for "$HOME/tzdir":
make TOPDIR=$HOME/tzdir install
$HOME/tzdir/usr/bin/zdump -v America/Los_Angeles
-Historical local time information has been included here to:
+This database of historical local time information has several goals:
-* provide a compendium of data about the history of civil time
- that is useful even if not 100% accurate;
+ * Provide a compendium of data about the history of civil time that
+ is useful even if not 100% accurate.
-* give an idea of the variety of local time rules that have
- existed in the past and thus an idea of the variety that may be
- expected in the future;
+ * Give an idea of the variety of local time rules that have existed
+ in the past and thus may be expected in the future.
-* provide a test of the generality of the local time rule description
- system.
+ * Test the generality of the local time rule description system.
The information in the time zone data files is by no means authoritative;
fixes and enhancements are welcome. Please see the file CONTRIBUTING
diff --git a/lib/libc/time/ctime.3 b/lib/libc/time/ctime.3
index c2b86327698..7f586d7cc5c 100644
--- a/lib/libc/time/ctime.3
+++ b/lib/libc/time/ctime.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: ctime.3,v 1.59 2018/05/04 15:51:00 christos Exp $
+.\" $NetBSD: ctime.3,v 1.60 2018/10/19 23:05:35 christos Exp $
.\"
.\" XXX: License missing?
.\"
@@ -158,7 +158,7 @@ functions
are like their unsuffixed counterparts, except that they accept an
extra initial
.Ar zone
-argument specifying the time zone to be used for conversion.
+argument specifying the timezone to be used for conversion.
If
.Fa zone
is
@@ -196,7 +196,7 @@ is comparable to
.Fn gmtime .
However,
.Fn localtime
-corrects for the time zone and any time zone adjustments
+corrects for the timezone and any timezone adjustments
(such as Daylight Saving Time in the U.S.A.).
After filling in the
.Va tm
@@ -205,7 +205,7 @@ structure, the function sets the
element of
.Fa tzname
to a pointer to an
-ASCII string that is the time zone abbreviation to be used with
+ASCII string that is the timezone abbreviation to be used with
.Fn localtime Ns 's
return value.
.It Fn localtime_r "clock" "result"
@@ -441,11 +441,11 @@ function returns string containing the name of the timezone given in
.Sh FILES
.Bl -tag -width /usr/share/zoneinfo/posixrules -compact
.It Pa /etc/localtime
-local time zone file
+local timezone file
.It Pa /usr/share/zoneinfo
-time zone information directory
-.\" .It Pa usr/share/zoneinfo/localtime
-.\" local time zone file
+timezone information directory
+.It Pa usr/share/zoneinfo/localtime
+local timezone file
.It Pa /usr/share/zoneinfo/posixrules
used with POSIX-style TZ's
.It Pa /usr/share/zoneinfo/GMT
@@ -511,7 +511,7 @@ can be freed or overwritten by later calls to the functions
.Fn tzfree ,
and
.Fn tzset ,
-if these functions affect the time zone information that specifies the
+if these functions affect the timezone information that specifies the
abbreviation in question.
The remaining functions and data are thread-safe.
The functions that do take an explicit
diff --git a/lib/libc/time/difftime.c b/lib/libc/time/difftime.c
index edfe30e087c..65315775cf1 100644
--- a/lib/libc/time/difftime.c
+++ b/lib/libc/time/difftime.c
@@ -1,4 +1,6 @@
-/* $NetBSD: difftime.c,v 1.18 2017/10/24 17:38:17 christos Exp $ */
+/* $NetBSD: difftime.c,v 1.19 2018/10/19 23:05:35 christos Exp $ */
+
+/* Return the difference between two timestamps. */
/*
** This file is in the public domain, so clarified as of
@@ -10,7 +12,7 @@
#if 0
static char elsieid[] = "@(#)difftime.c 8.1";
#else
-__RCSID("$NetBSD: difftime.c,v 1.18 2017/10/24 17:38:17 christos Exp $");
+__RCSID("$NetBSD: difftime.c,v 1.19 2018/10/19 23:05:35 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 095c439b629..f0946f7094c 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -1,4 +1,6 @@
-/* $NetBSD: localtime.c,v 1.112 2018/05/04 15:51:00 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.113 2018/10/19 23:05:35 christos Exp $ */
+
+/* Convert timestamp from time_t to struct tm. */
/*
** This file is in the public domain, so clarified as of
@@ -10,7 +12,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 8.17";
#else
-__RCSID("$NetBSD: localtime.c,v 1.112 2018/05/04 15:51:00 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.113 2018/10/19 23:05:35 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -139,7 +141,11 @@ struct state {
char chars[/*CONSTCOND*/BIGGEST(BIGGEST(TZ_MAX_CHARS + 1,
sizeof gmt), (2 * (MY_TZNAME_MAX + 1)))];
struct lsinfo lsis[TZ_MAX_LEAPS];
- int defaulttype; /* for early times or if no transitions */
+
+ /* The time type to use for early times or if no transitions.
+ It is always zero for recent tzdb releases.
+ It might be nonzero for data from tzdb 2018e or earlier. */
+ int defaulttype;
};
enum r_type {
@@ -371,7 +377,7 @@ settzname(void)
return;
}
/*
- ** And to get the latest zone names into tzname. . .
+ ** And to get the latest time zone abbreviations into tzname. . .
*/
for (i = 0; i < sp->typecnt; ++i)
update_tzname_etc(sp, &sp->ttis[i]);
@@ -494,8 +500,11 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
int_fast32_t typecnt = detzcode(up->tzhead.tzh_typecnt);
int_fast32_t charcnt = detzcode(up->tzhead.tzh_charcnt);
char const *p = up->buf + tzheadsize;
+ /* Although tzfile(5) currently requires typecnt to be nonzero,
+ support future formats that may allow zero typecnt
+ in files that have a TZ string and no transitions. */
if (! (0 <= leapcnt && leapcnt < TZ_MAX_LEAPS
- && 0 < typecnt && typecnt < TZ_MAX_TYPES
+ && 0 <= typecnt && typecnt < TZ_MAX_TYPES
&& 0 <= timecnt && timecnt < TZ_MAX_TIMES
&& 0 <= charcnt && charcnt < TZ_MAX_CHARS
&& (ttisstdcnt == typecnt || ttisstdcnt == 0)
@@ -636,8 +645,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
struct state *ts = &lsp->u.st;
up->buf[nread - 1] = '\0';
- if (tzparse(&up->buf[1], ts, false)
- && ts->typecnt == 2) {
+ if (tzparse(&up->buf[1], ts, false)) {
/* Attempt to reuse existing abbreviations.
Without this, America/Anchorage would be right on
@@ -648,7 +656,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
stay 40 in this example. */
int gotabbr = 0;
int charcnt = sp->charcnt;
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < ts->typecnt; i++) {
char *tsabbr = ts->chars + ts->ttis[i].tt_abbrind;
int j;
for (j = 0; j < charcnt; j++)
@@ -667,7 +675,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
}
}
}
- if (gotabbr == 2) {
+ if (gotabbr == ts->typecnt) {
sp->charcnt = charcnt;
/* Ignore any trailing, no-op transitions generated
@@ -679,7 +687,8 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
sp->timecnt--;
for (i = 0; i < ts->timecnt; i++)
- if (sp->ats[sp->timecnt - 1] < ts->ats[i])
+ if (sp->timecnt == 0
+ || sp->ats[sp->timecnt - 1] < ts->ats[i])
break;
while (i < ts->timecnt
&& sp->timecnt < TZ_MAX_TIMES) {
@@ -689,11 +698,13 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
sp->timecnt++;
i++;
}
- sp->ttis[sp->typecnt++] = ts->ttis[0];
- sp->ttis[sp->typecnt++] = ts->ttis[1];
+ for (i = 0; i < ts->typecnt; i++)
+ sp->ttis[sp->typecnt++] = ts->ttis[i];
}
}
}
+ if (sp->typecnt == 0)
+ return EINVAL;
if (sp->timecnt > 1) {
for (i = 1; i < sp->timecnt; ++i)
if (typesequiv(sp, sp->types[i], sp->types[0]) &&
@@ -710,6 +721,17 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
break;
}
}
+
+ /* Infer sp->defaulttype from the data. Although this default
+ type is always zero for data from recent tzdb releases,
+ things are trickier for data from tzdb 2018e or earlier.
+
+ The first set of heuristics work around bugs in 32-bit data
+ generated by tzdb 2013c or earlier. The workaround is for
+ zones like Australia/Macquarie where timestamps before the
+ first transition have a time type that is not the earliest
+ standard-time type. See:
+ https://mm.icann.org/pipermail/tz/2013-May/019368.html */
/*
** If type 0 is unused in transitions,
** it's the type to use for early times.
@@ -731,6 +753,9 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
if (!sp->ttis[i].tt_isdst)
break;
}
+ /* The next heuristics are for data generated by tzdb 2018e or
+ earlier, for zones like EST5EDT where the first transition
+ is to DST. */
/*
** If no result yet, find the first standard type.
** If there is none, punt to type zero.
@@ -743,7 +768,12 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
break;
}
}
+ /* A simple 'sp->defaulttype = 0;' would suffice here if we
+ didn't have to worry about 2018e-or-earlier data. Even
+ simpler would be to remove the defaulttype member and just
+ use 0 in its place. */
sp->defaulttype = i;
+
return 0;
}
@@ -794,9 +824,9 @@ static const int year_lengths[2] = {
};
/*
-** Given a pointer into a time zone string, scan until a character that is not
-** a valid character in a zone name is found. Return a pointer to that
-** character.
+** Given a pointer into a timezone string, scan until a character that is not
+** a valid character in a time zone abbreviation is found.
+** Return a pointer to that character.
*/
static const char *
@@ -811,8 +841,9 @@ getzname(const char *strp)
}
/*
-** Given a pointer into an extended time zone string, scan until the ending
-** delimiter of the zone name is located. Return a pointer to the delimiter.
+** Given a pointer into an extended timezone string, scan until the ending
+** delimiter of the time zone abbreviation is located.
+** Return a pointer to the delimiter.
**
** As with getzname above, the legal character set is actually quite
** restricted, with other characters producing undefined results.
@@ -830,7 +861,7 @@ getqzname(const char *strp, const int delim)
}
/*
-** Given a pointer into a time zone string, extract a number from that string.
+** Given a pointer into a timezone string, extract a number from that string.
** Check that the number is within a specified range; if it is not, return
** NULL.
** Otherwise, return a pointer to the first character not part of the number.
@@ -864,7 +895,7 @@ getnum(const char *strp, int *const nump, const int min, const int max)
}
/*
-** Given a pointer into a time zone string, extract a number of seconds,
+** Given a pointer into a timezone string, extract a number of seconds,
** in hh[:mm[:ss]] form, from the string.
** If any error occurs, return NULL.
** Otherwise, return a pointer to the first character not part of the number
@@ -905,7 +936,7 @@ getsecs(const char *strp, int_fast32_t *const secsp)
}
/*
-** Given a pointer into a time zone string, extract an offset, in
+** Given a pointer into a timezone string, extract an offset, in
** [+-]hh[:mm[:ss]] form, from the string.
** If any error occurs, return NULL.
** Otherwise, return a pointer to the first character not part of the time.
@@ -930,7 +961,7 @@ getoffset(const char *strp, int_fast32_t *const offsetp)
}
/*
-** Given a pointer into a time zone string, extract a rule in the form
+** Given a pointer into a timezone string, extract a rule in the form
** date[/time]. See POSIX section 8 for the format of "date" and "time".
** If a valid rule is not found, return NULL.
** Otherwise, return a pointer to the first character not part of the rule.
@@ -1133,7 +1164,7 @@ tzparse(const char *name, struct state *sp, bool lastditch)
} else {
dstname = name;
name = getzname(name);
- dstlen = name - dstname; /* length of DST zone name */
+ dstlen = name - dstname; /* length of DST abbr. */
}
if (!dstlen)
return false;
@@ -1170,9 +1201,9 @@ tzparse(const char *name, struct state *sp, bool lastditch)
/*
** Two transitions per year, from EPOCH_YEAR forward.
*/
- init_ttinfo(&sp->ttis[0], -dstoffset, true,
+ init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
+ init_ttinfo(&sp->ttis[1], -dstoffset, true,
(int)(stdlen + 1));
- init_ttinfo(&sp->ttis[1], -stdoffset, false, 0);
sp->defaulttype = 0;
timecnt = 0;
janfirst = 0;
@@ -1213,17 +1244,14 @@ tzparse(const char *name, struct state *sp, bool lastditch)
if (! increment_overflow_time
(&sp->ats[timecnt],
janoffset + starttime))
- sp->types[timecnt++] = reversed;
- else if (janoffset)
- sp->defaulttype = reversed;
+ sp->types[timecnt++] = !reversed;
sp->ats[timecnt] = janfirst;
if (! increment_overflow_time
(&sp->ats[timecnt],
janoffset + endtime)) {
- sp->types[timecnt++] = !reversed;
+ sp->types[timecnt++] = reversed;
yearlim = year + YEARSPERREPEAT + 1;
- } else if (janoffset)
- sp->defaulttype = !reversed;
+ }
}
if (increment_overflow_time
(&janfirst, janoffset + yearsecs))
@@ -1231,9 +1259,10 @@ tzparse(const char *name, struct state *sp, bool lastditch)
janoffset = 0;
}
sp->timecnt = timecnt;
- if (! timecnt)
+ if (! timecnt) {
+ sp->ttis[0] = sp->ttis[1];
sp->typecnt = 1; /* Perpetual DST. */
- else if (YEARSPERREPEAT < year - yearbeg)
+ } else if (YEARSPERREPEAT < year - yearbeg)
sp->goback = sp->goahead = true;
} else {
int_fast32_t theirstdoffset;
@@ -1474,7 +1503,7 @@ tzfree(timezone_t sp)
**
** If successful and SETNAME is nonzero,
** set the applicable parts of tzname, timezone and altzone;
-** however, it's OK to omit this step if the time zone is POSIX-compatible,
+** however, it's OK to omit this step if the timezone is POSIX-compatible,
** since in that case tzset should have already done this step correctly.
** SETNAME's type is intfast32_t for compatibility with gmtsub,
** but it is actually a boolean and its value should be 0 or 1.
diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h
index 4eb9a7c43cd..b91b2569121 100644
--- a/lib/libc/time/private.h
+++ b/lib/libc/time/private.h
@@ -1,4 +1,6 @@
-/* $NetBSD: private.h,v 1.52 2018/05/04 15:51:00 christos Exp $ */
+/* Private header for tzdb code. */
+
+/* $NetBSD: private.h,v 1.53 2018/10/19 23:05:35 christos Exp $ */
#ifndef PRIVATE_H
#define PRIVATE_H
diff --git a/lib/libc/time/strftime.3 b/lib/libc/time/strftime.3
index d31f1f367d1..7e966be9c66 100644
--- a/lib/libc/time/strftime.3
+++ b/lib/libc/time/strftime.3
@@ -30,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)strftime.3 5.12 (Berkeley) 6/29/91
-.\" $NetBSD: strftime.3,v 1.33 2017/03/11 18:23:14 christos Exp $
+.\" $NetBSD: strftime.3,v 1.34 2018/10/19 23:05:35 christos Exp $
.\"
-.Dd March 11, 2017
+.Dd October 19, 2018
.Dt STRFTIME 3
.Os
.Sh NAME
@@ -188,13 +188,15 @@ is replaced by the year with century as a decimal number.
.It Cm \&%y
is replaced by the year without century as a decimal number [00,99].
.It Cm \&%Z
-is replaced by the time zone name.
+is replaced by the time zone abbreviation,
+or the empty string if this is not determinable.
.It Cm \&%z
is replaced by the offset from the Prime Meridian in the format
+HHMM or -HHMM (ISO 8601) as appropriate, with positive values representing
locations east of Greenwich, or by the empty string if this is
not determinable.
-The numeric time zone [-]0000 is used when the time is Universal Time
+The numeric time zone abbreviation \&-0000 is used when the time is
+Universal Time
but local time is indeterminate; by convention this is used for
locations while uninhabited, and corresponds to a zero offset when the
time zone abbreviation begins with
diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c
index 95e3460f16e..4fd8e81e94e 100644
--- a/lib/libc/time/strftime.c
+++ b/lib/libc/time/strftime.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strftime.c,v 1.41 2018/05/04 15:51:00 christos Exp $ */
+/* $NetBSD: strftime.c,v 1.42 2018/10/19 23:05:35 christos Exp $ */
/* Convert a broken-down timestamp to a string. */
@@ -35,7 +35,7 @@
static char elsieid[] = "@(#)strftime.c 7.64";
static char elsieid[] = "@(#)strftime.c 8.3";
#else
-__RCSID("$NetBSD: strftime.c,v 1.41 2018/05/04 15:51:00 christos Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.42 2018/10/19 23:05:35 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -486,7 +486,8 @@ label:
/*
** C99 and later say that %Z must be
** replaced by the empty string if the
- ** time zone is not determinable.
+ ** time zone abbreviation is not
+ ** determinable.
*/
continue;
case 'z':
diff --git a/lib/libc/time/theory.html b/lib/libc/time/theory.html
index fc2102b3e3c..8dd58dbba63 100644
--- a/lib/libc/time/theory.html
+++ b/lib/libc/time/theory.html
@@ -1,7 +1,11 @@
+<!DOCTYPE html>
<html lang="en">
<head>
<title>Theory and pragmatics of the tz code and data</title>
<meta charset="UTF-8">
+ <style>
+ pre {margin-left: 2em; white-space: pre-wrap;}
+ </style>
</head>
<body>
@@ -11,7 +15,7 @@
<ul>
<li><a href="#scope">Scope of the <code><abbr>tz</abbr></code>
database</a></li>
- <li><a href="#naming">Names of time zone rulesets</a></li>
+ <li><a href="#naming">Names of timezones</a></li>
<li><a href="#abbreviations">Time zone abbreviations</a></li>
<li><a href="#accuracy">Accuracy of the <code><abbr>tz</abbr></code>
database</a></li>
@@ -31,13 +35,13 @@ database</a> attempts to record the history and predicted future of
all computer-based clocks that track civil time.
It organizes <a href="tz-link.html">time zone and daylight saving time
data</a> by partitioning the world into <a
-href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">regions</a>
+href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"><dfn>timezones</dfn></a>
whose clocks all agree about timestamps that occur after the <a
href="https://en.wikipedia.org/wiki/Unix_time">POSIX Epoch</a>
(1970-01-01 00:00:00 <a
href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time"><abbr
title="Coordinated Universal Time">UTC</abbr></a>).
-The database labels each such region with a notable location and
+The database labels each timezone with a notable location and
records all known clock transitions for that location.
Although 1970 is a somewhat-arbitrary cutoff, there are significant
challenges to moving the cutoff earlier even by a decade or two, due
@@ -46,7 +50,24 @@ became prevalent.
</p>
<p>
-Clock transitions before 1970 are recorded for each such location,
+Each timezone typically corresponds to a geographical region that is
+smaller than a traditional time zone, because clocks in a timezone
+all agree after 1970 whereas a traditional time zone merely
+specifies current standard time. For example, applications that deal
+with current and future timestamps in the traditional North
+American mountain time zone can choose from the timezones
+<code>America/Denver</code> which observes US-style daylight saving
+time, <code>America/Mazatlan</code> which observes Mexican-style DST,
+and <code>America/Phoenix</code> which does not observe DST.
+Applications that also deal with past timestamps in the mountain time
+zone can choose from over a dozen timezones, such as
+<code>America/Boise</code>, <code>America/Edmonton</code>, and
+<code>America/Hermosillo</code>, each of which currently uses mountain
+time but differs from other timezones for some timestamps after 1970.
+</p>
+
+<p>
+Clock transitions before 1970 are recorded for each timezone,
because most systems support timestamps before 1970 and could
misbehave if data entries were omitted for pre-1970 transitions.
However, the database is not designed for and does not suffice for
@@ -73,30 +94,36 @@ Edition.
Because the database's scope encompasses real-world changes to civil
timekeeping, its model for describing time is more complex than the
standard and daylight saving times supported by POSIX.
-A <code><abbr>tz</abbr></code> region corresponds to a ruleset that can
+A <code><abbr>tz</abbr></code> timezone corresponds to a ruleset that can
have more than two changes per year, these changes need not merely
flip back and forth between two alternatives, and the rules themselves
can change at times.
-Whether and when a <code><abbr>tz</abbr></code> region changes its
-clock, and even the region's notional base offset from UTC, are variable.
-It does not always make sense to talk about a region's
-"base offset", since it is not necessarily a single number.
+Whether and when a timezone changes its
+clock, and even the timezone's notional base offset from UTC, are variable.
+It does not always make sense to talk about a timezone's
+"base offset", which is not necessarily a single number.
</p>
</section>
<section>
- <h2 id="naming">Names of time zone rulesets</h2>
+ <h2 id="naming">Names of timezones</h2>
<p>
-Each <code><abbr>tz</abbr></code> region has a unique name that
-corresponds to a set of time zone rules.
+Each timezone has a unique name.
Inexperienced users are not expected to select these names unaided.
Distributors should provide documentation and/or a simple selection
-interface that explains the names; for one example, see the
+interface that explains each name via a map or via descriptive text like
+"Ruthenia" instead of the timezone name "<code>Europe/Uzhgorod</code>".
+If geolocation information is available, a selection interface can
+locate the user on a timezone map or prioritize names that are
+geographically close. For an example selection interface, see the
<code>tzselect</code> program in the <code><abbr>tz</abbr></code> code.
The <a href="http://cldr.unicode.org/">Unicode Common Locale Data
Repository</a> contains data that may be useful for other selection
-interfaces.
+interfaces; it maps timezone names like <code>Europe/Uzhgorod</code>
+to CLDR names like <code>uauzh</code> which are in turn mapped to
+locale-dependent strings like "Uzhhorod", "Ungvár", "Ужгород", and
+"乌日哥罗德".
</p>
<p>
@@ -106,12 +133,12 @@ among the following goals:
<ul>
<li>
- Uniquely identify every region where clocks have agreed since 1970.
+ Uniquely identify every timezone where clocks have agreed since 1970.
This is essential for the intended use: static clocks keeping local
civil time.
</li>
<li>
- Indicate to experts where that region is.
+ Indicate to experts where the timezone's clocks typically are.
</li>
<li>
Be robust in the presence of political changes.
@@ -131,9 +158,8 @@ among the following goals:
<p>
Names normally have the form
<var>AREA</var><code>/</code><var>LOCATION</var>, where
-<var>AREA</var> is the name of a continent or ocean, and
-<var>LOCATION</var> is the name of a specific location within that
-region.
+<var>AREA</var> is a continent or ocean, and
+<var>LOCATION</var> is a specific location within the area.
North and South America share the same area, '<code>America</code>'.
Typical names are '<code>Africa/Cairo</code>',
'<code>America/New_York</code>', and '<code>Pacific/Honolulu</code>'.
@@ -144,7 +170,7 @@ Indiana from other Petersburgs in America.
<p>
Here are the general guidelines used for
-choosing <code><abbr>tz</abbr></code> region names,
+choosing timezone names,
in decreasing order of importance:
</p>
@@ -196,9 +222,9 @@ in decreasing order of importance:
country or territory.
</li>
<li>
- If all the clocks in a region have agreed since 1970,
- do not bother to include more than one location
- even if subregions' clocks disagreed before 1970.
+ If all the clocks in a timezone have agreed since 1970,
+ do not bother to include more than one timezone
+ even if some of the clocks disagreed before 1970.
Otherwise these tables would become annoyingly large.
</li>
<li>
@@ -212,7 +238,7 @@ in decreasing order of importance:
Keep locations compact.
Use cities or small islands, not countries or regions, so that any
future changes do not split individual locations into different
- <code><abbr>tz</abbr></code> regions.
+ timezones.
E.g., prefer <code>Europe/Paris</code> to <code>Europe/France</code>,
since
<a href="https://en.wikipedia.org/wiki/Time_in_France#History">France
@@ -220,10 +246,10 @@ in decreasing order of importance:
</li>
<li>
Use mainstream English spelling, e.g., prefer
- <code>Europe/Rome</code> to <code>Europe/Roma</code>, and
+ <code>Europe/Rome</code> to <code>Europa/Roma</code>, and
prefer <code>Europe/Athens</code> to the Greek
- <code>Europe/Αθήνα</code> or the Romanized
- <code>Europe/Athína</code>.
+ <code>Ευρώπη/Αθήνα</code> or the Romanized
+ <code>Evrópi/Athína</code>.
The POSIX file name restrictions encourage this guideline.
</li>
<li>
@@ -274,9 +300,9 @@ in decreasing order of importance:
<p>
The file '<code>zone1970.tab</code>' lists geographical locations used
-to name <code><abbr>tz</abbr></code> regions.
+to name timezones.
It is intended to be an exhaustive list of names for geographic
-regions as described above; this is a subset of the names in the data.
+regions as described above; this is a subset of the timezones in the data.
Although a '<code>zone1970.tab</code>' location's
<a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
corresponds to
@@ -398,6 +424,7 @@ in decreasing order of importance:
NZST/NZDT New Zealand 1946&ndash;present,
PKT/PKST Pakistan,
PST/PDT/PWT/PPT/PDDT Pacific,
+ PST/PDT Philippine,
SAST South Africa,
SST Samoa,
WAT/WAST West Africa,
@@ -453,7 +480,7 @@ in decreasing order of importance:
<p>
<small>A few abbreviations also follow the pattern that
- <abbr>GMT<abbr>/<abbr>BST</abbr> established for time in the UK.
+ <abbr>GMT</abbr>/<abbr>BST</abbr> established for time in the UK.
They are:
CMT/BST for Calamarca Mean Time and Bolivian Summer Time
1890&ndash;1932,
@@ -473,7 +500,7 @@ in decreasing order of importance:
</li>
<li>
If there is no common English abbreviation, use numeric offsets like
- <code>-</code>05 and <code>+</code>0830 that are generated
+ <code>-</code>05 and <code>+</code>0530 that are generated
by <code>zic</code>'s <code>%z</code> notation.
</li>
<li>
@@ -488,8 +515,8 @@ in decreasing order of importance:
usage.
</li>
<li>
- Use a consistent style in a <code><abbr>tz</abbr></code> region's history.
- For example, if history tends to use numeric
+ Use a consistent style in a timezone's history.
+ For example, if a history tends to use numeric
abbreviations and a particular entry could go either way, use a
numeric abbreviation.
</li>
@@ -501,7 +528,7 @@ in decreasing order of importance:
The leading '<code>-</code>' is a flag that the <abbr>UT</abbr> offset is in
some sense undefined; this notation is derived
from <a href="https://tools.ietf.org/html/rfc3339">Internet
- <abbr title="Request For Comments">RFC 3339</a>.
+ <abbr title="Request For Comments">RFC</abbr> 3339</a>.
</li>
</ul>
@@ -543,7 +570,7 @@ Errors in the <code><abbr>tz</abbr></code> database arise from many sources:
The pre-1970 entries in this database cover only a tiny sliver of how
clocks actually behaved; the vast majority of the necessary
information was lost or never recorded.
- Thousands more <code><abbr>tz</abbr></code> regions would be needed if
+ Thousands more timezones would be needed if
the <code><abbr>tz</abbr></code> database's scope were extended to
cover even just the known or guessed history of standard time; for
example, the current single entry for France would need to split
@@ -608,19 +635,19 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
</li>
<li>
The <code><abbr>tz</abbr></code> database does not record the
- earliest time for which a <code><abbr>tz</abbr></code> region's
+ earliest time for which a timezone's
data entries are thereafter valid for every location in the region.
For example, <code>Europe/London</code> is valid for all locations
in its region after <abbr>GMT</abbr> was made the standard time,
but the date of standardization (1880-08-02) is not in the
<code><abbr>tz</abbr></code> database, other than in commentary.
- For many <code><abbr>tz</abbr></code> regions the earliest time of
+ For many timezones the earliest time of
validity is unknown.
</li>
<li>
The <code><abbr>tz</abbr></code> database does not record a
region's boundaries, and in many cases the boundaries are not known.
- For example, the <code><abbr>tz</abbr></code> region
+ For example, the timezone
<code>America/Kentucky/Louisville</code> represents a region
around the city of Louisville, the boundaries of which are
unclear.
@@ -664,19 +691,39 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
way to specify Easter, these exceptional years are entered as
separate <code><abbr>tz</abbr> Rule</code> lines, even though the
legal rules did not change.
+ When transitions are known but the historical rules behind them are not,
+ the database contains <code>Zone</code> and <code>Rule</code>
+ entries that are intended to represent only the generated
+ transitions, not any underlying historical rules; however, this
+ intent is recorded at best only in commentary.
</li>
<li>
- The <code><abbr>tz</abbr></code> database models pre-standard time
+ The <code><abbr>tz</abbr></code> database models time
using the <a
href="https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar">proleptic
- Gregorian calendar</a> and local mean time, but many people used
- other calendars and other timescales.
+ Gregorian calendar</a> with days containing 24 equal-length hours
+ numbered 00 through 23, except when clock transitions occur.
+ Pre-standard time is modeled as local mean time.
+ However, historically many people used other calendars and other timescales.
For example, the Roman Empire used
the <a href="https://en.wikipedia.org/wiki/Julian_calendar">Julian
calendar</a>,
and <a href="https://en.wikipedia.org/wiki/Roman_timekeeping">Roman
timekeeping</a> had twelve varying-length daytime hours with a
non-hour-based system at night.
+ And even today, some local practices diverge from the Gregorian
+ calendar with 24-hour days. These divergences range from
+ relatively minor, such as Japanese bars giving times like "24:30" for the
+ wee hours of the morning, to more-significant differences such as <a
+ href="https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time">the
+ east African practice of starting the day at dawn</a>, renumbering
+ the Western 06:00 to be 12:00. These practices are largely outside
+ the scope of the <code><abbr>tz</abbr></code> code and data, which
+ provide only limited support for date and time localization
+ such as that required by POSIX. If DST is not used a different time zone
+ can often do the trick; for example, in Kenya a <code>TZ</code> setting
+ like <code>&lt;-03&gt;3</code> or <code>America/Cayenne</code> starts
+ the day six hours later than <code>Africa/Nairobi</code> does.
</li>
<li>
Early clocks were less reliable, and data entries do not represent
@@ -710,7 +757,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
historical <a href="https://en.wikipedia.org/wiki/Solar_time">solar time</a>
to more than about one-hour accuracy.
See: Stephenson FR, Morrison LV, Hohenkerk CY.
- <a href="http://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
+ <a href="https://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
the Earth's rotation: 720 BC to AD 2015</a>.
<cite>Proc Royal Soc A</cite>. 2016 Dec 7;472:20160404.
Also see: Espenak F. <a
@@ -746,7 +793,7 @@ Any attempt to pass the
should be unacceptable to anybody who cares about the facts.
In particular, the <code><abbr>tz</abbr></code> database's
<abbr>LMT</abbr> offsets should not be considered meaningful, and
-should not prompt creation of <code><abbr>tz</abbr></code> regions
+should not prompt creation of timezones
merely because two locations
differ in <abbr>LMT</abbr> or transitioned to standard time at
different dates.
@@ -798,7 +845,7 @@ an older <code>zic</code>.
<dl>
<dt><var>std</var> and <var>dst</var></dt><dd>
are 3 or more characters specifying the standard
- and daylight saving time (<abbr>DST</abbr>) zone names.
+ and daylight saving time (<abbr>DST</abbr>) zone abbreviations.
Starting with POSIX.1-2001, <var>std</var> and <var>dst</var>
may also be in a quoted form like '<code>&lt;+09&gt;</code>';
this allows "<code>+</code>" and "<code>-</code>" in the names.
@@ -870,38 +917,38 @@ an older <code>zic</code>.
<pre><code>TZ='Pacific/Auckland'</code></pre>
</li>
<li>
- POSIX does not define the exact meaning of <code>TZ</code> values like
+ POSIX does not define the <abbr>DST</abbr> transitions
+ for <code>TZ</code> values like
"<code>EST5EDT</code>".
- Typically the current <abbr>US</abbr> <abbr>DST</abbr> rules
- are used to interpret such values, but this means that the
- <abbr>US</abbr> <abbr>DST</abbr> rules are compiled into each
- program that does time conversion.
- This means that when
- <abbr>US</abbr> time conversion rules change (as in the United
- States in 1987), all programs that do time conversion must be
+ Traditionally the current <abbr>US</abbr> <abbr>DST</abbr> rules
+ were used to interpret such values, but this meant that the
+ <abbr>US</abbr> <abbr>DST</abbr> rules were compiled into each
+ program that did time conversion. This meant that when
+ <abbr>US</abbr> time conversion rules changed (as in the United
+ States in 1987), all programs that did time conversion had to be
recompiled to ensure proper results.
</li>
<li>
The <code>TZ</code> environment variable is process-global, which
makes it hard to write efficient, thread-safe applications that
- need access to multiple time zone rulesets.
+ need access to multiple timezones.
</li>
<li>
In POSIX, there is no tamper-proof way for a process to learn the
system's best idea of local wall clock.
- (This is important for applications that an administrator wants
+ This is important for applications that an administrator wants
used only at certain times &ndash; without regard to whether the
user has fiddled the
<code>TZ</code> environment variable.
While an administrator can "do everything in <abbr>UT</abbr>" to
get around the problem, doing so is inconvenient and precludes
- handling daylight saving time shifts - as might be required to
- limit phone calls to off-peak hours.)
+ handling daylight saving time shifts &ndash; as might be required to
+ limit phone calls to off-peak hours.
</li>
<li>
POSIX provides no convenient and efficient way to determine
the <abbr>UT</abbr> offset and time zone abbreviation of arbitrary
- timestamps, particularly for <code><abbr>tz</abbr></code> regions
+ timestamps, particularly for timezones
that do not fit into the POSIX model.
</li>
<li>
@@ -919,7 +966,7 @@ an older <code>zic</code>.
Unsigned 32-bit integers are used on one or two platforms, and 36-bit
and 40-bit integers are also used occasionally.
Although earlier POSIX versions allowed <code>time_t</code> to be a
- floating-point type, this was not supported by any practical systems,
+ floating-point type, this was not supported by any practical system,
and POSIX.1-2013 and the <code><abbr>tz</abbr></code> code both
require <code>time_t</code> to be an integer type.
</li>
@@ -931,15 +978,16 @@ an older <code>zic</code>.
<li>
<p>
The <code>TZ</code> environment variable is used in generating
- the name of a binary file from which time-related information is read
+ the name of a file from which time-related information is read
(or is interpreted à la POSIX); <code>TZ</code> is no longer
- constrained to be a three-letter time zone
- abbreviation followed by a number of hours and an optional three-letter
- daylight time zone abbreviation.
+ constrained to be a string containing abbreviations
+ and numeric data as described <a href="#POSIX">above</a>.
+ The file's format is <dfn><abbr>TZif</abbr></dfn>,
+ a timezone information format that contains binary data.
The daylight saving time rules to be used for a
- particular <code><abbr>tz</abbr></code> region are encoded in the
- binary file; the format of the file
- allows U.S., Australian, and other rules to be encoded, and
+ particular timezone are encoded in the
+ <abbr>TZif</abbr> file; the format of the file allows <abbr>US</abbr>,
+ Australian, and other rules to be encoded, and
allows for situations where more than two time zone
abbreviations are used.
</p>
@@ -949,15 +997,15 @@ an older <code>zic</code>.
might cause "old" programs (that expect <code>TZ</code> to have a
certain form) to operate incorrectly; consideration was given to using
some other environment variable (for example, <code>TIMEZONE</code>)
- to hold the string used to generate the binary file's name.
+ to hold the string used to generate the <abbr>TZif</abbr> file's name.
In the end, however, it was decided to continue using
<code>TZ</code>: it is widely used for time zone purposes;
separately maintaining both <code>TZ</code>
and <code>TIMEZONE</code> seemed a nuisance; and systems where
"new" forms of <code>TZ</code> might cause problems can simply
- use <code>TZ</code> values such as "<code>EST5EDT</code>" which
- can be used both by "new" programs (à la POSIX) and "old"
- programs (as zone names and offsets).
+ use legacy <code>TZ</code> values such as "<code>EST5EDT</code>" which
+ can be used by "new" programs as well as by "old" programs that
+ assume pre-POSIX <code>TZ</code> values.
</p>
</li>
<li>
@@ -972,7 +1020,7 @@ an older <code>zic</code>.
Functions <code>tzalloc</code>, <code>tzfree</code>,
<code>localtime_rz</code>, and <code>mktime_z</code> for
more-efficient thread-safe applications that need to use multiple
- time zone rulesets.
+ timezones.
The <code>tzalloc</code> and <code>tzfree</code> functions
allocate and free objects of type <code>timezone_t</code>,
and <code>localtime_rz</code> and <code>mktime_z</code> are
@@ -1093,8 +1141,9 @@ The vestigial <abbr>API</abbr>s are:
standardization proposals.
</li>
<li>
- Other time conversion proposals, in particular the one developed
- by folks at Hewlett Packard, offer a wider selection of functions
+ Other time conversion proposals, in particular those supported by the
+ <a href="https://howardhinnant.github.io/date/tz.html">Time Zone
+ Database Parser</a>, offer a wider selection of functions
that provide capabilities beyond those provided here.
The absence of such functions from this package is not meant to
discourage the development, standardization, or use of such
@@ -1116,8 +1165,8 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces:
<ul>
<li>
- A set of <code><abbr>tz</abbr></code> region names as per
- "<a href="#naming">Names of time zone rulesets</a>" above.
+ A set of timezone names as per
+ "<a href="#naming">Names of timezones</a>" above.
</li>
<li>
Library functions described in "<a href="#functions">Time and date
@@ -1186,7 +1235,7 @@ They sometimes disagree.
<h2 id="planets">Time and time zones on other planets</h2>
<p>
Some people's work schedules
-use <a href="https://en.wikipedia.org/wiki/Timekeeping on Mars">Mars time</a>.
+use <a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.
Jet Propulsion Laboratory (JPL) coordinators kept Mars time on
and off during the
<a href="https://en.wikipedia.org/wiki/Mars_Pathfinder#End_of_mission">Mars
@@ -1218,7 +1267,7 @@ Coordinated Time (<abbr>MTC</abbr>)</a>.
<p>
Each landed mission on Mars has adopted a different reference for
-solar time keeping, so there is no real standard for Mars time zones.
+solar timekeeping, so there is no real standard for Mars time zones.
For example, the
<a href="https://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars
Exploration Rover</a> project (2004) defined two time zones "Local
@@ -1290,7 +1339,7 @@ Sources for time on other planets:
Matt Williams,
"<a href="https://www.universetoday.com/37481/days-of-the-planets/">How
long is a day on the other planets of the solar system?</a>"
- (2017-04-27).
+ (2016-01-20).
</li>
</ul>
</section>
diff --git a/lib/libc/time/tz-art.html b/lib/libc/time/tz-art.html
index 9624d8cd229..c98e9c49458 100644
--- a/lib/libc/time/tz-art.html
+++ b/lib/libc/time/tz-art.html
@@ -160,6 +160,11 @@ time I've ever been early for work. Except for all those daylight
savings days. Lousy farmers."
</li>
<li>
+<em>Last Week Tonight with John Oliver</em>, season 2, episode 5, 2015-03-08,
+asked, "<a href="https://www.youtube.com/watch?v=br0NW9ufUUw">Daylight Saving
+Time &ndash; How Is This Still A Thing?</a>"
+</li>
+<li>
"Tracks", <em>The Good Wife</em>, season 7, episode 12,
CBS, 2016-01-17.
The applicability of a contract hinges on the
@@ -466,8 +471,9 @@ The webcomic <em>xkcd</em> has the strip
"<a href='https://xkcd.com/1335/'>Now</a>" (2014-02-26),
"<a href='https://xkcd.com/1655/'>Doomsday Clock</a>" (2016-03-14),
"<a href='https://xkcd.com/1799/'>Bad Map Projection: Time Zones</a>"
-(2017-02-15), and
-"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30).
+(2017-02-15),
+"<a href='https://xkcd.com/1883/'>Supervillain Plan</a>" (2017-08-30),
+and "<a href='https://xkcd.com/2050/'>6/6 Time</a>" (2018-09-24).
The related book <em>What If?</em> has an entry
"<a href='https://what-if.xkcd.com/26/'>Leap Seconds</a>" (2012-12-31).
</li>
diff --git a/lib/libc/time/tz-how-to.html b/lib/libc/time/tz-how-to.html
index a54f54a9689..159ed89fdd0 100644
--- a/lib/libc/time/tz-how-to.html
+++ b/lib/libc/time/tz-how-to.html
@@ -5,6 +5,9 @@
<head>
<title>How to Read the tz Database</title>
<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
+<style type="text/css">
+pre {margin-left: 2em; white-space: pre-wrap;}
+</style>
</head>
<body>
<h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
@@ -517,7 +520,7 @@ a <code>SAVE</code> of zero.
<ul>
<li>The <a href="https://en.wikipedia.org/wiki/Tz_database">tz
-database</a> gives abbreviations for time zone names in <i>popular
+database</a> gives abbreviations for time zones in <i>popular
usage</i>, which is not necessarily &ldquo;correct&rdquo; by law. For
example, the last line in
<code>Zone</code> <code>Pacific/Honolulu</code> (shown below) gives
diff --git a/lib/libc/time/tz-link.html b/lib/libc/time/tz-link.html
index 13a824d7e9a..8593ba62ec7 100644
--- a/lib/libc/time/tz-link.html
+++ b/lib/libc/time/tz-link.html
@@ -3,6 +3,9 @@
<head>
<title>Sources for time zone and daylight saving time data</title>
<meta charset="UTF-8">
+<style>
+pre {margin-left: 2em; white-space: pre-wrap;}
+</style>
</head>
<body>
<h1>Sources for time zone and daylight saving time data</h1>
@@ -32,8 +35,6 @@ including
C Library</a> (used in
<a href="https://en.wikipedia.org/wiki/Linux"><abbr>GNU</abbr>/Linux</a>),
<a href="https://www.android.com">Android</a>,
-<a href="https://developer.mozilla.org/en-US/docs/Mozilla/B2G_OS">B2G
-<abbr title="Operating System">OS</abbr></a>,
<a href="https://www.freebsd.org">Free<abbr
title="Berkeley Software Distribution">BSD</abbr></a>,
<a href="https://netbsd.org">Net<abbr>BSD</abbr></a>,
@@ -58,15 +59,14 @@ title="Virtual Memory System">VMS</abbr></a>,
<a href="https://www.oracle.com/database/index.html">Oracle Database</a>, and
<a href="https://www.oracle.com/solaris">Oracle Solaris</a>.</p>
<p>
-Each location in the database represents a region where all
-clocks keeping local time have agreed since 1970.
-Locations are identified by continent or ocean and then by the name of
-the location, which is typically the largest city within the region.
+Each main entry in the database represents a <dfn>timezone</dfn>
+for a set of civil-time clocks that have all agreed since 1970.
+Timezones are typically identified by continent or ocean and then by the
+name of the largest city within the region containing the clocks.
For example, <code>America/New_York</code>
represents most of the <abbr title="United States">US</abbr> eastern time zone;
<code>America/Phoenix</code> represents most of Arizona, which
-uses mountain time without daylight saving time (<abbr
-title="daylight saving time">DST</abbr>);
+uses mountain time without daylight saving time (<abbr>DST</abbr>);
<code>America/Detroit</code> represents most of Michigan, which uses
eastern time but with different <abbr>DST</abbr> rules in 1975;
and other entries represent smaller regions like Starke County,
@@ -79,12 +79,12 @@ implementation set the <code><abbr>TZ</abbr></code>
environment variable to the location's full name,
e.g., <code><abbr>TZ</abbr>="America/New_York"</code>.</p>
<p>
-Associated with each region is a history of offsets from
+Associated with each timezone is a history of offsets from
<a href="https://en.wikipedia.org/wiki/Universal_Time">Universal
Time</a> (<abbr>UT</abbr>), which is <a
href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean
Time</a> (<abbr>GMT</abbr>) with days beginning at midnight;
-for time stamps after 1960 this is more precisely <a
+for timestamps after 1960 this is more precisely <a
href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated
Universal Time</a> (<abbr>UTC</abbr>).
The database also records when daylight saving time was in use,
@@ -97,7 +97,7 @@ href="https://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
the latest release's two
<a href="https://en.wikipedia.org/wiki/Tar_(computing)">tarballs</a>
to a <abbr>GNU</abbr>/Linux or similar host.</p>
-<pre style="margin-left: 2em"><code>mkdir tzdb
+<pre><code>mkdir tzdb
cd tzdb
<a href="https://www.gnu.org/software/wget/">wget</a> https://www.iana.org/time-zones/repository/tzcode-latest.tar.gz
wget https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
@@ -107,7 +107,7 @@ gzip -dc tzdata-latest.tar.gz | tar -xf -
<p>Alternatively, the following shell commands download the same
release in a single-tarball format containing extra data
useful for regression testing:</p>
-<pre style="margin-left: 2em"><code>wget <a href="https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz">https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz</a>
+<pre><code>wget <a href="https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz">https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz</a>
<a href="https://www.nongnu.org/lzip/">lzip</a> -dc tzdb-latest.tar.lz | tar -xf -
</code></pre>
<p>These commands use convenience links to the latest release
@@ -133,7 +133,7 @@ less-secure protocol.</p>
<p>Alternatively, a development repository of code and data can be
retrieved from <a href="https://github.com">GitHub</a> via the shell
command:</p>
-<pre style="margin-left: 2em"><code><a href="https://git-scm.com">git</a> clone <a href="https://github.com/eggert/tz">https://github.com/eggert/tz</a>
+<pre><code><a href="https://git-scm.com">git</a> clone <a href="https://github.com/eggert/tz">https://github.com/eggert/tz</a>
</code></pre>
<p>
Since version 2012e, each release has been tagged in development repositories.
@@ -143,8 +143,10 @@ more errors.</p>
After obtaining the code and data files, see the
<code>README</code> file for what to do next.
The code lets you compile the <code><abbr>tz</abbr></code> source files into
-machine-readable binary files, one for each location. It also lets
-you read a <code><abbr>tz</abbr></code> binary file and interpret time stamps for that
+machine-readable binary files, one for each location. The binary files
+are in a special timezone information format (<dfn><abbr>TZif</abbr></dfn>).
+The code also lets
+you read a <abbr>TZif</abbr> file and interpret timestamps for that
location.</p>
<h2 id="changes">Changes to the <code><abbr>tz</abbr></code> database</h2>
<p>
@@ -217,6 +219,8 @@ For further information about updates, please see
Maintaining the Time Zone Database</a> (Internet <abbr
title="Request For Comments">RFC</abbr> 6557). More detail can be
found in <a href="theory.html">Theory and pragmatics of the tz code and data</a>.
+<a href="https://a0.github.io/a0-tzmigration/">A0 TimeZone Migration</a>
+displays changes between recent <code><abbr>tzdb</abbr></code> versions.
</p>
<h2 id="commentary">Commentary on the <code><abbr>tz</abbr></code> database</h2>
<ul>
@@ -272,12 +276,17 @@ href="https://tools.ietf.org/html/rfc7808">TZDIST</a>
(Internet <abbr>RFC</abbr> 7808), a time zone data distribution service,
along with <a href="https://tools.ietf.org/html/rfc7809">CalDAV</a>
(Internet <abbr>RFC</abbr> 7809), a calendar access protocol for
-transferring time zone data by reference. The draft <a
+transferring time zone data by reference.
+The <a href="https://www.ietf.org/mailman/listinfo/tzdist-bis">tzdist-bis
+mailing list</a> discusses two Internet drafts: <a
id="TZDIST-Geolocate"
-href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-01">TZDIST
-Geolocate Extension</a> lets a client determine its time zone region
+href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate">TZDIST
+Geolocate Extension</a> lets a client determine its timezone
from its geographic location using a <a
-href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>.</li>
+href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>, and
+<a href="https://tools.ietf.org/html/draft-murchison-tzdist-tzif">The
+Time Zone Information Format (<abbr>TZif</abbr>)</a> specifies the format of
+<abbr>TZif</abbr> data.</li>
<li>The <a href="https://tools.ietf.org/html/rfc5545">
Internet Calendaring and Scheduling Core Object Specification
(iCalendar)</a> (Internet <abbr>RFC</abbr> 5445)
@@ -404,6 +413,14 @@ the <abbr>MIT</abbr> license.</li>
compiler from <code><abbr>tz</abbr></code> source into
<a href="https://julialang.org/">Julia</a>. It is freely available
under the <abbr>MIT</abbr> license.</li>
+<li><a href="https://github.com/pavkam/tzdb">Delphi/<abbr
+title="Free Pascal Compiler">FPC</abbr> Time Zone Database</a>
+compiles from <code><abbr>tz</abbr></code> source into
+<a href="https://en.wikipedia.org/wiki/Object_Pascal">Object Pascal</a>
+as compiled by <a href="https://en.wikipedia.org/wiki/Delphi_(IDE)">Delphi</a>
+and <a
+href="https://en.wikipedia.org/wiki/Free_Pascal"><abbr>FPC</abbr></a>.
+It is freely available under a <abbr>BSD</abbr>-style license.</li>
<li><a href="http://pytz.sourceforge.net">pytz &ndash; World Timezone
Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
<a href="https://www.python.org">Python</a>.
@@ -426,36 +443,36 @@ source into text files, along with a runtime that can read those
files. Tcl is freely available under a <abbr>BSD</abbr>-style
license.</li>
</ul>
-<h2 id="binary">Other <code><abbr>tz</abbr></code> binary file readers</h2>
+<h2 id="TZif">Other <abbr>TZif</abbr> readers</h2>
<ul>
<li>The <a
href="https://www.gnu.org/software/libc/"><abbr>GNU</abbr> C
Library</a>
has an independent, thread-safe implementation of
-a <code><abbr>tz</abbr></code> binary file reader.
+a <abbr>TZif</abbr> file reader.
This library is freely available under the LGPL
and is widely used in <abbr>GNU</abbr>/Linux systems.</li>
<li><a href="https://www.gnome.org">GNOME</a>'s
<a href="https://developer.gnome.org/glib/">GLib</a> has
-a <code><abbr>tz</abbr></code> binary file reader written in C that
+a <abbr>TZif</abbr> file reader written in C that
creates a <code>GTimeZone</code> object representing sets
of <abbr>UT</abbr> offsets.
It is freely available under the <abbr>LGPL</abbr>.</li>
<li>The
<a href="https://github.com/bloomberg/bde/wiki">BDE Standard Library</a>'s
<code>baltzo::TimeZoneUtil</code> component contains a C++
-implementation of a binary file reader. It is freely available under
+implementation of a <abbr>TZif</abbr> file reader. It is freely available under
the Apache License.</li>
<li><a href="https://github.com/google/cctz">CCTZ</a> is a simple C++
library that translates between <abbr>UT</abbr> and civil time and
-can read binary files. It is freely available under the Apache
+can read <abbr>TZif</abbr> files. It is freely available under the Apache
License.</li>
<li><a href="http://bmsi.com/java/#TZ">ZoneInfo.java</a>
-is a <code><abbr>tz</abbr></code> binary file reader written in Java.
+is a <abbr>TZif</abbr> file reader written in Java.
It is freely available under the <abbr>LGPL</abbr>.</li>
<li><a href="https://github.com/derickr/timelib">Timelib</a> is a C
-library that reads tz binary files and converts
-time stamps from one time zone or format to another.
+library that reads <abbr>TZif</abbr> files and converts
+timestamps from one time zone or format to another.
It is used by <a href="https://secure.php.net"><abbr
title="PHP: Hypertext Preprocessor">PHP</abbr></a>,
<a href="https://hhvm.com"><abbr title="HipHop Virtual Machine">HHVM</abbr></a>,
@@ -465,23 +482,23 @@ It is freely available under the <abbr>MIT</abbr> license.</li>
JavaScript library that supports date arithmetic that is time zone
aware. It is freely available under the <abbr>MIT</abbr> license.</li>
<li>Tcl, mentioned <a href="#Tcl">above</a>, also contains a
-<code><abbr>tz</abbr></code> binary file reader.</li>
+<abbr>TZif</abbr> file reader.</li>
<li><a href="http://search.cpan.org/perldoc?DateTime::TimeZone::Tzfile">
DateTime::TimeZone::Tzfile</a>
-is a <code><abbr>tz</abbr></code> binary file reader written in Perl.
+is a <abbr>TZif</abbr> file reader written in Perl.
It is freely available under the same terms as Perl
(dual <abbr>GPL</abbr> and Artistic license).</li>
<li>The
public-domain <a href="https://github.com/dbaron/tz.js">tz.js</a>
library contains a Python tool that
-converts <code><abbr>tz</abbr></code> binary data into
+converts <abbr>TZif</abbr> data into
<abbr>JSON</abbr>-format data suitable for use
in its JavaScript library for time zone conversion. Dates before 1970
are not supported.</li>
<li>The <a
href="https://hackage.haskell.org/package/timezone-olson">timezone-olson</a>
package contains <a href="https://www.haskell.org">Haskell</a> code that
-parses and uses <code><abbr>tz</abbr></code> binary data. It is freely
+parses and uses <abbr>TZif</abbr> data. It is freely
available under a <abbr>BSD</abbr>-style license.</li>
</ul>
<h2 id="software">Other <code><abbr>tz</abbr></code>-based time zone software</h2>
@@ -528,7 +545,7 @@ href="https://www.oracle.com/java/index.html">Oracle
Java</a> contains a copy of a subset of a recent
<code><abbr>tz</abbr></code> database in a
Java-specific format.</li>
-<li><a href="https://www.relativedata.com/time-zone-master">Time Zone
+<li><a href="https://relativedata.com/page/Time-Zone-Master">Time Zone
Master</a> is a Microsoft Windows clock program that can automatically
download, compile and use <code>tz</code> releases. The Basic version
is free.</li>
@@ -554,9 +571,6 @@ its own <code>tztab</code>(4) format.</li>
<a href="#System.TimeZoneInfo">above</a>.</li>
<li><a href="https://www.worldtimeserver.com">World Time Server</a>
is another time zone database.</li>
-<li><a href="http://tycho.usno.navy.mil/tzones.html">World Time Zones</a>
-contains data from the Time Service Department of the
-<abbr>US</abbr> Naval Observatory.</li>
<li>The <a
href="https://www.iata.org/publications/store/Pages/standard-schedules-information.aspx">Standard
Schedules Information Manual</a> of the
@@ -591,7 +605,7 @@ mean solar and standard time, highlighting areas such as western China
where the two differ greatly. It's a bit out of date, unfortunately.</li>
</ul>
<h2 id="boundaries">Time zone boundaries</h2>
-<p>Geographical boundaries between time zone regions are available
+<p>Geographical boundaries between timezones are available
from several <a href="https://en.wikipedia.org/wiki/Geolocation">geolocation</a>
services and other sources.</p>
<ul>
@@ -600,7 +614,7 @@ services and other sources.</p>
<li><a href="https://github.com/evansiroky/timezone-boundary-builder">Timezone
Boundary Builder</a> extracts
<a href="https://www.openstreetmap.org">Open Street Map</a> data to build
-boundaries of <code><abbr>tz</abbr></code> regions.
+boundaries of <code><abbr>tzdb</abbr></code> timezones.
Its code is freely available under the <abbr>MIT</abbr> license, and
its data entries are freely available under the
<a href="https://opendatacommons.org/licenses/odbl/">Open Data Commons
@@ -608,9 +622,9 @@ Open Database License</a>. The maps' borders appear to be quite accurate.</li>
<li><a href="http://efele.net/maps/tz/"><abbr>TZ</abbr> timezones
maps</a> contains <a
href="https://en.wikipedia.org/wiki/Shapefile">shapefiles</a> of
-sets of <code><abbr>tz</abbr></code> regions. This includes
+sets of <code><abbr>tzdb</abbr></code> timezones. This includes
<a href="http://efele.net/maps/tz/world/">tz_world</a>, a shapefile
-for all the world's regions. These maps are no longer maintained and
+for all the world's timezones. These maps are no longer maintained and
are superseded by the Timezone Boundary Builder.</li>
<li><a
href="https://github.com/straup/whereonearth-timezone">Whereonearth-timezone</a>
@@ -621,7 +635,7 @@ the tz_world shapefiles with the
dataset.</li>
</ul></li>
<li>Programmatic interfaces that map geographical coordinates via tz_world to
-<code><abbr>tz</abbr></code> regions include:
+<code><abbr>tzdb</abbr></code> timezones include:
<ul>
<li><a href="https://github.com/mj1856/GeoTimeZone">GeoTimeZone</a> is
written in <a
@@ -742,15 +756,19 @@ href="ftp://ftp.cs.huji.ac.il/pub/tz/announcements"
hreflang="he">announcements (in Hebrew)</a>.</dd>
<dt>Italy</dt>
<dd>The National Institute of Metrological Research maintains a
-<a href="http://www.nanospin.eu/res/tf/ora_legale_i.shtml">table of civil time
+<a href="http://oldsite.inrim.it/res/tf/ora_legale_i.shtml">table of civil time
(in Italian)</a>.</dd>
+<dt>Macau</dt>
+<dd>The Meteorological and Geophysical Bureau maintains a
+<a href="http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm">history
+of summer time</a>. Unfortunately it is incomplete and has errors.</dd>
+<dt>Malaysia</dt>
+<dd>See Singapore <a href="#Singapore">below</a>.</dd>
<dt>Mexico</dt>
<dd>The Investigation and Analysis Service of the Mexican Library of
Congress has published a <a
href="http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm"
hreflang="es">history of Mexican local time (in Spanish)</a>.</dd>
-<dt>Malaysia</dt>
-<dd>See Singapore <a href="#Singapore">below</a>.</dd>
<dt>Netherlands</dt>
<dd><a href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
hreflang="nl">Legal time in the Netherlands (in Dutch)</a>
@@ -797,11 +815,15 @@ title="Network Time Protocol">NTP</abbr>: The Network
Time Protocol</a> (Internet <abbr>RFC</abbr> 5905)
discusses how to synchronize clocks of
Internet hosts.</li>
+<li>The <a href="https://www.usenix.org/system/files/conference/nsdi18/nsdi18-geng.pdf"><span style="font-variant: small-caps">Huygens</span></a>
+family of software algorithms can achieve accuracy to a few tens of
+nanoseconds in scalable server farms without special hardware.</li>
<li>The <a
href="https://www.nist.gov/intelligent-systems-division/ieee-1588">Precision
Time Protocol</a> (<abbr
title="Institute of Electrical and Electronics Engineers">IEEE</abbr> 1588)
-can achieve submicrosecond clock accuracy on a local area network.</li>
+can achieve submicrosecond clock accuracy on a local area network
+with special-purpose hardware.</li>
<li><a
href="https://tools.ietf.org/html/rfc4833">Timezone
Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a>
@@ -915,7 +937,7 @@ but in China it denotes 8 hours ahead of <abbr>UT</abbr>,
and French-speaking North Americans prefer
"<abbr title="Heure Normale du Centre">HNC</abbr>" to
"<abbr>CST</abbr>". The <code><abbr>tz</abbr></code>
-database contains English abbreviations for many time stamps;
+database contains English abbreviations for many timestamps;
unfortunately some of these abbreviations were merely the database maintainers'
inventions, and these have been removed when possible.</li>
<li>Numeric time zone abbreviations typically count hours east of
@@ -929,7 +951,7 @@ for Japan and Hawaii, respectively. If the
<code><abbr>tz</abbr></code> database is available, it is usually better to use
settings like <code><abbr>TZ</abbr>="Asia/Tokyo"</code> and
<code><abbr>TZ</abbr>="Pacific/Honolulu"</code> instead, as this should avoid
-confusion, handle old time stamps better, and insulate you better from
+confusion, handle old timestamps better, and insulate you better from
any future changes to the rules. One should never set
<abbr>POSIX</abbr> <code><abbr>TZ</abbr></code> to a value like
<code>"GMT-9"</code>, though, since this would incorrectly imply that
diff --git a/lib/libc/time/tzfile.5 b/lib/libc/time/tzfile.5
index 25bd9e175eb..6cd325d57af 100644
--- a/lib/libc/time/tzfile.5
+++ b/lib/libc/time/tzfile.5
@@ -1,15 +1,15 @@
-.\" $NetBSD: tzfile.5,v 1.25 2017/10/24 17:38:17 christos Exp $
+.\" $NetBSD: tzfile.5,v 1.26 2018/10/19 23:05:35 christos Exp $
.\"
.\" This file is in the public domain, so clarified as of
.\" 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
-.Dd October 6, 2016
+.Dd October 19, 2018
.Dt TZFILE 5
.Os
.Sh NAME
.Nm tzfile
.Nd time zone information
.Sh DESCRIPTION
-The time zone information files used by
+The timezone information files used by
.Xr tzset 3
are typically found under a directory with a name like
.Pa /usr/share/zoneinfo .
@@ -18,7 +18,7 @@ These files beging with a 44-byte header containing the following fields:
.It
The magic four-byte ASCII sequence begin with the magic characters
.Dq TZif .
-identifies the file as a time zone information file.
+identifies the file as a timezone information file.
.It
A byte identifying the version of the file's format (as of 2017, either
an ASCII
@@ -47,7 +47,7 @@ in the file.
The number of local time types for which data entries are stored
in the file (must not be zero).
.It Va tzh_charcnt
-The number of bytes of time zone abbreviation strings
+The number of bytes of timezone abbreviation strings
stored in the file.
.El
.It
@@ -63,9 +63,12 @@ Each is used as a transition time (as returned by
at which the rules for computing local time change.
.It Va tzh_timecnt
one-byte unsigned integer values;
-each one tells which of the different types of local time types
+each one but the last tells which of the different types of local time types
described in the file is associated with the time period
-starting with the same-indexed transition time.
+starting with the same-indexed transition time
+and continuing up to but not including the next transition time.
+(The last time type is present only for consistency checking with the
+POSIX-style TZ string described below.)
These values serve as indices into the next field.
.It Va tzh_typecnt
.Va ttinfo
@@ -94,7 +97,7 @@ should be set by
.Xr localtime 3
and
.Va tt_abbrind
-serves as an index into the array of time zone abbreviation bytes
+serves as an index into the array of timezone abbreviation bytes
that follow the
.Va ttinfo
structure(s) in the file.
@@ -115,14 +118,14 @@ transitions always separated by at least 28 days minus 1 second.
standard/wall indicators, each stored as a one-byte value;
they tell whether the transition times associated with local time types
were specified as standard time or wall clock time,
-and are used when a time zone file is used in handling POSIX-style
-time zone environment variables.
+and are used when a timezone file is used in handling POSIX-style
+timezone environment variables.
.It Va tzh_ttisgmtcnt
UT/local indicators, each stored as a one-byte value;
they tell whether the transition times associated with local time types
were specified as UT or local time,
-and are used when a time zone file is used in handling POSIX-style
-time zone environment variables.
+and are used when a timezone file is used in handling POSIX-style
+timezone environment variables.
.Pp
The
.Xr localtime 3
@@ -139,7 +142,7 @@ in the file.
.El
.El
.Ss Version 2 format
-For version-2-format time zone files,
+For version-2-format timezone files,
the above header and data are followed by a second header and data,
identical in format except that
eight bytes are used for each transition time or leap second time.
@@ -147,17 +150,22 @@ eight bytes are used for each transition time or leap second time.
After the second header and data comes a newline-enclosed,
POSIX-TZ-environment-variable-style string for use in handling instants
after the last transition time stored in the file
-(with nothing between the newlines if there is no POSIX representation for
-such instants).
-The POSIX-style string must agree with the local time type after
-both data's last transition times; for example, given the string
+or for all instants if the file has no transitions.
+The POSIX-style TZ string is empty (i.e., nothing between the newlines)
+if there is no POSIX representation for such instants.
+If nonempty, the POSIX-style TZ string must agree with the local time
+type after the last transition time if present in the eight-byte data;
+for example, given the string
.Dq 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
.Dq WEST
that is one hour east of UT.
+Also, if there is at least one transition, time type 0 is associated
+with the time period from the indefinite past up to but not including
+the earliest transition time.
.Ss Version 3 format
-For version-3-format time zone files, the POSIX-TZ-style string may
+For version-3-format timezone files, the POSIX-TZ-style string may
use two minor extensions to the POSIX TZ format, as described in
.Xr tzset 3 .
First, the hours part of its transition times may be signed and range from
diff --git a/lib/libc/time/tzselect.8 b/lib/libc/time/tzselect.8
index c1020cad2e1..1e804c96eec 100644
--- a/lib/libc/time/tzselect.8
+++ b/lib/libc/time/tzselect.8
@@ -1,8 +1,8 @@
-.\" $NetBSD: tzselect.8,v 1.7 2018/01/25 22:48:42 christos Exp $
+.\" $NetBSD: tzselect.8,v 1.8 2018/10/19 23:05:35 christos Exp $
.\"
.TH TZSELECT 8
.SH NAME
-tzselect \- select a time zone
+tzselect \- select a timezone
.SH SYNOPSIS
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
@@ -22,7 +22,7 @@ tzselect \- select a time zone
The
.B tzselect
program asks the user for information about the current location,
-and outputs the resulting time zone description to standard output.
+and outputs the resulting timezone to standard output.
The output is suitable as a value for the TZ environment variable.
.PP
All interaction with the user is done via standard input and standard error.
@@ -89,7 +89,7 @@ program (default:
.BR awk ).
.TP
\f3TZDIR\fP
-Name of the directory containing time zone data files (default:
+Name of the directory containing timezone data files (default:
.BR /usr/share/zoneinfo ).
.SH FILES
.TP
@@ -97,13 +97,13 @@ Name of the directory containing time zone data files (default:
Table of ISO 3166 2-letter country codes and country names.
.TP
\f2TZDIR\fP\f3/zone1970.tab\fP
-Table of country codes, latitude and longitude, zone names, and
+Table of country codes, latitude and longitude, timezones, and
descriptive comments.
.TP
\f2TZDIR\fP\f3/\fP\f2TZ\fP
-Time zone data file for time zone \f2TZ\fP.
+Timezone data file for timezone \f2TZ\fP.
.SH "EXIT STATUS"
-The exit status is zero if a time zone was successfully obtained from the user,
+The exit status is zero if a timezone was successfully obtained from the user,
nonzero otherwise.
.SH "SEE ALSO"
newctime(3), tzfile(5), zdump(8), zic(8)
diff --git a/lib/libc/time/tzselect.ksh b/lib/libc/time/tzselect.ksh
index 8ace3b8b65c..ebf5afc50c7 100644
--- a/lib/libc/time/tzselect.ksh
+++ b/lib/libc/time/tzselect.ksh
@@ -1,14 +1,14 @@
#! /bin/bash
#
-# $NetBSD: tzselect.ksh,v 1.17 2018/01/25 22:48:42 christos Exp $
+# Ask the user about the time zone, and output the resulting TZ value to stdout.
+# Interact with the user via stderr and stdin.
+#
+# $NetBSD: tzselect.ksh,v 1.18 2018/10/19 23:05:35 christos Exp $
#
PKGVERSION='(tzcode) '
TZVERSION=see_Makefile
REPORT_BUGS_TO=tz@iana.org
-# Ask the user about the time zone, and output the resulting TZ value to stdout.
-# Interact with the user via stderr and stdin.
-
# Contributed by Paul Eggert. This file is in the public domain.
# Porting notes:
@@ -57,7 +57,7 @@ location_limit=10
zonetabtype=zone1970
usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
-Select a time zone interactively.
+Select a timezone interactively.
Options:
@@ -329,7 +329,7 @@ while
eval '
doselect '"$quoted_continents"' \
"coord - I want to use geographical coordinates." \
- "TZ - I want to specify the time zone using the Posix TZ format."
+ "TZ - I want to specify the timezone using the Posix TZ format."
continent=$select_result
case $continent in
Americas) continent=America;;
@@ -344,8 +344,8 @@ while
while
echo >&2 'Please enter the desired value' \
'of the TZ environment variable.'
- echo >&2 'For example, AEST-10 is a zone named AEST' \
- 'that is 10 hours'
+ echo >&2 'For example, AEST-10 is abbreviated' \
+ 'AEST and is 10 hours'
echo >&2 'ahead (east) of Greenwich,' \
'with no daylight saving time.'
read TZ
@@ -364,7 +364,7 @@ while
exit 0
}'
do
- say >&2 "'$TZ' is not a conforming Posix time zone string."
+ say >&2 "'$TZ' is not a conforming Posix timezone string."
done
TZ_for_date=$TZ;;
*)
@@ -390,8 +390,7 @@ while
BEGIN { FS = "\t" }
{ print $NF }
'`
- echo >&2 'Please select one of the following' \
- 'time zone regions,'
+ echo >&2 'Please select one of the following timezones,' \
echo >&2 'listed roughly in increasing order' \
"of distance from $coord".
doselect $regions
@@ -441,7 +440,7 @@ while
esac
- # Get list of names of time zone rule regions in the country.
+ # Get list of timezones in the country.
regions=`$AWK \
-v country="$country" \
-v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
@@ -464,8 +463,7 @@ while
# If there's more than one region, ask the user which one.
case $regions in
*"$newline"*)
- echo >&2 'Please select one of the following' \
- 'time zone regions.'
+ echo >&2 'Please select one of the following timezones.'
doselect $regions
region=$select_result;;
*)
diff --git a/lib/libc/time/tzset.3 b/lib/libc/time/tzset.3
index 41671d0ed9b..e2bc6282af3 100644
--- a/lib/libc/time/tzset.3
+++ b/lib/libc/time/tzset.3
@@ -1,5 +1,5 @@
-.\" $NetBSD: tzset.3,v 1.38 2018/05/04 15:51:00 christos Exp $
-.Dd May 5, 2018
+.\" $NetBSD: tzset.3,v 1.39 2018/10/19 23:05:35 christos Exp $
+.Dd October 19, 2018
.Dt TZSET 3
.Os
.Sh NAME
@@ -37,7 +37,7 @@ functions.
.Pp
If
.Ar tz
-is not a valid time zone description, or if the object cannot be allocated,
+is not a valid timezone description, or if the object cannot be allocated,
.Fn tzalloc
returns a
.Dv NULL
@@ -104,13 +104,13 @@ The
.Fn tzset
function acts like
.Dv tzalloc(getenv("TZ")) ,
-except it saves any resulting time zone object into internal
+except it saves any resulting timezone object into internal
storage that is accessed by
.Fn localtime ,
.Fn localtime_r ,
and
.Fn mktime .
-The anonymous shared time zone object is freed by the next call to
+The anonymous shared timezone object is freed by the next call to
.Fn tzset .
If the implied call to
.Fn tzalloc
@@ -178,7 +178,7 @@ Three or more bytes that are the designation for the standard
or the alternative
.Cm ( dst
such as daylight saving time)
-time zone.
+timezone.
Only
.Cm std
is required; if
@@ -233,7 +233,7 @@ The hour must be between zero and 24, and the minutes (and
seconds) \*(en if present \*(en between zero and 59.
If preceded by a
.Dq -
-the time zone shall be east of the Prime Meridian; otherwise it shall be
+the timezone shall be east of the Prime Meridian; otherwise it shall be
west (which may be indicated by an optional preceding
.Dq + ) .
.It Cm rule
@@ -331,7 +331,7 @@ is not given, is
.Pp
Here are some examples of
.Va TZ
-values that directly specify the time zone rules; they use some of the
+values that directly specify the timezone rules; they use some of the
extensions to POSIX.
.Bl -tag
.It EST5
@@ -398,11 +398,11 @@ from the rest of the specification.
.Sh FILES
.Bl -tag -width /usr/share/zoneinfo/posixrules -compact
.It Pa /etc/localtime
-local time zone file
+local timezone file
.It Pa /usr/share/zoneinfo
-time zone information directory
-\" .It Pa /usr/share/zoneinfo/localtime
-\" local time zone file
+local timezone information directory
+.\" .It Pa /usr/share/zoneinfo/localtime
+.\" local timezone file
.It Pa /usr/share/zoneinfo/posixrules
used with POSIX-style TZ's
.It Pa /usr/share/zoneinfo/GMT
diff --git a/lib/libc/time/version b/lib/libc/time/version
index cc61cea271c..78d5ebf3444 100644
--- a/lib/libc/time/version
+++ b/lib/libc/time/version
@@ -1 +1 @@
-2018e
+2018f
diff --git a/lib/libc/time/zdump.8 b/lib/libc/time/zdump.8
index adfd3ec5a46..e28877d100c 100644
--- a/lib/libc/time/zdump.8
+++ b/lib/libc/time/zdump.8
@@ -1,45 +1,46 @@
-.\" $NetBSD: zdump.8,v 1.17 2017/07/03 21:32:50 wiz Exp $
-.Dd March 11, 2017
+.\" $NetBSD: zdump.8,v 1.18 2018/10/19 23:05:35 christos Exp $
+.Dd October 19, 2018
.Dt ZDUMP 8
.Os
.Sh NAME
.Nm zdump
-.Nd time zone dumper
+.Nd timezone dumper
.Sh SYNOPSIS
.Nm zdump
.Op Fl \-version
.Op Fl v
.Op Fl V
.Op Fl c Ar [loyear,]highyear
-.Op Ar zonename ...
+.Op Ar timezone ...
.Nm zdump
.Fl t
.Ar [lotime,]hightime
.Op Ar zonename ...
.Sh DESCRIPTION
+The
.Nm
-prints the current time in each
-.Ar zonename
+program prints the current time in each
+.Ar timezone
named on the command line.
-.Pp
-These options are available:
+.SH OPTIONS
.Bl -tag -width XXXXXXXXX -compact
.It Fl \-version
Output version information and exit.
+.It Fl \-help
+Output short usage message and exit.
.It Fl i
-.Em This option is experimental: its behavior may change in future versions.
Output a description of time intervals.
For each
-.Ar zonename
+.Ar timezone
on the command line, output an interval-format description of the
-zone.
+timezone.
See
.Sx "INTERVAL FORMAT"
below.
.It Fl v
Output a verbose description of time intervals.
For each
-.Ar zonename
+.Ar timezon
on the command line,
print the time at the lowest possible time value,
the time one day after the lowest possible time value,
@@ -75,7 +76,7 @@ Cut off interval output at the given time(s),
given in decimal seconds since 1970-01-01 00:00:00
Coordinated Universal Time (UTC).
The
-.Ar zonename
+.Ar timezone
determines whether the count includes leap seconds.
As with
.Fl c ,
@@ -88,7 +89,6 @@ This generates output that is easier to compare to that of
implementations with different time representations.
.El
.Sh "INTERVAL FORMAT"
-.Em This format is experimental: it may change in future versions.
.Pp
The interval format is a compact text representation that is intended
to be both human- and machine-readable.
@@ -96,7 +96,7 @@ It consists of an empty line, then a line
.Dq TZ=string
where
.Dv string
-is a double-quoted string giving the zone name, a second line
+is a double-quoted string giving the timezone, a second line
.Dq \&- \&- interval
describing the time interval before the first transition if any, and
zero or more following lines
@@ -201,16 +201,15 @@ output,
.Dq UT
denotes the value returned by
.Xr gmtime 3 ,
-which uses UTC for modern time stamps and some other UT flavor for
-time stamps that predate the introduction of UTC.
+which uses UTC for modern timestamps and some other UT flavor for
+timestamps that predate the introduction of UTC.
No attempt is currently made to have the output use
.Dq UTC
for newer and
.Dq UT
-for older time stamps, partly because the exact date of the
+for older timestamps, partly because the exact date of the
introduction of UTC is problematic.
.Sh SEE ALSO
-.Xr ctime 3 ,
.Xr tzfile 5 ,
.Xr zic 8
.\" @(#)zdump.8 8.2
diff --git a/lib/libc/time/zdump.c b/lib/libc/time/zdump.c
index b335a6f428f..0fa58559725 100644
--- a/lib/libc/time/zdump.c
+++ b/lib/libc/time/zdump.c
@@ -1,4 +1,6 @@
-/* $NetBSD: zdump.c,v 1.49 2018/05/04 15:51:00 christos Exp $ */
+/* $NetBSD: zdump.c,v 1.50 2018/10/19 23:05:35 christos Exp $ */
+/* Dump time zone data in a textual format. */
+
/*
** This file is in the public domain, so clarified as of
** 2009-05-17 by Arthur David Olson.
@@ -6,7 +8,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: zdump.c,v 1.49 2018/05/04 15:51:00 christos Exp $");
+__RCSID("$NetBSD: zdump.c,v 1.50 2018/10/19 23:05:35 christos Exp $");
#endif /* !defined lint */
#ifndef NETBSD_INSPIRED
@@ -382,7 +384,7 @@ __dead static void
usage(FILE *const stream, const int status)
{
(void) fprintf(stream,
-_("%s: usage: %s OPTIONS ZONENAME ...\n"
+_("%s: usage: %s OPTIONS TIMEZONE ...\n"
"Options include:\n"
" -c [L,]U Start at year L (default -500), end before year U (default 2500)\n"
" -t [L,]U Start at time L, end before time U (in seconds since 1970)\n"
diff --git a/lib/libc/time/zic.8 b/lib/libc/time/zic.8
index f464a9db6c9..401871429b9 100644
--- a/lib/libc/time/zic.8
+++ b/lib/libc/time/zic.8
@@ -1,10 +1,10 @@
-.\" $NetBSD: zic.8,v 1.29 2018/05/04 15:51:00 christos Exp $
-.Dd May 5, 2018
+.\" $NetBSD: zic.8,v 1.30 2018/10/19 23:05:35 christos Exp $
+.Dd October 19, 2018
.Dt ZIC 8
.Os
.Sh NAME
.Nm zic
-.Nd time zone compiler
+.Nd timezone compiler
.Sh SYNOPSIS
.Nm
.Op Fl \-version
@@ -18,19 +18,22 @@
.Op Fl y Ar command
.Op Ar Filename ...
.Sh DESCRIPTION
+The
.Nm
-reads text from the file(s) named on the command line
+program reads text from the file(s) named on the command line
and creates the time conversion information files specified in this input.
If a
.Ar filename
is
.Ar \&- ,
-the standard input is read.
+standard input is read.
.Pp
-These options are available:
+.Sh OPTIONS
.Bl -tag -width XXXXXXXXXX -compact
.It Fl \-version
Output version information and exit.
+.It Fl \-help
+Output short usage message and exit.
.It Fl d Ar directory
Create time conversion information files in the named directory rather than
in the standard directory named below.
@@ -39,13 +42,17 @@ Read leap second information from the file with the given name.
If this option is not used,
no leap second information appears in output files.
.It Fl l Ar timezone
-Use the given time zone as local time.
+Use the
+.Ar timezone
+as local time.
.Nm
will act as if the input contained a link line of the form
.Dl Link timezone localtime
.It Fl p Ar timezone
-Use the given time zone's rules when handling POSIX-format
-time zone environment variables.
+Use
+.Ar timezone's
+rules when handling POSIX-format
+timezone environment variables.
.Nm
will act as if the input contained a link line of the form
.Dl Link timezone posixrules
@@ -78,7 +85,7 @@ Pre-2004 versions of
prohibit this.
.It
The output file does not contain all the information about the
-long-term future of a zone, because the future cannot be summarized as
+long-term future of a timezone, because the future cannot be summarized as
an extended POSIX TZ string.
For example, as of 2013 this problem
occurs for Iran's daylight-saving rules for the predicted future, as
@@ -89,7 +96,7 @@ The output contains data that may not be handled properly by client
code designed for older
.Xr zic 8
output formats.
-These compatibility issues affect only time stamps
+These compatibility issues affect only timestamps
before 1970 or after the start of 2038.
.It
A time zone abbreviation has fewer than 3 characters.
@@ -140,7 +147,7 @@ quotes
.\" XXX "
if they're to be used as part of a field.
Any line that is blank (after comment stripping) is ignored.
-Non-blank lines are expected to be of one of three types:
+Nonblank lines are expected to be of one of three types:
rule lines, zone lines, and link lines.
.Pp
Names must be in English and are case insensitive.
@@ -160,12 +167,20 @@ A rule line has the form
.Pp
For example:
.Pp
-.Dl Rule US 1967 1973 \- Apr lastSun 2:00s 1:00d D
+.Dl Rule US 1967 1973 \- Apr lastSun 2:00w 1:00d D
.Pp
The fields that make up a rule line are:
.Bl -tag -width "LETTER/S"
.It NAME
-Gives the (arbitrary) name of the set of rules this rule is part of.
+Gives the name of the rule set that contains this line.
+The name must start with a character that is neither
+an ASCII digit nor
+.Ar \&-
+nor
+.Ar + .
+To allow for future extensions,
+an unquoted name should not contain characters from the set
+.Ar !$%&'()*,/:;<=>?@[\e]^`{|}~ .
.It FROM
Gives the first year in which the rule applies.
Any signed integer year can be supplied; the proleptic Gregorian calendar
@@ -230,7 +245,8 @@ Note that there must be no spaces within the
.Em ON
field.
.It AT
-Gives the time of day at which the rule takes effect.
+Gives the time of day at which the rule takes effect,
+relative to 00:00, the start of a calendar day.
Recognized forms include:
.Pp
.Bl -tag -width "00X19X32X13" -compact -offset indent
@@ -242,8 +258,12 @@ time in hours and minutes
time in hours, minutes, and seconds
.It 00:19:32.13
time with fractional seconds
+.It 12:00
+midday, 12 hours after 00:00
.It 15:00
-24-hour format time (for times after noon)
+3 PM, 15 hours after 00:00
+.It 24:00
+end of day, 24 hours after 00:00
.It 260:00
260 hours after 00:00
.It \-2:30
@@ -252,8 +272,6 @@ time with fractional seconds
equivalent to 0
.El
.Pp
-where hour 0 is midnight at the start of the day,
-and hour 24 is midnight at the end of the day.
Although
.I zic
rounds times to the nearest integer second
@@ -324,7 +342,7 @@ the variable part is null.
.Pp
A zone line has the form
.Pp
-.Dl Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
+.Dl Zone NAME UTOFF RULES/SAVE FORMAT [UNTIL]
.Pp
For example:
.Pp
@@ -333,17 +351,17 @@ For example:
The fields that make up a zone line are:
.Bl -tag -width "RULES/SAVE"
.It NAME
-The name of the time zone.
+The name of the timezone.
This is the name used in creating the time conversion information file for the
-zone.
+timezone.
It should not contain a file name component
.Dq .
or
.Dq .. ;
a file name component is a maximal substring that does not contain
.Dq / .
-.It GMTOFF
-The amount of time to add to UT to get standard time in this zone.
+.It UTOFF
+The amount of time to add to UT to get standard time.
This field has the same format as the
.Em AT
and
@@ -351,17 +369,17 @@ and
fields of rule lines;
begin the field with a minus sign if time must be subtracted from UT.
.It RULES
-The name of the rules that apply in the time zone or,
+The name of the rules that apply in the timezone or,
alternatively, a field in the same format as a rule-line SAVE column,
giving of the amount of time to be added to local standard time
effect, and whether the resulting time is standard or daylight saving.
If this field is
.Em \&-
-then standard time always applies in the time zone.
+then standard time always applies.
When an amount of time is given, only the sum of standard time and
this amount matters.
.It FORMAT
-The format for time zone abbreviations in this time zone.
+The format for time zone abbreviations.
The pair of characters
.Em %s
is used to show where the
@@ -385,7 +403,10 @@ a slash
.Pq \&/
separates standard and daylight abbreviations.
To conform to POSIX, a time zone abbreviation should contain only
-alphanumeric ASCII characters, "+" and "\*-".
+alphanumeric ASCII characters,
+.Dq +
+and
+.Dq \&- .
.It UNTIL
The time at which the UT offset or the rule(s) change for a location.
It takes the form of YEAR [MONTH [DAY [TIME]]].
@@ -499,7 +520,7 @@ and for its predecessor organization, the European Communities.
.El
.Pp
.Bl -column -compact -offset indent "# Zone" "Europe/Zurich" "0:34:08" "RULES/SAVE" "FORMAT" "UNTIL"
-.It # Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
+.It # Zone NAME UTOFF RULES/SAVE FORMAT [UNTIL]
.It Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16
.It 0:29:44 - BMT 1894 Jun
.It 1:00 Swiss CE%sT 1981
@@ -510,7 +531,7 @@ and for its predecessor organization, the European Communities.
.It Link Europe/Zurich Europe/Vaduz
.El
.Pp
-In this example, the zone is named Europe/Zurich but it has an alias
+In this example, the timezone is named Europe/Zurich but it has an alias
as Europe/Vaduz.
This example says that Zurich was 34 minutes and 8
seconds east of UT until 1853-07-16 at 00:00, when the legal offset
@@ -518,8 +539,10 @@ was changed to 7\(de\|26\(fm\|22.50\(sd; although this works out to
0:29:45.50, the input format cannot represent fractional seconds so it
is rounded here.
After 1894-06-01 at 00:00 the UT offset became one hour
-and Swiss daylight saving rules (defined with lines beginning with "Rule
-Swiss") apply.
+and Swiss daylight saving rules (defined with lines beginning with
+.Dq "Rule Swiss"
+apply.
+From 1981 to the present, EU daylight saving rules have
From 1981 to the present, EU daylight saving rules have
.Pp
In 1941 and 1942, daylight saving time applied from the first Monday
@@ -531,12 +554,22 @@ saving has begun on the last Sunday in March at 01:00 UTC.
Until 1995 it ended the last Sunday in September at 01:00 UTC,
but this changed to the last Sunday in October starting in 1996.
.Pp
-For purposes of
-display, "LMT" and "BMT" were initially used, respectively.
+For purposes of display,
+.Dq LMT
+and
+.Dq BMT
+were initially used, respectively.
Since
-Swiss rules and later EU rules were applied, the display name for the
-time zone has been CET for standard time and CEST for daylight saving
+Swiss rules and later EU rules were applied, the time zone abbreviation
+has been CET for standard time and CEST for daylight saving
time.
+.Sh FILES
+.Bl -tag -width /usr/share/zoneinfo -compact
+.It Pa /etc/localtime
+Default local timezone file
+.It Pa /usr/share/zoneinfo
+Default timezone information directory
+.El
.Sh NOTES
For areas with more than two types of local time,
you may need to use local standard time in the
@@ -545,7 +578,7 @@ field of the earliest transition time's rule to ensure that
the earliest transition time recorded in the compiled file is correct.
.Pp
If,
-for a particular zone,
+for a particular timezone,
a clock advance caused by the start of daylight saving
coincides with and is equal to
a clock retreat caused by a change in UT offset,
@@ -555,20 +588,7 @@ produces a single transition to daylight saving at the new UT offset
To get separate transitions
use multiple zone continuation lines
specifying transition instants using universal time.
-.Pp
-Time stamps well before the Big Bang are silently omitted from the output.
-This works around bugs in software that mishandles large negative time stamps.
-Call it sour grapes, but pre-Big-Bang time stamps are physically suspect anyway.
-The pre-Big-Bang cutoff time is approximate and may change in future versions.
-.Sh FILES
-.Bl -tag -width /usr/share/zoneinfo -compact
-.It Pa /etc/localtime
-default local time zone file
-.It Pa /usr/share/zoneinfo
-standard directory used for created files
-.El
.Sh SEE ALSO
-.Xr ctime 3 ,
.Xr tzfile 5 ,
.Xr zdump 8
.\" @(#)zic.8 8.6