Merge 2018e

Changes to code

    zic now accepts subsecond precision in expressions like
    00:19:32.13, which is approximately the legal time of the
    Netherlands from 1835 to 1937.  However, because it is
    questionable whether the few recorded uses of non-integer offsets
    had subsecond precision in practice, there are no plans for tzdata
    to use this feature.  (Thanks to Steve Allen for pointing out
    the limitations of historical data in this area.)

    The code is a bit more portable to MS-Windows.  Installers can
    compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that
    reserve identifiers like 'localtime'.  (Thanks to Manuela
    Friedrich).

  Changes to documentation and commentary

    theory.html now outlines tzdb's extensions to POSIX's model for
    civil time, and has a section "POSIX features no longer needed"
    that lists POSIX API components that are now vestigial.
    (From suggestions by Steve Summit.)  It also better distinguishes
    time zones from tz regions.  (From a suggestion by Guy Harris.)

    Commentary is now more consistent about using the phrase "daylight
    saving time", to match the C name tm_isdst.  Daylight saving time
    need not occur in summer, and need not have a positive offset from
    standard time.

    Commentary about historical transitions in Uruguay has been expanded
    with links to many relevant legal documents.
    (Thanks to Tim Parenti.)

    Commentary now uses some non-ASCII characters with Unicode value
    less than U+0100, as they can be useful and should work even with
    older editors such as XEmacs.
This commit is contained in:
christos 2018-05-04 15:51:00 +00:00
parent ee08ce7d85
commit cfc8dcb49a
16 changed files with 1652 additions and 996 deletions

View File

@ -25,7 +25,8 @@ 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
repository. If you use Git the following workflow may be helpful:
repository. The latter is preferred. If you use Git the following
workflow may be helpful:
* Copy the development repository.
@ -42,6 +43,12 @@ repository. If you use Git the following workflow may be helpful:
git checkout -b mybranch
* Sleuth by using 'git blame'. For example, when fixing data for
Africa/Sao_Tome, if the command 'git blame africa' outputs a line
'2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should
provide some justification for the 'Zone Africa/Sao_Tome' line.
* Edit source files. Include commentary that justifies the
changes by citing reliable sources.
@ -67,6 +74,9 @@ repository. If you use Git the following workflow may be helpful:
git send-email master
For an archived example of such an email, see
<https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
* Start anew by getting current with the master branch again
(the second step above).

View File

@ -10,9 +10,18 @@ VERSION= unknown
# Email address for bug reports.
BUGEMAIL= tz@iana.org
# Choose source data features. To get new features right away, use:
# DATAFORM= vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
# DATAFORM= main
# To wait even longer for new features, use:
# 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).
# Alternately, if you discover you've got the wrong time zone, you can just
# Alternatively, if you discover you've got the wrong time zone, you can just
# zic -l rightzone
# to correct things.
# Use the command
@ -25,11 +34,11 @@ LOCALTIME= GMT
# 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).
# (When a POSIX-style environment variable is handled, the rules in the
# 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
# summer time.)
# Alternately, if you discover you've got the wrong time zone, you can just
# daylight saving time.
# Alternatively, if you discover you've got the wrong time zone, you can just
# zic -p rightzone
# to correct things.
# Use the command
@ -189,13 +198,18 @@ LDLIBS=
# -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
# -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
# -DHAVE_STRDUP=0 if your system lacks the strdup function
# -DHAVE_STRTOLL=0 if your system lacks the strtoll function
# -DHAVE_SYMLINK=0 if your system lacks the symlink function
# -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
# -DHAVE_TZSET=0 if your system lacks a tzset function
# -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
# -Dlocale_t=XXX if your system uses XXX instead of locale_t
# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
# with external linkage, e.g., applications cannot define 'localtime'.
# -Dssize_t=long on hosts like MS-Windows that lack ssize_t
# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
# security implications and is not recommended for general use
# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
# not needed by the main-program tz code, which is single-threaded.
# Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
@ -222,14 +236,16 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
$(GCC_INSTRUMENT) \
-Wall -Wextra \
-Walloc-size-larger-than=100000 -Warray-bounds=2 \
-Wbad-function-cast -Wcast-align -Wdate-time \
-Wbad-function-cast -Wcast-align=strict -Wdate-time \
-Wdeclaration-after-statement -Wdouble-promotion \
-Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
-Winit-self -Wjump-misses-init -Wlogical-op \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wold-style-definition -Woverlength-strings -Wpointer-arith \
-Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=5 \
-Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
-Wstringop-truncation -Wsuggest-attribute=cold \
-Wsuggest-attribute=const -Wsuggest-attribute=format \
-Wsuggest-attribute=malloc \
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
-Wtrampolines -Wundef -Wuninitialized -Wunused \
-Wvariadic-macros -Wvla -Wwrite-strings \
@ -394,13 +410,19 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]'
# 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= °±½¾×
# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that multibyte letters are
# also allowed so that commentary can contain people's names and quote
# non-English sources. For non-letters the sources are limited to
# ASCII renderings for the convenience of maintainers whose text editors
# mishandle UTF-8 by default (e.g., XEmacs 21.4.22).
OK_CHAR= '[][:alpha:]'$(SAFE_CHARSET)'-]'
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
# few safe symbols and people's names and can quote non-English sources.
# Other non-letters are limited to ASCII renderings for the
# convenience of maintainers using XEmacs 21.5.34, which by default
# mishandles Unicode characters U+0100 and greater.
OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'
# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
@ -462,10 +484,12 @@ TDATA= $(YDATA) $(NDATA) $(BACKWARD)
ZONETABLES= zone1970.tab zone.tab
TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS= leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS= zishrink.awk version $(TDATA) $(PACKRATDATA)
TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
leapseconds yearistype.sh $(ZONETABLES)
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk zishrink.awk
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
ziguard.awk zishrink.awk
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
TZS_YEAR= 2050
TZS= to$(TZS_YEAR).tzs
@ -492,6 +516,7 @@ VERSION_DEPS= \
tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
workman.sh yearistype.sh \
zdump.8 zdump.c zic.8 zic.c \
ziguard.awk zishrink.awk \
zone.tab zone1970.tab zoneinfo2tdf.pl
# And for the benefit of csh users on systems that assume the user
@ -499,7 +524,8 @@ VERSION_DEPS= \
SHELL= /bin/sh
all: tzselect yearistype zic zdump libtz.a $(TABDATA)
all: tzselect yearistype zic zdump libtz.a $(TABDATA) \
vanguard.zi main.zi rearguard.zi
ALL: all date $(ENCHILADA)
@ -534,11 +560,15 @@ version: $(VERSION_DEPS)
printf '%s\n' "$$V" >$@.out
mv $@.out $@
# This file can be tailored by setting BACKWARD, PACKRATDATA, etc.
tzdata.zi: $(TZDATA_ZI_DEPS)
# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
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
version=`sed 1q version` && \
LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
$(TDATA) $(PACKRATDATA) >$@.out
$(DATAFORM).zi >$@.out
mv $@.out $@
version.h: version
@ -614,19 +644,29 @@ posix_packrat:
zones: $(REDO)
# dummy.zd is not a real file; it is mentioned here only so that the
# top-level 'make' does not have a syntax error.
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
mkdir -p tzs.dir
rm -fr tzs.dir
mkdir tzs.dir
$(zic) -d tzs.dir tzdata.zi
$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
tzdata.zi | LC_ALL=C sort >$@.out
wd=`pwd` && \
zones=`$(AWK) -v wd="$$wd" \
'/^Z/{print wd "/tzs.dir/" $$2}' tzdata.zi \
| LC_ALL=C sort` && \
./zdump -i -c $(TZS_YEAR) $$zones >>$@.out
sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@.sed.out
rm -fr tzs.dir $@.out
mv $@.sed.out $@
set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
| LC_ALL=C sort -t . -k 2,2` && \
shift && \
ZDS=$$* && \
$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out
rm -fr tzs.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
@ -669,8 +709,10 @@ check_character_set: $(ENCHILADA)
sharp='#' && \
! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
$(MISC) $(SOURCES) $(WEB_PAGES) \
CONTRIBUTING LICENSE Makefile README \
CONTRIBUTING LICENSE README \
version tzdata.zi && \
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
Makefile && \
! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
leapseconds yearistype.sh zone.tab && \
! grep -Env $(OK_LINE) $(ENCHILADA); \
@ -702,7 +744,7 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
LC_ALL=C sort -cu
check_links: checklinks.awk $(TDATA_TO_CHECK)
check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
$(AWK) -f checklinks.awk tzdata.zi
@ -720,17 +762,26 @@ check_tzs: $(TZS) $(TZS_NEW)
check_web: tz-how-to.html
$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
# Check that tzdata.zi generates the same binary data that its sources do.
check_zishrink: tzdata.zi zic leapseconds $(PACKRATDATA) $(TDATA)
# 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-shrunk && \
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 $(TDATA) && \
$(AWK) '/^Rule/' $(TDATA) | \
$(ZIC) $$leap -d time_t.dir/$$type - $(PACKRATDATA) && \
$(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
case $(DATAFORM) in \
main) \
$(ZIC) $$leap -d time_t.dir/$$type-t $(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
@ -740,7 +791,7 @@ clean_misc:
rm -f core *.o *.out \
date tzselect version.h zdump zic yearistype libtz.a
clean: clean_misc
rm -fr *.dir tzdata.zi tzdb-*/ $(TZS_NEW)
rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
maintainer-clean: clean
@echo 'This command is intended for maintainers to use; it'
@ -852,16 +903,27 @@ check_time_t_alternatives:
done
rm -fr time_t.dir
TRADITIONAL_ASC = \
tzcode$(VERSION).tar.gz.asc \
tzdata$(VERSION).tar.gz.asc
ALL_ASC = $(TRADITIONAL_ASC) \
tzdata$(VERSION)-rearguard.tar.gz.asc \
tzdb-$(VERSION).tar.lz.asc
tarballs traditional_tarballs signatures traditional_signatures: version
VERSION=`cat version` && \
$(MAKE) VERSION="$$VERSION" $@_version
tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
# 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 \
tzdb-$(VERSION).tar.lz
traditional_tarballs_version: \
tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
signatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc
traditional_signatures_version: \
tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \
signatures_version: $(ALL_ASC)
traditional_signatures_version: $(TRADITIONAL_ASC)
tzcode$(VERSION).tar.gz: set-timestamps.out
LC_ALL=C && export LC_ALL && \
@ -876,6 +938,26 @@ tzdata$(VERSION).tar.gz: set-timestamps.out
gzip $(GZIPFLAGS) >$@.out
mv $@.out $@
tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
rm -fr tzdata$(VERSION)-rearguard.dir
mkdir tzdata$(VERSION)-rearguard.dir
ln $(COMMON) $(DATA) $(MISC) tzdata$(VERSION)-rearguard.dir
cd tzdata$(VERSION)-rearguard.dir && \
rm -f $(TDATA) $(PACKRATDATA) version
for f in $(TDATA) $(PACKRATDATA); do \
rearf=tzdata$(VERSION)-rearguard.dir/$$f; \
$(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \
touch -cmr `ls -t ziguard.awk $$f` $$rearf || exit; \
done
sed '1s/$$/-rearguard/' \
<version >tzdata$(VERSION)-rearguard.dir/version
touch -cmr version tzdata$(VERSION)-rearguard.dir/version
LC_ALL=C && export LC_ALL && \
(cd tzdata$(VERSION)-rearguard.dir && \
tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
gzip $(GZIPFLAGS)) >$@.out
mv $@.out $@
tzdb-$(VERSION).tar.lz: set-timestamps.out
rm -fr tzdb-$(VERSION)
mkdir tzdb-$(VERSION)
@ -886,12 +968,10 @@ tzdb-$(VERSION).tar.lz: set-timestamps.out
mv $@.out $@
tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
gpg --armor --detach-sign $?
tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
gpg --armor --detach-sign $?
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:
@ -917,13 +997,17 @@ zic.o: private.h tzfile.h version.h
.KEEP_STATE:
.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_links
.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_zishrink
.PHONY: clean clean_misc force_tzs
.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: tarballs tarballs_version typecheck
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
.PHONY: typecheck
.PHONY: zonenames zones
.PHONY: $(ZDS)

View File

@ -1,9 +1,210 @@
News for the tz database
Release 2018e - 2018-05-01 23:42:51 -0700
Briefly:
North Korea switches back to +09 on 2018-05-05.
The main format uses negative DST again, for Ireland etc.
'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
North Korea switches back from +0830 to +09 on 2018-05-05.
(Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon,
and Tim Parenti.)
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
former Czechoslovakia, not just Ireland. The main format now uses
negative DST to model time stamps 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
formats; effectively the main format now uses vanguard instead of
rearguard format. Data parsers that do not support negative DST
can still use data from the rearguard tarball described below.
Changes to build procedure
The command 'make tarballs' now also builds the tarball
tzdataVERSION-rearguard.tar.gz, which is like tzdataVERSION.tar.gz
except that it uses rearguard format intended for trailing-edge
data parsers.
Changes to data format and to code
The SAVE column of Rule and Zone lines can now have an 's' or 'd'
suffix, which specifies whether the adjusted time is standard time
or daylight saving time. If no suffix is given, daylight saving
time is used if and only if the SAVE column is nonzero; this is
the longstanding behavior. Although this new feature is not used
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
From 1994 through 2017 Namibia observed DST in winter, not summer.
That is, it used negative DST, as Ireland still does. This change
does not affect UTC offsets; it affects only the tm_isdst flag and
the abbreviation used during summer, which is now CAT, not WAST.
Although (as noted by Michael Deckers) summer and winter time were
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
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
daylight saving. Also, the dates of some 1944/5 DST transitions
in Czechoslovakia have been changed.
Release 2018d - 2018-03-22 07:05:46 -0700
Briefly:
Palestine starts DST a week earlier in 2018.
Add support for vanguard and rearguard data consumers.
Add subsecond precision to source data format, though not to data.
Changes to future time stamps
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
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
Historical transitions for Uruguay, represented by
America/Montevideo, have been updated per official legal documents,
replacing previous data mainly originating from the inventions of
Shanks & Pottenger. This has resulted in adjustments ranging from
30 to 90 minutes in either direction over at least two dozen
distinct periods ranging from one day to several years in length.
A mere handful of pre-1991 transitions are unaffected; data since
then has come from more reliable contemporaneous reporting. These
changes affect various timestamps in 1920-1923, 1936, 1939,
1942-1943, 1959, 1966-1970, 1972, 1974-1980, and 1988-1990.
Additionally, Uruguay's pre-standard-time UT offset has been
adjusted westward by 7 seconds, from UT-03:44:44 to UT-03:44:51, to
match the location of the Observatory of the National Meteorological
Institute in Montevideo.
(Thanks to Jeremie Bonjour, Tim Parenti, and Michael Deckers.)
Enderbury and Kiritimati skipped New Year's Eve 1994, not
New Year's Day 1995. (Thanks to Kerry Shetline.)
Fix the 1912-01-01 transition for Portugal and its colonies.
This transition was at 00:00 according to the new UT offset, not
according to the old one. Also assume that Cape Verde switched on
the same date as the rest, not in 1907. This affects
Africa/Bissau, Africa/Sao_Tome, Asia/Macau, Atlantic/Azores,
Atlantic/Cape_Verde, Atlantic/Madeira, and Europe/Lisbon.
(Thanks to Michael Deckers.)
Fix an off-by-1 error for pre-1913 timestamps in Jamaica and in
Turks & Caicos.
Changes to past time zone abbreviations
MMT took effect in Uruguay from 1908-06-10, not 1898-06-28. There
is no clock change associated with the transition.
Changes to build procedure
The new DATAFORM macro in the Makefile lets the installer choose
among three source data formats. The idea is to lessen downstream
disruption when data formats are improved.
* DATAFORM=vanguard installs from the latest, bleeding-edge
format. DATAFORM=main (the default) installs from the format
used in the 'africa' etc. files. DATAFORM=rearguard installs
from a trailing-edge format. Eventually, elements of today's
vanguard format should move to the main format, and similarly
the main format's features should eventually move to the
rearguard format.
* In the current version, the main and rearguard formats are
identical and match that of 2018c, so this change does not
affect default behavior. The vanguard format currently contains
one feature not in the main format: negative SAVE values. This
improves support for Ireland, which uses Irish Standard Time
(IST, UTC+01) in summer and GMT (UTC) in winter. tzcode has
supported negative SAVE values for decades, and this feature
should move to the main format soon. However, it will not move
to the rearguard format for quite some time because some
downstream parsers do not support it.
* The build procedure constructs three files vanguard.zi, main.zi,
and rearguard.zi, one for each format. The files represent the
same data as closely as the formats allow. These three files
are intended for downstream data consumers and are not
installed. Zoneinfo parsers that do not support negative SAVE values
should start using rearguard.zi, so that they will be unaffected
when the negative-DST feature moves from vanguard to main.
Bleeding-edge Zoneinfo parsers that support the new features
already can use vanguard.zi; in this respect, current tzcode is
bleeding-edge.
The Makefile should now be safe for parallelized builds, and 'make
-j to2050new.tzs' is now much faster on a multiprocessor host
with GNU Make.
When built with -DSUPPRESS_TZDIR, the tzcode library no longer
prepends TZDIR/ to file names that do not begin with '/'. This is
not recommended for general use, due to its security implications.
(From a suggestion by Manuela Friedrich.)
Changes to code
zic now accepts subsecond precision in expressions like
00:19:32.13, which is approximately the legal time of the
Netherlands from 1835 to 1937. However, because it is
questionable whether the few recorded uses of non-integer offsets
had subsecond precision in practice, there are no plans for tzdata
to use this feature. (Thanks to Steve Allen for pointing out
the limitations of historical data in this area.)
The code is a bit more portable to MS-Windows. Installers can
compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that
reserve identifiers like 'localtime'. (Thanks to Manuela
Friedrich).
Changes to documentation and commentary
theory.html now outlines tzdb's extensions to POSIX's model for
civil time, and has a section "POSIX features no longer needed"
that lists POSIX API components that are now vestigial.
(From suggestions by Steve Summit.) It also better distinguishes
time zones from tz regions. (From a suggestion by Guy Harris.)
Commentary is now more consistent about using the phrase "daylight
saving time", to match the C name tm_isdst. Daylight saving time
need not occur in summer, and need not have a positive offset from
standard time.
Commentary about historical transitions in Uruguay has been expanded
with links to many relevant legal documents.
(Thanks to Tim Parenti.)
Commentary now uses some non-ASCII characters with Unicode value
less than U+0100, as they can be useful and should work even with
older editors such as XEmacs.
Release 2018c - 2018-01-22 23:00:44 -0800
Briefly:
Revert Irish changes that relied on negative DST offsets.
Revert Irish changes that relied on negative SAVE values.
Changes to tm_isdst
@ -14,8 +215,8 @@ Release 2018c - 2018-01-22 23:00:44 -0800
struct tm type. This reversion is intended to be a temporary
workaround for problems discovered with downstream uses of
releases 2018a and 2018b, which implemented Irish time by using
negative DST offsets in the Eire rules of the 'europe' file.
Although negative DST offsets have been part of tzcode for many
negative SAVE values in the Eire rules of the 'europe' file.
Although negative SAVE values have been part of tzcode for many
years and are supported by many platforms, they were not
documented before 2018a and ICU and OpenJDK do not currently
support them. A mechanism to export data to platforms lacking
@ -900,7 +1101,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
Comments in zone tables have been improved. (Thanks to J William Piggott.)
tzselect again limits its menu comments so that menus fit on a
24x80 alphanumeric display.
24×80 alphanumeric display.
A new web page tz-how-to.html. (Thanks to Bill Seymour.)

View File

@ -1,4 +1,6 @@
/* $NetBSD: asctime.c,v 1.24 2018/01/07 21:19:35 kamil Exp $ */
/* $NetBSD: asctime.c,v 1.25 2018/05/04 15:51:00 christos Exp $ */
/* asctime and asctime_r a la POSIX and ISO C, except pad years before 1000. */
/*
** This file is in the public domain, so clarified as of
@ -16,7 +18,7 @@
#if 0
static char elsieid[] = "@(#)asctime.c 8.5";
#else
__RCSID("$NetBSD: asctime.c,v 1.24 2018/01/07 21:19:35 kamil Exp $");
__RCSID("$NetBSD: asctime.c,v 1.25 2018/05/04 15:51:00 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -45,7 +47,7 @@ __weak_alias(asctime_r,_asctime_r)
** leading zeroes to get the newline in the traditional place.
** The -4 ensures that we get four characters of output even if
** we call a strftime variant that produces fewer characters for some years.
** The ISO C 1999 and POSIX 1003.1-2004 standards prohibit padding the year,
** The ISO C and POSIX standards prohibit padding the year,
** but many implementations pad anyway; most likely the standards are buggy.
*/
#ifdef __GNUC__
@ -80,10 +82,6 @@ __weak_alias(asctime_r,_asctime_r)
static char buf_asctime[MAX_ASCTIME_BUF_SIZE];
/*
** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, 2004 Edition.
*/
char *
asctime_r(const struct tm *timeptr, char *buf)
{
@ -131,10 +129,6 @@ asctime_r(const struct tm *timeptr, char *buf)
}
}
/*
** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, 2004 Edition.
*/
char *
asctime(const struct tm *timeptr)
{

View File

@ -1,8 +1,8 @@
.\" $NetBSD: ctime.3,v 1.58 2018/02/11 13:28:26 wiz Exp $
.\" $NetBSD: ctime.3,v 1.59 2018/05/04 15:51:00 christos Exp $
.\"
.\" XXX: License missing?
.\"
.Dd February 7, 2018
.Dd May 5, 2018
.Dt CTIME 3
.Os
.Sh NAME
@ -258,15 +258,15 @@ to their normal ranges.
.Fa tm_isdst
causes
.Fn mktime
to presume initially that summer time (for example, Daylight Saving Time
in the U.S.A.) respectively,
to presume initially that daylight saving time
respectively,
is or is not in effect for the specified time.
.It
A negative value for
.Fa tm_isdst
causes the
.Fn mktime
function to attempt to divine whether summer time is in effect
function to attempt to divine whether daylight saving time is in effect
for the specified time; in this case it does not use a consistent
rule and may give a different answer when later
presented with the same argument.
@ -334,13 +334,14 @@ includes the following fields:
int tm_wday; /* day of week (Sunday = 0) */
int tm_yday; /* day of year (0 - 365) */
int tm_isdst; /* is summer time in effect? */
int tm_isdst; /* is daylight saving time in effect? */
char *tm_zone; /* abbreviation of timezone name (optional) */
long tm_gmtoff; /* offset from UT in seconds (optional) */
.Ed
.Bl -bullet
.It
.Va tm_isdst
is non-zero if summer time is in effect.
is non-zero if daylight saving time is in effect.
.It
.Va tm_gmtoff
is the offset (in seconds) of the time represented from UT,

View File

@ -1,4 +1,4 @@
/* $NetBSD: localtime.c,v 1.111 2018/01/25 22:48:42 christos Exp $ */
/* $NetBSD: localtime.c,v 1.112 2018/05/04 15:51:00 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
@ -10,7 +10,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 8.17";
#else
__RCSID("$NetBSD: localtime.c,v 1.111 2018/01/25 22:48:42 christos Exp $");
__RCSID("$NetBSD: localtime.c,v 1.112 2018/05/04 15:51:00 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -95,9 +95,8 @@ static const char gmt[] = "GMT";
/*
** The DST rules to use if TZ has no rules and we can't load TZDEFRULES.
** Default to US rules as of 2017-05-07.
** POSIX 1003.1 section 8.1.1 says that the default DST rules are
** implementation dependent; for historical reasons, US rules are a
** common default.
** POSIX does not specify the default DST rules;
** for historical reasons, US rules are a common default.
*/
#ifndef TZDEFRULESTRING
#define TZDEFRULESTRING ",M3.2.0,M11.1.0"
@ -448,7 +447,13 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
if (name[0] == ':')
++name;
#ifdef SUPPRESS_TZDIR
/* Do not prepend TZDIR. This is intended for specialized
applications only, due to its security implications. */
doaccess = true;
#else
doaccess = name[0] == '/';
#endif
if (!doaccess) {
size_t namelen = strlen(name);
if (sizeof lsp->fullname - sizeof tzdirslash <= namelen)
@ -1277,12 +1282,13 @@ tzparse(const char *name, struct state *sp, bool lastditch)
/* No adjustment to transition time */
} else {
/*
** If summer time is in effect, and the
** transition time was not specified as
** standard time, add the summer time
** offset to the transition time;
** otherwise, add the standard time
** offset to the transition time.
** If daylight saving time is in
** effect, and the transition time was
** not specified as standard time, add
** the daylight saving time offset to
** the transition time; otherwise, add
** the standard time offset to the
** transition time.
*/
/*
** Transitions from DST to DDST
@ -2361,7 +2367,7 @@ timeoff(struct tm *tmp, long offset)
#ifdef STD_INSPIRED
/*
** IEEE Std 1003.1-1988 (POSIX) legislates that 536457599
** IEEE Std 1003.1 (POSIX) says that 536457599
** shall correspond to "Wed Dec 31 23:59:59 UTC 1986", which
** is not the case if we are accounting for leap seconds.
** So, we provide the following conversion routines for use

View File

@ -1,4 +1,4 @@
/* $NetBSD: private.h,v 1.51 2017/10/24 17:38:17 christos Exp $ */
/* $NetBSD: private.h,v 1.52 2018/05/04 15:51:00 christos Exp $ */
#ifndef PRIVATE_H
#define PRIVATE_H
@ -27,6 +27,16 @@
** Thank you!
*/
/*
** zdump has been made independent of the rest of the time
** conversion package to increase confidence in the verification it provides.
** You can use zdump to help in verifying other implementations.
** To do this, compile with -DUSE_LTZ=0 and link without the tz library.
*/
#ifndef USE_LTZ
# define USE_LTZ 1
#endif
/* This string was in the Factory zone through version 2016f. */
#define GRANDPARENTED "Local time zone must be set--see zic manual page"
@ -78,6 +88,10 @@
#define HAVE_STRDUP 1
#endif
#ifndef HAVE_STRTOLL
#define HAVE_STRTOLL 1
#endif
#ifndef HAVE_SYMLINK
#define HAVE_SYMLINK 1
#endif /* !defined HAVE_SYMLINK */
@ -282,15 +296,19 @@ typedef int int_fast32_t;
#ifndef INTMAX_MAX
# ifdef LLONG_MAX
typedef long long intmax_t;
# define strtoimax strtoll
# if HAVE_STRTOLL
# define strtoimax strtoll
# endif
# define INTMAX_MAX LLONG_MAX
# define INTMAX_MIN LLONG_MIN
# else
typedef long intmax_t;
# define strtoimax strtol
# define INTMAX_MAX LONG_MAX
# define INTMAX_MIN LONG_MIN
# endif
# ifndef strtoimax
# define strtoimax strtol
# endif
#endif
#ifndef PRIdMAX
@ -340,12 +358,14 @@ typedef unsigned long uintmax_t;
#define SIZE_MAX ((size_t) -1)
#endif
#if 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#if 3 <= __GNUC__
# define ATTRIBUTE_CONST __attribute__ ((__const__))
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
# define ATTRIBUTE_PURE __attribute__ ((__pure__))
# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
#else
# define ATTRIBUTE_CONST /* empty */
# define ATTRIBUTE_MALLOC /* empty */
# define ATTRIBUTE_PURE /* empty */
# define ATTRIBUTE_FORMAT(spec) /* empty */
#endif
@ -372,6 +392,16 @@ typedef unsigned long uintmax_t;
#ifndef EPOCH_OFFSET
# define EPOCH_OFFSET 0
#endif
#ifndef RESERVE_STD_EXT_IDS
# define RESERVE_STD_EXT_IDS 0
#endif
/* If standard C identifiers with external linkage (e.g., localtime)
are reserved and are not already being renamed anyway, rename them
as if compiling with '-Dtime_tz=time_t'. */
#if !defined time_tz && RESERVE_STD_EXT_IDS && USE_LTZ
# define time_tz time_t
#endif
/*
** Compile with -Dtime_tz=T to build the tz package with a private

View File

@ -1,4 +1,4 @@
/* $NetBSD: strftime.c,v 1.40 2017/10/24 17:38:17 christos Exp $ */
/* $NetBSD: strftime.c,v 1.41 2018/05/04 15:51:00 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.40 2017/10/24 17:38:17 christos Exp $");
__RCSID("$NetBSD: strftime.c,v 1.41 2018/05/04 15:51:00 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -213,7 +213,7 @@ label:
** %Ec %EC %Ex %EX %Ey %EY
** %Od %oe %OH %OI %Om %OM
** %OS %Ou %OU %OV %Ow %OW %Oy
** are supposed to provide alternate
** are supposed to provide alternative
** representations.
*/
goto label;

File diff suppressed because it is too large Load Diff

View File

@ -81,19 +81,19 @@ doing so got a crook trying to be declared dead to
emerge a bit too early from the titular enclosure.
</li>
<li>
The 1960s ITC television series <em>The Prisoner</em> included an episode
entitled "The Chimes of Big Ben" in which our protagonist tumbled to
"The Chimes of Big Ben", <em>The Prisoner</em>, episode 2, ITC, 1967-10-06.
Our protagonist tumbles to
the fraudulent nature of a Poland-to-England escape upon hearing "Big
Ben" chiming on Polish local time.
</li>
<li>
The series <em>Seinfeld</em> included an episode entitled "The Susie," first
broadcast 1997-02-13, in which Kramer decides that daylight saving time
"The Susie", <em>Seinfeld</em>, season 8, episode 15, NBC, 1997-02-13.
Kramer decides that daylight saving time
isn't coming fast enough, so he sets his watch ahead an hour.
</li>
<li>
The "20 Hours in America" episode of <em>The West Wing</em>,
first aired 2002-09-25, contained a <a
"20 Hours in America", <em>The West Wing</em>, season 4, episodes 1&ndash;2,
2002-09-25, contained a <a
href="https://www.youtube.com/watch?v=-J1NHzQ1sgc">scene</a> that
saw White House staffers stranded in Indiana; they thought they had time to
catch Air Force One but were done in by intra-Indiana local time changes.
@ -144,6 +144,9 @@ hinges on whether or not Russia observes daylight saving time.
"The Lost Hour", <em>Eerie, Indiana</em>, episode 10, NBC, 1991-12-01.
Despite Indiana's then-lack of DST, Marshall changes his clock with
unusual consequences.
See "<a
href="https://www.avclub.com/eerie-indiana-was-a-few-dimensions-ahead-of-its-time-1819833380"><em>Eerie,
Indiana</em> was a few dimensions ahead of its time</a>".
</li>
<li>
"Time Tunnel", <em>The Adventures of Pete &amp; Pete</em>, season 2, episode 5,
@ -162,6 +165,11 @@ CBS, 2016-01-17.
The applicability of a contract hinges on the
time zone associated with a video timestamp.
</li>
<li>
"Justice", <em>Veep</em>, season 6, episode 4, HBO, 2017-05-07.
Jonah's inability to understand DST ends up impressing a wealthy
backer who sets him up for a 2020 presidential run.
</li>
</ul>
<h2>Books, plays, and magazines</h2>
<ul>
@ -423,7 +431,7 @@ Supernaw.</td></tr>
<tr><td>ADO Rating</td><td>1.5 stars</td></tr>
<tr><td>Notes<td>The title song is also available on "Bob Dylan's Greatest Hits" and "The Essential Bob Dylan."</td></tr>
<tr><td>&nbsp;</td><td></td></tr>
<tr><td>Artist</td><td>Luciana Souza</td></tr>
<tr><td>CD</td><td>Tide</td></tr>
<tr><td>Copyright Date</td><td>2009</td></tr>
@ -488,6 +496,22 @@ it's already tomorrow in Australia!"
<h2>Jokes</h2>
<ul>
<li>
The idea behind daylight saving time was first proposed as a joke by
Benjamin Franklin. To enforce it, he suggested, "Every
morning, as soon as the sun rises, let all the bells in every church
be set ringing; and if that is not sufficient, let cannon be fired in
every street, to wake the sluggards effectually, and make them open
their eyes to see their true interest. All the difficulty will be in
the first two or three days: after which the reformation will be as
natural and easy as the present irregularity; for, <em>ce n'est que le
premier pas qui co&ucirc;te</em>."
<a href="http://www.webexhibits.org/daylightsaving/franklin3.html">Franklin's
joke</a> was first published on 1784-04-26 by the
<em>Journal de Paris</em> as <a
href="https://en.wikipedia.org/wiki/File:Franklin-Benjamin-Journal-de-Paris-1784.jpg">an
anonymous letter translated into French</a>.
</li>
<li>
"We've been using the five-cent nickel in this country since 1492.
Now that's pretty near 100 years, daylight saving."
(Groucho Marx as Captain Spaulding in <em>Animal Crackers</em>, 1930,
@ -571,7 +595,7 @@ but maybe in your time zone I haven't finished yet. So stay tuned!"
</ul>
<h2>See also</h2>
<ul>
<li><a href="tz-link.htm">Sources for Time Zone and Daylight Saving
<li><a href="tz-link.html">Sources for Time Zone and Daylight Saving
Time Data</a></li>
</ul>
<hr>

View File

@ -7,7 +7,9 @@
<body>
<h1>Sources for time zone and daylight saving time data</h1>
<p>
Time zone and daylight saving rules are controlled by individual
<a href="https://en.wikipedia.org/wiki/Time_zone">Time zone</a> and
<a href="https://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a>
rules are controlled by individual
governments. They are sometimes changed with little notice, and their
histories and planned futures are often recorded only fitfully. Here
is a summary of attempts to organize and record relevant data in this
@ -20,12 +22,9 @@ time zone database 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 <a href="https://en.wikipedia.org/wiki/Time_zone">time zone</a>
boundaries and
<a href="https://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a>
rules.
This database (often called <code>zoneinfo</code> or
<code><abbr>tz</abbr></code>)
to time zone boundaries and daylight saving rules.
This database (known as <code><abbr>tz</abbr></code>,
<code><abbr>tzdb</abbr></code>, or <code>zoneinfo</code>)
is used by several implementations,
including
<a href="https://www.gnu.org/software/libc/">the
@ -109,7 +108,7 @@ gzip -dc tzdata-latest.tar.gz | tar -xf -
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>
<a href="http://www.nongnu.org/lzip/">lzip</a> -dc tzdb-latest.tar.lz | tar -xf -
<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
of the <code><abbr>tz</abbr></code> database hosted by the
@ -130,7 +129,7 @@ Since version 2016h, each release has contained a text file named
The releases are also available in an
<a href="ftp://ftp.iana.org/tz/releases/"><abbr
title="File Transfer Protocol">FTP</abbr> directory</a> via a
less-secure protocol .</p>
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>
@ -182,6 +181,8 @@ data yourself. System-specific instructions for installing the
latest <code><abbr>tz</abbr></code> data have also been published
for <a href="https://www.ibm.com/developerworks/aix/library/au-aix-olson-time-zone/index.html"><abbr>AIX</abbr></a>,
<a
href="https://play.google.com/store/apps/details?id=com.google.android.timezone.data">Android</a>,
<a
href="http://userguide.icu-project.org/datetime/timezone"><abbr
title="International Components for Unicode">ICU</abbr></a>,
<a href="https://developer.ibm.com/javasdk/support/dst/jtzu/"><abbr>IBM</abbr></a>
@ -190,7 +191,7 @@ href="http://www.oracle.com/technetwork/java/javase/tzupdater-readme-136440.html
Java, <a href="http://www.joda.org/joda-time/tz_update.html">Joda-Time</a>, <a
href="https://dev.mysql.com/doc/refman/en/time-zone-support.html">MySQL</a>,
and <a
href="http://nodatime.org/userguide/tzdb">Noda Time</a> (see below).
href="https://nodatime.org/userguide/tzdb">Noda Time</a> (see below).
</p>
<p>Sources for the <code><abbr>tz</abbr></code> database are
<a href="https://en.wikipedia.org/wiki/UTF-8"><abbr
@ -201,7 +202,7 @@ title="linefeed">LF</abbr></a>,
which can be modified by common text editors such
as <a href="https://www.gnu.org/software/emacs/">GNU Emacs</a>,
<a href="https://wiki.gnome.org/Apps/Gedit">gedit</a>, and
<a href="http://www.vim.org">vim</a>.
<a href="https://www.vim.org">vim</a>.
Specialized source-file editing can be done via the
<a href="https://packagecontrol.io/packages/zoneinfo">Sublime
zoneinfo</a> package for <a
@ -237,9 +238,11 @@ These are listed roughly in ascending order of complexity and fanciness.
</p>
<ul>
<li><a href="https://time.is">Time.is</a> shows locations'
time and zones in a simple format.</li>
<li><a href="https://www.timejones.com">TimeJones.com</a> is a simple
time zone converter.</li>
time and zones.</li>
<li><a href="https://www.timejones.com">TimeJones.com</a>,
<a href="https://timezoneconverterapp.com">Time Zone Converter</a> and
<a href="http://worldclock.com">The World Clock</a>
are time zone converters.</li>
<li><a
href="http://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a>
lets you see the <code><abbr>TZ</abbr></code> values directly.</li>
@ -253,10 +256,12 @@ uses a pulldown menu.</li>
timezone information for all countries</a> displays tables of DST rules.
<li><a href="https://www.timeanddate.com/worldclock/">The World Clock &ndash;
Worldwide</a> lets you sort zone names and convert times.</li>
<li><a href="http://www.zeitverschiebung.net/en/">Time Difference</a>
<li><a href="https://24timezones.com">24TimeZones</a> has a world
time map and a time converter.</li>
<li><a href="https://www.zeitverschiebung.net/en/">Time Difference</a>
calculates the current time difference between locations.</li>
<li><a href="http://www.wx-now.com">Weather Now</a> lists the weather too.</li>
<li><a href="http://www.thetimenow.com">The Time Now</a> also lists weather.</li>
<li><a href="http://www.wx-now.com">Weather Now</a> and
<a href="http://www.thetimenow.com">The Time Now</a> list the weather too.</li>
</ul>
<h2 id="protocols">Network protocols for <code><abbr>tz</abbr></code> data</h2>
<ul>
@ -267,10 +272,10 @@ href="https://tools.ietf.org/html/rfc7808">TZDIST</a>
(Internet <abbr>RFC</abbr> 7808), a time zone data distribution service,
along with <a href="https://tools.ietf.org/html/rfc7809">CalDAV</a>
(Internet <abbr>RFC</abbr> 7809), a calendar access protocol for
transferring time zone data by reference. The (expired) draft <a
transferring time zone data by reference. The draft <a
id="TZDIST-Geolocate"
href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-00">TZDIST
Geolocate Extension</a> would have let a client determine its time zone region
href="https://tools.ietf.org/html/draft-murchison-tzdist-geolocate-01">TZDIST
Geolocate Extension</a> lets a client determine its time zone region
from its geographic location using a <a
href="https://tools.ietf.org/html/rfc5870">'geo' URI</a>.</li>
<li>The <a href="https://tools.ietf.org/html/rfc5545">
@ -285,7 +290,7 @@ variant <a href="https://tools.ietf.org/html/rfc6321">xCal</a>
title="Extensible Markup Language">XML</abbr></a> format, and a variant
<a href="https://tools.ietf.org/html/rfc7265">jCal</a>
(Internet <abbr>RFC</abbr> 7265)
uses <a href="http://www.json.org"><abbr
uses <a href="https://www.json.org"><abbr
title="JavaScript Object Notation">JSON</abbr></a> format.</li>
</ul>
<h2 id="compilers">Other <code><abbr>tz</abbr></code> compilers</h2>
@ -316,9 +321,15 @@ transition in the <code><abbr>tz</abbr></code> database.</li>
<li>The <a href="https://howardhinnant.github.io/date/tz.html">Time Zone
Database Parser</a> is a
<a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a> parser and
runtime library. It is freely available under the
<a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons
Attribution 4.0 International Public License</a>.</li>
runtime library that is <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0355r4.html">moving
forward</a> for inclusion in the next iteration of <a
href="https://isocpp.org/std/the-standard"><em><abbr
title="International Organization for Standardization">ISO</abbr>
International Standard ISO/IEC 14882:2017(E) &ndash; Programming
Language C++</em></a>.
It is freely available under the
<abbr title="Massachusetts Institute of Technology">MIT</abbr> license.</li>
<li><a id="ICU" href="http://site.icu-project.org">International Components for
Unicode (<abbr>ICU</abbr>)</a> contains C/C++ and <a
href="https://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>
@ -333,8 +344,7 @@ into an <abbr>ICU</abbr>-specific format.
the <a href="https://elixir-lang.org">Elixir</a> language downloads
and compiles tz source and exposes <abbr
title="Application Program Interface">API</abbr>s for use. It is
freely available under the <abbr
title="Massachusetts Institute of Technology">MIT</abbr> license.</li>
freely available under the <abbr>MIT</abbr> license.</li>
<li>Java-based compilers and libraries include:
<ul>
<li>The <a
@ -364,7 +374,7 @@ License">LGPL</abbr>)</a>.</li>
<li><abbr>ICU</abbr> (mentioned <a href="#ICU">above</a>) contains compilers and
Java-based libraries.</li>
</ul>
<li><a href="http://nodatime.org">Noda Time &ndash; Date and
<li><a href="https://nodatime.org">Noda Time &ndash; Date and
time <abbr>API</abbr> for .NET</a>
and <a href="http://www.babiej.demon.nl/Tz4Net/main.htm">TZ4Net</a>
are similar to Joda-Time and Time4J, but for the .NET framework instead of
@ -374,6 +384,11 @@ and a <abbr>BSD</abbr>-style license, respectively.</li>
<li><a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>-based
compilers and libraries include:
<ul>
<li><a
href="https://github.com/kshetline/compact-time-zone-generator">CompactTimeZoneGenerator</a>
compiles time zone data into a compact form designed for
JavaScript. It is freely available under a combination of
the <abbr>MIT</abbr> license and the Apache License.</li>
<li><a href="https://momentjs.com/timezone/">Moment Timezone</a> is a
plugin for the <a href="https://momentjs.com">Moment.js</a> date
manipulation library. It is freely available under the <abbr>MIT</abbr>
@ -432,12 +447,20 @@ It is freely available under the <abbr>LGPL</abbr>.</li>
implementation of a binary 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>UTC</abbr> and civil time and
library that translates between <abbr>UT</abbr> and civil time and
can read binary 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.
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.
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>,
and <a href="https://www.mongodb.com">MongoDB</a>.
It is freely available under the <abbr>MIT</abbr> license.</li>
<li><a href="https://github.com/bigeasy/timezone">Timezone</a> is a
JavaScript library that supports date arithmetic that is time zone
aware. It is freely available under the <abbr>MIT</abbr> license.</li>
@ -495,7 +518,7 @@ the older, proprietary method of Microsoft Windows 2000 and later,
which stores time zone data in the
<a href="https://en.wikipedia.org/wiki/Windows_Registry">Windows Registry</a>. The
<a
href="http://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
href="https://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
Tzid table</a> or <a
href="https://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml"><abbr>XML</abbr>
file</a> of the <abbr>CLDR</abbr> data maps proprietary zone IDs
@ -505,7 +528,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="http://www.relativedata.com/time-zone-master">Time Zone
<li><a href="https://www.relativedata.com/time-zone-master">Time Zone
Master</a> is a Microsoft Windows clock program that can automatically
download, compile and use <code>tz</code> releases. The Basic version
is free.</li>
@ -520,8 +543,8 @@ licenses</a> to <code><abbr>tz</abbr></code> contributors.</li>
<li><a href="https://www.astro.com/atlas">Time-zone Atlas</a>
is Astrodienst's Web version of Shanks and Pottenger's
time zone history atlases also published in <a
href="http://astrocom.com/astrology-products/software/acs-atlas-software">software</a>
form by <a href="http://astrocom.com">ACS-Starcrafts</a>.
href="https://astrocom.com/astrology-products/software/acs-atlas-software">software</a>
form by <a href="https://astrocom.com">ACS-Starcrafts</a>.
These atlases are extensive but unreliable, as Shanks appears to have
guessed many <abbr>UT</abbr> offsets and transitions. The atlases cite no
sources and do not indicate which entries are guesswork.</li>
@ -529,7 +552,7 @@ sources and do not indicate which entries are guesswork.</li>
its own <code>tztab</code>(4) format.</li>
<li>Microsoft Windows has proprietary data mentioned
<a href="#System.TimeZoneInfo">above</a>.</li>
<li><a href="http://www.worldtimeserver.com">World Time Server</a>
<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
@ -553,16 +576,16 @@ Library Map Collection</a>
of the University of Texas at Austin has copies of
recent editions.
The pictorial quality is good,
but the maps do not indicate summer time,
but the maps do not indicate daylight saving time,
and parts of the data are a few years out of date.</li>
<li><a href="http://www.worldtimezone.com">Current time around the world
<li><a href="https://www.worldtimezone.com">Current time around the world
and standard time zones map of the world</a>
has several fancy time zone maps; it covers Russia particularly well.
The maps' pictorial quality is not quite as good as the
<abbr>CIA</abbr>'s
but the maps are more up to date.</li>
<li><a
href="http://blog.poormansmath.net/how-much-is-time-wrong-around-the-world/">How
href="https://blog.poormansmath.net/how-much-is-time-wrong-around-the-world/">How
much is time wrong around the world?</a> maps the difference between
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>
@ -622,10 +645,10 @@ library for Python is freely available under the MIT license.
href="https://github.com/gunyarakun/timezone_finder">timezone_finder</a>
library for Ruby is freely available under the MIT license.</li>
<li><a href="https://derickrethans.nl/what-time-is-it.html">What Time
is It Here?</a> applies <a href="https://www.mongodb.com">MongoDB</a>
is It Here?</a> applies MongoDB
geospatial query operators to shapefiles' data.</li>
</ul></li>
<li>Free access via a network API, if you a key, is provided by
<li>Free access via a network API, if you register a key, is provided by
the <a href="http://www.geonames.org/export/web-services.html#timezone">GeoNames Timezone web service</a>,
the <a href="https://developers.google.com/maps/documentation/timezone/intro">Google Maps Time Zone API</a>, and
the <a href="https://timezonedb.com">Time Zone Database &amp; API</a>.
@ -643,16 +666,15 @@ political subdivision data related to time zones.</li>
<li><a href="http://home.kpn.nl/vanadovv/time/Multizones.html">Time
zone boundaries for multizone countries</a> summarizes legal
boundaries between time zones within countries.</li>
<li>Manifold.net's <a
href="http://manifold.net/info/freestuff.shtml">Free Downloads for
Manifold System Users</a> includes a Manifold-format map of
<li><a href="http://manifold.net/info/freestuff.shtml">Manifold Software
&ndash; GIS and Database Tools</a> includes a Manifold-format map of
world time zone boundaries distributed under the
<abbr>GPL</abbr>.</li>
<li>A ship within the <a
href="https://en.wikipedia.org/wiki/Territorial_waters">territorial
waters</a> of any nation uses that nation's time. In international
waters, time zone boundaries are meridians 15&deg; apart, except that
<abbr>UTC</abbr>&minus;12 and <abbr>UTC</abbr>+12 are each 7.5&deg;
<abbr>UT</abbr>&minus;12 and <abbr>UT</abbr>+12 are each 7.5&deg;
wide and are separated by
the 180&deg; meridian (not by the International Date Line, which is
for land and territorial waters only). A captain can change ship's
@ -706,6 +728,10 @@ zones &amp; daylight saving time</a>.</dd>
<dd>The Hydrographic and Oceanographic Service of the Chilean Navy publishes a
<a href="http://www.horaoficial.cl/historia_hora.html" hreflang="es">history of
Chile's official time (in Spanish)</a>.</dd>
<dt>Czech Republic</dt>
<dd><a href="https://kalendar.beda.cz/kdy-zacina-a-konci-letni-cas"
hreflang="cs">When daylight saving time starts and ends (in Czech)</a>
summarizes and cites historical DST regulations.</dd>
<dt>Germany</dt>
<dd>The National Institute for Science and Technology maintains the <a
href="https://www.ptb.de/cms/en/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany.html">Realisation
@ -752,6 +778,11 @@ of Summer time dates</a>.</dd>
<dd>The Department of Transportation's <a
href="https://www.transportation.gov/regulations/recent-time-zone-proceedings">Recent
Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
<dt>Uruguay</dt>
<dd>The Oceanography, Hydrography, and Meteorology Service of the Uruguayan
Navy (SOHMA) publishes an annual <a
href="http://www.armada.mil.uy/Pagina/institucion/dimat/sohma/almanaque.html" hreflang="es">almanac
(in Spanish)</a>.</dd>
</dl>
<h2 id="precision">Precision timekeeping</h2>
<ul>
@ -759,6 +790,8 @@ Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
href="http://leapsecond.com/hpan/an1289.pdf">The
Science of Timekeeping</a> is a thorough introduction
to the theory and practice of precision timekeeping.</li>
<li><a href="https://doi.org/10.1007/978-3-319-59909-0">The Science of
Time 2016</a> contains several freely-readable papers.</li>
<li><a href="http://www.ntp.org"><abbr
title="Network Time Protocol">NTP</abbr>: The Network
Time Protocol</a> (Internet <abbr>RFC</abbr> 5905)
@ -778,12 +811,12 @@ href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol"><abbr>D
option for a server to configure
a client's time zone and daylight saving settings automatically.</li>
<li><a
href="http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html">Astronomical
href="https://www.cv.nrao.edu/~rfisher/Ephemerides/times.html">Astronomical
Times</a> explains more abstruse astronomical time scales like
<abbr title="Terrestrial Dynamic Time">TDT</abbr>,
<abbr title="Geocentric Coordinate Time">TCG</abbr>, and
<abbr title="Barycentric Dynamic Time">TDB</abbr>.
<a href="http://www.ucolick.org/~sla/leapsecs/timescales.html">Time
<a href="https://www.ucolick.org/~sla/leapsecs/timescales.html">Time
Scales</a> goes into more detail, particularly for historical variants.</li>
<li>The <a href="https://www.iau.org"><abbr
title="International Astronomical Union">IAU</abbr></a>'s <a
@ -829,7 +862,7 @@ and Klepczynski's 1999 proposal to discontinue leap seconds</a>,
discussed further in
<a href="https://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The
leap second: its history and possible future</a>.
<a href="http://www.ucolick.org/~sla/leapsecs/"><abbr>UTC</abbr>
<a href="https://www.ucolick.org/~sla/leapsecs/"><abbr>UTC</abbr>
might be redefined
without Leap Seconds</a> gives pointers on this
contentious issue, which was active until 2015 and could become active
@ -843,7 +876,7 @@ zone names, abbreviations, identifiers, and formats. For example, it
contains French translations for "Eastern European Summer Time",
"<abbr title="Eastern European Summer Time">EEST</abbr>", and
"Bucharest". Its
<a href="http://unicode.org/cldr/charts/latest/by_type/">by-type
<a href="https://unicode.org/cldr/charts/latest/by_type/">by-type
charts</a> show these values for many locales. Data values are available in
both <abbr title="Locale Data Markup Language">LDML</abbr>
(an <abbr>XML</abbr> format) and <abbr>JSON</abbr>.
@ -852,10 +885,9 @@ both <abbr title="Locale Data Markup Language">LDML</abbr>
the international standard date and time notation</a> is a good
summary of
<a
href="https://www.iso.org/standard/40874.html"><abbr
title="International Organization for Standardization">ISO</abbr>
href="https://www.iso.org/standard/40874.html"><em><abbr>ISO</abbr>
8601:2004 &ndash; Data elements and interchange formats &ndash; Information
interchange &ndash; Representation of dates and times</a>.</li>
interchange &ndash; Representation of dates and times</em></a>.</li>
<li>
<a href="https://www.w3.org/TR/xmlschema-2/#dateTime"><abbr>XML</abbr>
Schema: Datatypes &ndash; dateTime</a> specifies a format inspired by
@ -876,18 +908,18 @@ protocols.</li>
Formats on the Web</a> surveys web- and Internet-oriented date and time
formats.</li>
<li>Alphabetic time zone abbreviations should not be used as unique
identifiers for <abbr>UTC</abbr> offsets as they are ambiguous in
identifiers for <abbr>UT</abbr> offsets as they are ambiguous in
practice. For example, in English-speaking North America
"<abbr>CST</abbr>" denotes 6 hours behind <abbr>UTC</abbr>,
but in China it denotes 8 hours ahead of <abbr>UTC</abbr>,
"<abbr>CST</abbr>" denotes 6 hours behind <abbr>UT</abbr>,
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;
unfortunately some of these abbreviations were merely the database maintainers'
inventions, and are gradually being removed.</li>
inventions, and these have been removed when possible.</li>
<li>Numeric time zone abbreviations typically count hours east of
<abbr>UTC</abbr>, e.g., +09 for Japan and
<abbr>UT</abbr>, e.g., +09 for Japan and
&minus;10 for Hawaii. However, the <abbr>POSIX</abbr>
<code><abbr>TZ</abbr></code> environment variable uses the opposite convention.
For example, one might use <code><abbr>TZ</abbr>="<abbr
@ -901,13 +933,13 @@ confusion, handle old time stamps 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
local time is nine hours ahead of <abbr>UTC</abbr> and the time zone
local time is nine hours ahead of <abbr>UT</abbr> and the time zone
is called "<abbr>GMT</abbr>".</li>
</ul>
<h2 id="see-also">See also</h2>
<ul>
<li><a href="theory.html">Theory and pragmatics of the tz code and data</a></li>
<li><a href="tz-art.htm">Time and the Arts</a></li>
<li><a href="tz-art.html">Time and the Arts</a></li>
</ul>
<hr>
<address>

View File

@ -1,5 +1,5 @@
.\" $NetBSD: tzset.3,v 1.37 2018/01/25 22:48:42 christos Exp $
.Dd January 25, 2018
.\" $NetBSD: tzset.3,v 1.38 2018/05/04 15:51:00 christos Exp $
.Dd May 5, 2018
.Dt TZSET 3
.Os
.Sh NAME
@ -175,14 +175,15 @@ where:
.It Cm std No and Cm dst
Three or more bytes that are the designation for the standard
.Cm ( std )
or summer
.Cm ( dst )
or the alternative
.Cm ( dst
such as daylight saving time)
time zone.
Only
.Cm std
is required; if
.Cm dst
is missing, then summer time does not apply in this locale.
is missing, then daylight saving time does not apply in this locale.
Upper- and lowercase letters are explicitly allowed.
Any characters except a leading colon (:), digits, comma (,), minus (-),
plus (+), and NUL bytes are allowed.
@ -225,7 +226,7 @@ If no
.Cm offset
follows
.Cm dst ,
summer time is assumed to be one hour ahead of standard time.
daylight saving time is assumed to be one hour ahead of standard time.
One or more digits may be used; the value is always interpreted as a
decimal number.
The hour must be between zero and 24, and the minutes (and
@ -236,7 +237,7 @@ the time zone shall be east of the Prime Meridian; otherwise it shall be
west (which may be indicated by an optional preceding
.Dq + ) .
.It Cm rule
Indicates when to change to and back from summer time.
Indicates when to change to and back from daylight saving time.
The
.Cm rule
has the form:
@ -253,7 +254,7 @@ has the form:
.Pp
where the first
.Cm date
describes when the change from standard to summer time occurs and the
describes when the change from standard to daylight saving time occurs and the
second
.Cm date
describes when the change back happens.
@ -337,30 +338,41 @@ extensions to POSIX.
stands for US Eastern Standard
Time (EST), 5 hours behind UT, without daylight saving.
.It FJT\-12FJST,M11.1.0,M1.3.4/75
stands for Fiji Time (FJT) and Fiji Summer Time (FJST), 12 hours ahead
.It <+12>\-12<+13>,M11.1.0,M1.2.1/147
stands for Fiji time, 12 hours ahead
of UT, springing forward on November's first Sunday at 02:00, and
falling back on January's third Thursday at 75:00 (i.e., 03:00 on the
first Sunday on or after January 18).
falling back on January's second Monday at 147:00 (i.e., 03:00 on the
first Sunday on or after January 14).
The abbreviations for standard and daylight saving time are
.Qq +12
and
.Qq +13 .
.It IST\-2IDT,M3.4.4/26,M10.5.0
stands for Israel Standard Time (IST) and Israel Daylight Time (IDT),
2 hours ahead of UT, springing forward on March's fourth
Thursday at 26:00 (i.e., 02:00 on the first Friday on or after March
23), and falling back on October's last Sunday at 02:00.
.It WART4WARST,J1/0,J365/25
stands for Western Argentina Summer Time (WARST), 3 hours behind UT.
.It <\-04>4<\-03>,J1/0,J365/25
stands for permanent daylight saving time, 3 hours behind UT with
abbreviation
.Qq \-03 .
There is a dummy fall-back transition on December 31 at 25:00 daylight
saving time (i.e., 24:00 standard time, equivalent to January 1 at
00:00 standard time), and a simultaneous spring-forward transition on
January 1 at 00:00 standard time, so daylight saving time is in effect
all year and the initial
.Em WART
.Em <\-04>
is a placeholder.
.It WGT3WGST,M3.5.0/\-2,M10.5.0/\-1
stands for Western Greenland Time (WGT) and Western Greenland Summer
Time (WGST), 3 hours behind UT, where clocks follow the EU rules of
.It <\-03>3<\-02>,M3.5.0/\-2,M10.5.0/\-1
stands for time in western Greenland, 3 hours behind UT, where clocks
follow the EU rules of
springing forward on March's last Sunday at 01:00 UT (\-02:00 local
time) and falling back on October's last Sunday at 01:00 UT
(\-01:00 local time).
time, i.e., 22:00 the previous day) and falling back on October's last
Sunday at 01:00 UT (\-01:00 local time, i.e., 23:00 the previous day).
The abbreviations for standard and daylight saving time are
.Qq \-03
and
.Qq \-02 .
.El
.Pp
If no
@ -373,7 +385,7 @@ format file
.Pa posixrules
in
.Pa /usr/share/zoneinfo
are used, with the standard and summer time offsets from UT replaced
are used, with the standard and daylight saving time offsets from UT replaced
by those specified by the
.Cm offset
values in

View File

@ -1 +1 @@
2018c
2018e

View File

@ -1,4 +1,4 @@
/* $NetBSD: zdump.c,v 1.48 2018/01/25 22:48:42 christos Exp $ */
/* $NetBSD: zdump.c,v 1.49 2018/05/04 15:51:00 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2009-05-17 by Arthur David Olson.
@ -6,22 +6,12 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: zdump.c,v 1.48 2018/01/25 22:48:42 christos Exp $");
__RCSID("$NetBSD: zdump.c,v 1.49 2018/05/04 15:51:00 christos Exp $");
#endif /* !defined lint */
/*
** This code has been made independent of the rest of the time
** conversion package to increase confidence in the verification it provides.
** You can use this code to help in verifying other implementations.
** To do this, compile with -DUSE_LTZ=0 and link without the tz library.
*/
#ifndef NETBSD_INSPIRED
# define NETBSD_INSPIRED 1
#endif
#ifndef USE_LTZ
# define USE_LTZ 1
#endif
#include <err.h>
#include "private.h"
@ -149,7 +139,7 @@ sumsize(size_t a, size_t b)
/* Return a pointer to a newly allocated buffer of size SIZE, exiting
on failure. SIZE should be nonzero. */
static void *
static void * ATTRIBUTE_MALLOC
xmalloc(size_t size)
{
void *p = malloc(size);

View File

@ -1,5 +1,5 @@
.\" $NetBSD: zic.8,v 1.28 2018/01/25 22:48:42 christos Exp $
.Dd January 25, 2018
.\" $NetBSD: zic.8,v 1.29 2018/05/04 15:51:00 christos Exp $
.Dd May 5, 2018
.Dt ZIC 8
.Os
.Sh NAME
@ -156,11 +156,11 @@ abbreviation must be unambiguous in context.
.Pp
A rule line has the form
.Pp
.Dl Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
.Dl Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
.Pp
For example:
.Pp
.Dl Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D
.Dl Rule US 1967 1973 \- Apr lastSun 2:00s 1:00d D
.Pp
The fields that make up a rule line are:
.Bl -tag -width "LETTER/S"
@ -233,13 +233,15 @@ field.
Gives the time of day at which the rule takes effect.
Recognized forms include:
.Pp
.Bl -tag -width "01X28X14" -compact -offset indent
.Bl -tag -width "00X19X32X13" -compact -offset indent
.It 2
time in hours
.It 2:00
time in hours and minutes
.It 01:28:14
time in hours, minutes, and seconds
.It 00:19:32.13
time with fractional seconds
.It 15:00
24-hour format time (for times after noon)
.It 260:00
@ -252,6 +254,12 @@ equivalent to 0
.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
(breaking ties to the even integer), the fractions may be useful
to other applications requiring greater precision.
The source format does not specify any maximum precision.
Any of these forms may be followed by the letter
.Em w
if the given time is local
@ -275,16 +283,23 @@ clock/calendar set to the type of time specified in the
field would show the specified date and time of day.
.It SAVE
Gives the amount of time to be added to local standard time when the rule is in
effect.
effect, and whether the resulting time is standard or daylight saving.
This field has the same format as the
.Em AT
field
(although, of course, the
suffixes are not used).
.Em s
for standard time and
.Em d
for daylight saving time.
The suffix letter is typically omitted, and defaults to
.Em s
if the offset is zero and to
.Em d
otherwise.
Negative offsets are allowed; in Ireland, for example, daylight saving
time is observed in winter and has a negative offset relative to
Irish Standard Time.
Only the sum of standard time and this amount matters; for example,
The offset is merely added to standard time; for example,
.Nm
does not distinguish a 10:30 standard time plus an 0:30
.Em SAVE
@ -337,7 +352,9 @@ 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,
alternatively, an amount of time to add to local standard time.
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.
@ -350,7 +367,7 @@ The pair of characters
is used to show where the
.Dq variable part
of the time zone abbreviation goes.
Alternately, a format can use the pair of characters
Alternatively, a format can use the pair of characters
.Em %z
+to stand for the UT offset in the form
.Em \(+- hh ,

View File

@ -1,4 +1,4 @@
/* $NetBSD: zic.c,v 1.70 2018/01/25 22:48:42 christos Exp $ */
/* $NetBSD: zic.c,v 1.71 2018/05/04 15:51:00 christos Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
@ -10,7 +10,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: zic.c,v 1.70 2018/01/25 22:48:42 christos Exp $");
__RCSID("$NetBSD: zic.c,v 1.71 2018/05/04 15:51:00 christos Exp $");
#endif /* !defined lint */
#include "private.h"
@ -52,6 +52,10 @@ typedef int_fast64_t zic_t;
#else
#define MKDIR_UMASK 0755
#endif
/* Port to native MS-Windows and to ancient UNIX. */
#if !defined S_ISDIR && defined S_IFDIR && defined S_IFMT
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#if HAVE_SYS_WAIT_H
#include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */
@ -96,7 +100,9 @@ struct rule {
/* or wall clock time if 0 */
bool r_todisgmt; /* above is GMT if 1 */
/* or local time if 0 */
zic_t r_stdoff; /* offset from standard time */
bool r_isdst; /* is this daylight saving time? */
zic_t r_stdoff; /* offset from default time (which is
usually standard time) */
const char * r_abbrvar; /* variable part of abbreviation */
bool r_todo; /* a rule to do (used in outzone) */
@ -117,10 +123,11 @@ struct zone {
const char * z_name;
zic_t z_gmtoff;
const char * z_rule;
char * z_rule;
const char * z_format;
char z_format_specifier;
bool z_isdst;
zic_t z_stdoff;
struct rule * z_rules;
@ -160,6 +167,7 @@ static void dolink(const char *, const char *, bool);
static char ** getfields(char * buf);
static zic_t gethms(const char * string, const char * errstring,
bool);
static zic_t getstdoff(char *, bool *);
static void infile(const char * filename);
static void inleap(char ** fields, int nfields);
static void inlink(char ** fields, int nfields);
@ -450,7 +458,7 @@ memcheck(void *ptr)
return ptr;
}
static void *
static void * ATTRIBUTE_MALLOC
zic_malloc(size_t size)
{
return memcheck(malloc(size));
@ -462,7 +470,7 @@ zic_realloc(void *ptr, size_t size)
return memcheck(realloc(ptr, size));
}
static char *
static char * ATTRIBUTE_MALLOC
ecpyalloc(char const *str)
{
return memcheck(strdup(str));
@ -905,9 +913,11 @@ dolink(char const *fromfield, char const *tofield, bool staysymlink)
char *linkalloc = absolute ? NULL : relname(fromfield, tofield);
char const *contents = absolute ? fromfield : linkalloc;
int symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno;
if (symlink_errno == ENOENT && !todirs_made) {
if (!todirs_made
&& (symlink_errno == ENOENT || symlink_errno == ENOTSUP)) {
mkdirs(tofield, true);
symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno;
if (symlink_errno == ENOENT)
symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno;
}
free(linkalloc);
if (symlink_errno == 0) {
@ -1095,8 +1105,7 @@ associate(void)
** Maybe we have a local standard time offset.
*/
eat(zp->z_filename, zp->z_linenum);
zp->z_stdoff = gethms(zp->z_rule, _("unruly zone"),
true);
zp->z_stdoff = getstdoff(zp->z_rule, &zp->z_isdst);
/*
** Note, though, that if there's no rule,
** a '%s' in the format is a bad thing.
@ -1203,8 +1212,10 @@ static zic_t
gethms(char const *string, char const *errstring, bool signable)
{
zic_t hh;
int mm, ss, sign;
char xs;
int sign, mm = 0, ss = 0;
char hhx, mmx, ssx, xr = '0', xs;
int tenths = 0;
bool ok = true;
if (string == NULL || *string == '\0')
return 0;
@ -1214,12 +1225,24 @@ gethms(char const *string, char const *errstring, bool signable)
sign = -1;
++string;
} else sign = 1;
if (sscanf(string, "%"SCNdZIC"%c", &hh, &xs) == 1)
mm = ss = 0;
else if (sscanf(string, "%"SCNdZIC":%d%c", &hh, &mm, &xs) == 2)
ss = 0;
else if (sscanf(string, "%"SCNdZIC":%d:%d%c", &hh, &mm, &ss, &xs)
!= 3) {
switch (sscanf(string,
"%"SCNdZIC"%c%d%c%d%c%1d%*[0]%c%*[0123456789]%c",
&hh, &hhx, &mm, &mmx, &ss, &ssx, &tenths, &xr, &xs)) {
default: ok = false; break;
case 8:
ok = '0' <= xr && xr <= '9';
/* fallthrough */
case 7:
ok &= ssx == '.';
if (ok && noise)
warning(_("fractional seconds rejected by"
" pre-2018 versions of zic"));
/* fallthrough */
case 5: ok &= mmx == ':'; /* fallthrough */
case 3: ok &= hhx == ':'; /* fallthrough */
case 1: break;
}
if (!ok) {
error("%s", errstring);
return 0;
}
@ -1233,6 +1256,7 @@ gethms(char const *string, char const *errstring, bool signable)
error(_("time overflow"));
return 0;
}
ss += 5 + ((ss ^ 1) & (xr == '0')) <= tenths; /* Round to even. */
if (noise && (hh > HOURSPERDAY ||
(hh == HOURSPERDAY && (mm != 0 || ss != 0))))
warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
@ -1240,6 +1264,24 @@ warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
sign * (mm * SECSPERMIN + ss));
}
static zic_t
getstdoff(char *field, bool *isdst)
{
int dst = -1;
zic_t stdoff;
size_t fieldlen = strlen(field);
if (fieldlen != 0) {
char *ep = field + fieldlen - 1;
switch (*ep) {
case 'd': dst = 1; *ep = '\0'; break;
case 's': dst = 0; *ep = '\0'; break;
}
}
stdoff = gethms(field, _("invalid saved time"), true);
*isdst = dst < 0 ? stdoff != 0 : dst;
return stdoff;
}
static void
inrule(char **fields, int nfields)
{
@ -1255,7 +1297,7 @@ inrule(char **fields, int nfields)
}
r.r_filename = filename;
r.r_linenum = linenum;
r.r_stdoff = gethms(fields[RF_STDOFF], _("invalid saved time"), true);
r.r_stdoff = getstdoff(fields[RF_STDOFF], &r.r_isdst);
rulesub(&r, fields[RF_LOYEAR], fields[RF_HIYEAR], fields[RF_COMMAND],
fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]);
r.r_name = ecpyalloc(fields[RF_NAME]);
@ -2106,7 +2148,7 @@ abbroffset(char *buf, zic_t offset)
static size_t
doabbr(char *abbr, int abbrlen, struct zone const *zp, const char *letters,
zic_t stdoff, bool doquotes)
bool isdst, zic_t stdoff, bool doquotes)
{
char * cp;
char * slashp;
@ -2121,7 +2163,7 @@ doabbr(char *abbr, int abbrlen, struct zone const *zp, const char *letters,
else if (!letters)
letters = "%s";
snprintf(abbr, abbrlen, format, letters);
} else if (stdoff != 0) {
} else if (isdst) {
strlcpy(abbr, slashp + 1, abbrlen);
} else {
memcpy(abbr, format, slashp - format);
@ -2232,7 +2274,7 @@ stringrule(char *result, const struct rule *const rp, const zic_t dstoff,
}
if (rp->r_todisgmt)
tod += gmtoff;
if (rp->r_todisstd && rp->r_stdoff == 0)
if (rp->r_todisstd && !rp->r_isdst)
tod += dstoff;
if (tod != 2 * SECSPERMIN * MINSPERHOUR) {
*result++ = '/';
@ -2290,7 +2332,7 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
continue;
if (rp->r_yrtype != NULL)
continue;
if (rp->r_stdoff == 0) {
if (!rp->r_isdst) {
if (stdrp == NULL)
stdrp = rp;
else return -1;
@ -2309,7 +2351,7 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
struct rule *stdabbrrp = NULL;
for (i = 0; i < zp->z_nrules; ++i) {
rp = &zp->z_rules[i];
if (rp->r_stdoff == 0 && rule_cmp(stdabbrrp, rp) < 0)
if (!rp->r_isdst && rule_cmp(stdabbrrp, rp) < 0)
stdabbrrp = rp;
if (rule_cmp(stdrp, rp) < 0)
stdrp = rp;
@ -2322,13 +2364,14 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
if (stdrp != NULL && stdrp->r_hiyear == 2037)
return YEAR_BY_YEAR_ZONE;
if (stdrp != NULL && stdrp->r_stdoff != 0) {
if (stdrp != NULL && stdrp->r_isdst) {
/* Perpetual DST. */
dstr.r_month = TM_JANUARY;
dstr.r_dycode = DC_DOM;
dstr.r_dayofmonth = 1;
dstr.r_tod = 0;
dstr.r_todisstd = dstr.r_todisgmt = false;
dstr.r_isdst = stdrp->r_isdst;
dstr.r_stdoff = stdrp->r_stdoff;
dstr.r_abbrvar = stdrp->r_abbrvar;
stdr.r_month = TM_DECEMBER;
@ -2336,6 +2379,7 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
stdr.r_dayofmonth = 31;
stdr.r_tod = SECSPERDAY + stdrp->r_stdoff;
stdr.r_todisstd = stdr.r_todisgmt = false;
stdr.r_isdst = false;
stdr.r_stdoff = 0;
stdr.r_abbrvar
= (stdabbrrp ? stdabbrrp->r_abbrvar : "");
@ -2343,10 +2387,10 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
stdrp = &stdr;
}
}
if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0))
if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_isdst))
return -1;
abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
len = doabbr(result, resultlen, zp, abbrvar, 0, true);
len = doabbr(result, resultlen, zp, abbrvar, false, 0, true);
offsetlen = stringoffset(result + len, -zp->z_gmtoff);
if (! offsetlen) {
result[0] = '\0';
@ -2355,7 +2399,8 @@ stringzone(char *result, const int resultlen, const struct zone *const zpfirst,
len += offsetlen;
if (dstrp == NULL)
return compat;
len += doabbr(result + len, resultlen - len, zp, dstrp->r_abbrvar, dstrp->r_stdoff, true);
len += doabbr(result + len, resultlen - len, zp, dstrp->r_abbrvar,
dstrp->r_isdst, dstrp->r_stdoff, true);
if (dstrp->r_stdoff != SECSPERMIN * MINSPERHOUR) {
offsetlen = stringoffset(result + len,
-(zp->z_gmtoff + dstrp->r_stdoff));
@ -2532,7 +2577,7 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
if (zp->z_nrules == 0) {
stdoff = zp->z_stdoff;
doabbr(startbuf, max_abbr_len + 1, zp,
NULL, stdoff, false);
NULL, zp->z_isdst, stdoff, false);
type = addtype(oadd(zp->z_gmtoff, stdoff),
startbuf, stdoff != 0, startttisstd,
startttisgmt);
@ -2632,6 +2677,7 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
max_abbr_len + 1,
zp,
rp->r_abbrvar,
rp->r_isdst,
rp->r_stdoff,
false);
continue;
@ -2643,6 +2689,7 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
max_abbr_len + 1,
zp,
rp->r_abbrvar,
rp->r_isdst,
rp->r_stdoff,
false);
}
@ -2650,9 +2697,9 @@ outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum);
doabbr(ab, max_abbr_len + 1, zp, rp->r_abbrvar,
rp->r_stdoff, false);
rp->r_isdst, rp->r_stdoff, false);
offset = oadd(zp->z_gmtoff, rp->r_stdoff);
type = addtype(offset, ab, rp->r_stdoff != 0,
type = addtype(offset, ab, rp->r_isdst,
rp->r_todisstd, rp->r_todisgmt);
if (rp->r_hiyear == ZIC_MAX
&& ! (0 <= lastatmax