update tzdata Signed-off-by:王剑<wangjian497@huawei.com>

Signed-off-by: wangjian <wangjian497@huawei.com>
This commit is contained in:
wangjian
2023-07-31 12:23:45 +08:00
parent e20eb72e13
commit a6791b5f7d
44 changed files with 2826 additions and 1515 deletions
+39 -34
View File
@@ -1,50 +1,58 @@
Contributing to the tz code and data
# Contributing to the tz code and data
Please do not create issues or pull requests on GitHub, as the
proper procedure for proposing and distributing patches is via
email as described below.
The time zone database is by no means authoritative: governments
change timekeeping rules erratically and sometimes with little
warning, the data entries do not cover all of civil time before
1970, and undoubtedly errors remain in the code and data. Feel
free to fill gaps or fix mistakes, and please email improvements
to tz@iana.org for use in the future. In your email, please give
to <tz@iana.org> for use in the future. In your email, please give
reliable sources that reviewers can check.
-----
Developers can contribute technical changes to the source code and
data as follows.
## Contributing technical changes
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.
'myfix.patch' to the email.
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
"Theory and pragmatics of the tz code and data"
<https://www.iana.org/time-zones/repository/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
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
repository. The latter is preferred. If you use Git the following
workflow may be helpful:
For changes that fix sensitive security-related bugs, please see the
distribution's 'SECURITY' file.
Please submit changes against either the latest release
<https://www.iana.org/time-zones> or the main branch of the development
repository. The latter is preferred.
## Sample Git workflow for developing contributions
If you use Git the following workflow may be helpful:
* Copy the development repository.
git clone https://github.com/eggert/tz.git
cd tz
git clone https://github.com/eggert/tz.git
cd tz
* Get current with the master branch.
* Get current with the main branch.
git checkout master
git pull
git checkout main
git pull
* Switch to a new branch for the changes. Choose a different
branch name for each change set.
git checkout -b mybranch
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
@@ -57,36 +65,33 @@ workflow may be helpful:
* Debug the changes, e.g.:
make check
make install
./zdump -v America/Los_Angeles
make check
make install
./zdump -v America/Los_Angeles
* For each separable change, commit it in the new branch, e.g.:
git add northamerica
git commit
git add northamerica
git commit
See recent 'git log' output for the commit-message style.
* Create patch files 0001-*, 0002-*, ...
* Create patch files 0001-..., 0002-..., ...
git format-patch master
git format-patch main
* After reviewing the patch files, send the patches to tz@iana.org
* After reviewing the patch files, send the patches to <tz@iana.org>
for others to review.
git send-email master
git send-email main
For an archived example of such an email, see
"[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913"
<https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
* Start anew by getting current with the master branch again
* Start anew by getting current with the main branch again
(the second step above).
Please do not create issues or pull requests on GitHub, as the
proper procedure for proposing and distributing patches is via
email as illustrated above.
-----
This file is in the public domain.
+39 -23
View File
@@ -45,9 +45,9 @@ LOCALTIME= GMT
#
# Any other value for POSIXRULES is obsolete and should not be relied on, as:
# * It does not work correctly in popular implementations such as GNU/Linux.
# * It does not work in the tzdb implementation for timestamps after 2037.
# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions
# at standard time or UT rather than at local time.
# * It does not work even in tzcode, except for historical timestamps
# that precede the last explicit transition in the POSIXRULES file.
# Hence it typically does not work for current and future timestamps.
# In short, software should avoid ruleless settings like TZ='EET-2EEST'
# and so should not depend on the value of POSIXRULES.
#
@@ -122,8 +122,8 @@ LIBDIR = $(TOPDIR)/$(USRDIR)/lib
# 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
TIME_T_ALTERNATIVES_HEAD = int_least64_t
TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t
# What kind of TZif data files to generate. (TZif is the binary time
# zone data format that zic generates; see Internet RFC 8536.)
@@ -152,8 +152,10 @@ REDO= posix_right
# The EXPIRES_LINE value matters only if REDO's value contains "right".
# If you change EXPIRES_LINE, remove the leapseconds file before running "make".
# zic's support for the Expires line was introduced in tzdb 2020a,
# and EXPIRES_LINE defaults to 0 for now so that the leapseconds file
# can be given to older zic implementations.
# and was modified in tzdb 2021b to generate version 4 TZif files.
# EXPIRES_LINE defaults to 0 for now so that the leapseconds file
# can be given to pre-2020a zic implementations and so that TZif files
# built by newer zic implementations can be read by pre-2021b libraries.
EXPIRES_LINE= 0
# To install data in text form that has all the information of the TZif data,
@@ -210,6 +212,7 @@ LDLIBS=
# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
# localtime_rz can make zdump significantly faster, but is nonstandard.
# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure.
# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
# functions like 'link' or variables like 'tzname' required by POSIX
# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
@@ -220,7 +223,6 @@ LDLIBS=
# -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
@@ -257,22 +259,26 @@ LDLIBS=
GCC_INSTRUMENT = \
-fsanitize=undefined -fsanitize-address-use-after-scope \
-fsanitize-undefined-trap-on-error -fstack-protector
# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow.
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=strict -Wdate-time \
-Wdeclaration-after-statement -Wdouble-promotion \
-Wduplicated-branches -Wduplicated-cond \
-Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
-Winit-self -Wjump-misses-init -Wlogical-op \
-Winit-self -Wlogical-op \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wnull-dereference \
-Wold-style-definition -Woverlength-strings -Wpointer-arith \
-Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
-Wshadow -Wshift-overflow=2 -Wstrict-overflow \
-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 \
-Wtrampolines -Wundef -Wuninitialized -Wunused-macros \
-Wvariadic-macros -Wvla -Wwrite-strings \
-Wno-address -Wno-format-nonliteral -Wno-sign-compare \
-Wno-type-limits -Wno-unused-parameter
@@ -393,9 +399,10 @@ ZFLAGS=
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
# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work.
# Also, it is better (though not essential) if 'awk' supports UTF-8,
# and unfortunately mawk and busybox awk do not support UTF-8.
# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems.
AWK= awk
# The full path name of a Posix-compliant shell, preferably one that supports
@@ -460,7 +467,9 @@ OK_LINE= '^'$(OK_CHAR)'*$$'
# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w --sort=name
TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
then echo $(GNUTARFLAGS); \
else :; \
@@ -498,7 +507,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
date.1.txt
COMMON= calendars CONTRIBUTING LICENSE Makefile \
NEWS README theory.html version
NEWS README SECURITY theory.html version
WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
check_tz-how-to.html check_tz-link.html
@@ -523,7 +532,7 @@ 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 \
TZS_DEPS= $(YDATA) asctime.c localtime.c \
private.h tzfile.h zdump.c zic.c
# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
@@ -533,7 +542,7 @@ ENCHILADA = $(EIGHT_YARDS) $(TZS)
# This list is not the same as the output of 'git ls-files', since
# .gitignore is not distributed.
VERSION_DEPS= \
calendars CONTRIBUTING LICENSE Makefile NEWS README \
calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \
africa antarctica asctime.c asia australasia \
backward backzone \
checklinks.awk checktab.awk \
@@ -736,7 +745,7 @@ date: $(DATEOBJS)
tzselect: tzselect.ksh version
VERSION=`cat version` && sed \
-e 's|#!/bin/bash|#!$(KSHELL)|g' \
-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
-e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \
-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
@@ -757,7 +766,7 @@ check_character_set: $(ENCHILADA)
sharp='#' && \
! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
$(MISC) $(SOURCES) $(WEB_PAGES) \
CONTRIBUTING LICENSE README \
CONTRIBUTING LICENSE README SECURITY \
version tzdata.zi && \
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
Makefile && \
@@ -796,9 +805,10 @@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
$(AWK) -f checklinks.awk tzdata.zi
touch $@
check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
check_tables: checktab.awk $(YDATA) backward $(ZONETABLES)
for tab in $(ZONETABLES); do \
$(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \
$(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \
|| exit; \
done
touch $@
@@ -952,6 +962,12 @@ check_public: $(VERSION_DEPS)
public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
done
public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
:
: Also check 'backzone' syntax.
rm public.dir/main.zi
cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi
public.dir/zic -d public.dir/zoneinfo main.zi
:
rm -fr public.dir
touch $@
@@ -964,7 +980,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
mkdir $@.dir
ln $(VERSION_DEPS) $@.dir
case $@ in \
int32_t) range=-2147483648,2147483648;; \
int*32_t) range=-2147483648,2147483648;; \
u*) range=0,4294967296;; \
*) range=-4294967296,4294967296;; \
esac && \
+351 -5
View File
@@ -1,5 +1,351 @@
News for the tz database
Release 2022a - 2022-03-15 23:02:01 -0700
Briefly:
Palestine will spring forward on 2022-03-27, not -03-26.
zdump -v now outputs better failure indications.
Bug fixes for code that reads corrupted TZif data.
Changes to future timestamps
Palestine will spring forward on 2022-03-27, not 2022-03-26.
(Thanks to Heba Hamad.) Predict future transitions for first
Sunday >= March 25. Additionally, predict fallbacks to be the first
Friday on or after October 23, not October's last Friday, to be more
consistent with recent practice. The first differing fallback
prediction is on 2025-10-24, not 2025-10-31.
Changes to past timestamps
From 1992 through spring 1996, Ukraine's DST transitions were at
02:00 standard time, not at 01:00 UTC. (Thanks to Alois Treindl.)
Chile's Santiago Mean Time and its LMT precursor have been adjusted
eastward by 1 second to align with past and present law.
Changes to commentary
Add several references for Chile's 1946/1947 transitions, some of
which only affected portions of the country.
Changes to code
Fix bug when mktime gets confused by truncated TZif files with
unspecified local time. (Problem reported by Almaz Mingaleev.)
Fix bug when 32-bit time_t code reads malformed 64-bit TZif data.
(Problem reported by Christos Zoulas.)
When reading a version 2 or later TZif file, the TZif reader now
validates the version 1 header and data block only enough to skip
over them, as recommended by RFC 8536 section 4. Also, the TZif
reader no longer mistakenly attempts to parse a version 1 TZIf
file header as a TZ string.
zdump -v now outputs "(localtime failed)" and "(gmtime failed)"
when local time and UT cannot be determined for a timestamp.
Changes to build procedure
Distribution tarballs now use standard POSIX.1-1988 ustar format
instead of GNU format. Although the formats are almost identical
for these tarballs, ustar headers' magic fields contain "ustar"
instead of "ustar ", and their version fields contain "00" instead
of " ". The two formats are planned to diverge more significantly
for tzdb releases after 2242-03-16 12:56:31 UTC, when the ustar
format becomes obsolete and the tarballs switch to pax format, an
extension of ustar. For details about these formats, please see
"pax - portable archive interchange", IEEE Std 1003.1-2017,
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13>.
Release 2021e - 2021-10-21 18:41:00 -0700
Changes to future timestamps
Palestine will fall back 10-29 (not 10-30) at 01:00.
(Thanks to P Chan and Heba Hemad.)
Release 2021d - 2021-10-15 13:48:18 -0700
Briefly:
Fiji suspends DST for the 2021/2022 season.
'zic -r' marks unspecified timestamps with "-00".
Changes to future timestamps
Fiji will suspend observance of DST for the 2021/2022 season.
Assume for now that it will return next year. (Thanks to Jashneel
Kumar and P Chan.)
Changes to code
'zic -r' now uses "-00" time zone abbreviations for intervals
with UT offsets that are unspecified due to -r truncation.
This implements a change in draft Internet RFC 8536bis.
Release 2021c - 2021-10-01 14:21:49 -0700
Briefly:
Revert most 2021b changes to 'backward'.
Fix 'zic -b fat' bug in pre-1970 32-bit data.
Fix two Link line typos.
Distribute SECURITY file.
This release is intended as a bugfix release, to fix compatibility
problems and typos reported since 2021b was released.
Changes to Link directives
Revert almost all of 2021b's changes to the 'backward' file,
by moving Link directives back to where they were in 2021a.
Although 'zic' doesn't care which source file contains a Link
directive, some downstream uses ran into trouble with the move.
(Problem reported by Stephen Colebourne for Joda-Time.)
Fix typo that linked Atlantic/Jan_Mayen to the wrong location
(problem reported by Chris Walton).
Fix 'backzone' typo that linked America/Virgin to the wrong
location (problem reported by Michael Deckers).
Changes to code
Fix a bug in 'zic -b fat' that caused old timestamps to be
mishandled in 32-bit-only readers (problem reported by Daniel
Fischer).
Changes to documentation
Distribute the SECURITY file (problem reported by Andreas Radke).
Release 2021b - 2021-09-24 16:23:00 -0700
Briefly:
Jordan now starts DST on February's last Thursday.
Samoa no longer observes DST.
Merge more location-based Zones whose timestamps agree since 1970.
Move some backward-compatibility links to 'backward'.
Rename Pacific/Enderbury to Pacific/Kanton.
Correct many pre-1993 transitions in Malawi, Portugal, etc.
zic now creates each output file or link atomically.
zic -L no longer omits the POSIX TZ string in its output.
zic fixes for truncation and leap second table expiration.
zic now follows POSIX for TZ strings using all-year DST.
Fix some localtime crashes and bugs in obscure cases.
zdump -v now outputs more-useful boundary cases.
tzfile.5 better matches a draft successor to RFC 8536.
A new file SECURITY.
This release is prompted by recent announcements by Jordan and Samoa.
It incorporates many other changes that had accumulated since 2021a.
However, it omits most proposed changes that merged all Zones
agreeing since 1970, as concerns were raised about doing too many of
these changes at once. It does keeps some of these changes in the
interest of making tzdb more equitable one step at a time; see
"Merge more location-based Zones" below.
Changes to future timestamps
Jordan now starts DST on February's last Thursday.
(Thanks to Steffen Thorsen.)
Samoa no longer observes DST. (Thanks to Geoffrey D. Bennett.)
Changes to zone name
Rename Pacific/Enderbury to Pacific/Kanton. When we added
Enderbury in 1993, we did not know that it is uninhabited and that
Kanton (population two dozen) is the only inhabited location in
that timezone. The old name is now a backward-compatility link.
Changes to past timestamps
Correct many pre-1993 transitions, fixing entries originally
derived from Shanks, Whitman, and Mundell. The fixes include:
- Barbados: standard time was introduced in 1911, not 1932; and
DST was observed in 1942-1944
- Cook Islands: In 1899 they switched from east to west of GMT,
celebrating Christmas for two days. They (and Niue) switched
to standard time in 1952, not 1901.
- Guyana: corrected LMT for Georgetown; the introduction of
standard time in 1911, not 1915; and corrections to 1975 and
1992 transitions
- Kanton: uninhabited before 1937-08-31
- Niue: only observed -11:20 from 1952 through 1964, then went to
-11 instead of -11:30
- Portugal: DST was observed in 1950
- Tonga: corrected LMT; the introduction of standard time in 1945,
not 1901; and corrections to the transition from +12:20 to +13
in 1961, not 1941
Additional fixes to entries in the 'backzone' file include:
- Enderbury: inhabited only 1860/1885 and 1938-03-06/1942-02-09
- The Gambia: 1933 and 1942 transitions
- Malawi: several 1911 through 1925 transitions
- Sierra Leone: several 1913 through 1941 transitions, and DST
was NOT observed in 1957 through 1962
(Thanks to P Chan, Michael Deckers, Alexander Krivenyshev and
Alois Treindl.)
Merge more location-based Zones whose timestamps agree since 1970,
as pre-1970 timestamps are out of scope. This is part of a
process that has been ongoing since 2013. This does not affect
post-1970 timestamps, and timezone historians who build with 'make
PACKRATDATA=backzone' should see no changes to pre-1970 timestamps.
When merging, keep the most-populous location's data, and move
data for other locations to 'backzone' with a backward
link in 'backward'. For example, move America/Creston data to
'backzone' with a link in 'backward' from America/Phoenix because
the two timezones' timestamps agree since 1970; this change
affects some pre-1968 timestamps in America/Creston because
Creston and Phoenix disagreed before 1968. The affected Zones
are Africa/Accra, America/Atikokan, America/Blanc-Sablon,
America/Creston, America/Curacao, America/Nassau,
America/Port_of_Spain, Antarctica/DumontDUrville, and
Antarctica/Syowa.
Changes to maintenance procedure
The new file SECURITY covers how to report security-related bugs.
Several backward-compatibility links have been moved to the
'backward' file. These links, which range from Africa/Addis_Ababa
to Pacific/Saipan, are only for compatibility with now-obsolete
guidelines suggesting an entry for every ISO 3166 code.
The intercontinental convenience links Asia/Istanbul and
Europe/Nicosia have also been moved to 'backward'.
Changes to code
zic now creates each output file or link atomically,
possibly by creating a temporary file and then renaming it.
This avoids races where a TZ setting would temporarily stop
working while zic was installing a replacement file or link.
zic -L no longer omits the POSIX TZ string in its output.
Starting with 2020a, zic -L truncated its output according to the
"Expires" directive or "#expires" comment in the leapseconds file.
The resulting TZif files omitted daylight saving transitions after
the leap second table expired, which led to far less-accurate
predictions of times after the expiry. Although future timestamps
cannot be converted accurately in the presence of leap seconds, it
is more accurate to convert near-future timestamps with a few
seconds error than with an hour error, so zic -L no longer
truncates output in this way.
Instead, when zic -L is given the "Expires" directive, it now
outputs the expiration by appending a no-change entry to the leap
second table. Although this should work well with most TZif
readers, it does not conform to Internet RFC 8536 and some pickier
clients (including tzdb 2017c through 2021a) reject it, so
"Expires" directives are currently disabled by default. To enable
them, set the EXPIRES_LINE Makefile variable. If a TZif file uses
this new feature it is marked with a new TZif version number 4,
a format intended to be documented in a successor to RFC 8536.
zic -L LEAPFILE -r @LO no longer generates an invalid TZif file
that omits leap second information for the range LO..B when LO
falls between two leap seconds A and B. Instead, it generates a
TZif version 4 file that represents the previously-missing
information.
The TZif reader now allows the leap second table to begin with a
correction other than -1 or +1, and to contain adjacent
transitions with equal corrections. This supports TZif version 4.
The TZif reader now lets leap seconds occur less than 28 days
apart. This supports possible future TZif extensions.
Fix bug that caused 'localtime' etc. to crash when TZ was
set to a all-year DST string like "EST5EDT4,0/0,J365/25" that does
not conform to POSIX but does conform to Internet RFC 8536.
Fix another bug that caused 'localtime' etc. to crash when TZ was
set to a POSIX-conforming but unusual TZ string like
"EST5EDT4,0/0,J365/0", where almost all the year is DST.
Fix yet another bug that caused 'localtime' etc. to mishandle slim
TZif files containing leap seconds after the last explicit
transition in the table, or when handling far-future timestamps
in slim TZif files lacking leap seconds.
Fix localtime misbehavior involving positive leap seconds.
This change affects only behavior for "right" system time,
which contains leap seconds, and only if the UT offset is
not a multiple of 60 seconds when a positive leap second occurs.
(No such timezone exists in tzdb, luckily.) Without the fix,
the timestamp was ambiguous during a positive leap second.
With the fix, any seconds occurring after a positive leap second
and within the same localtime minute are counted through 60, not
through 59; their UT offset (tm_gmtoff) is the same as before.
Here is how the fix affects timestamps in a timezone with UT
offset +01:23:45 (5025 seconds) and with a positive leap second at
1972-06-30 23:59:60 UTC (78796800):
time_t without the fix with the fix
78796800 1972-07-01 01:23:45 1972-07-01 01:23:45 (leap second)
78796801 1972-07-01 01:23:45 1972-07-01 01:23:46
...
78796815 1972-07-01 01:23:59 1972-07-01 01:23:60
78796816 1972-07-01 01:24:00 1972-07-01 01:24:00
Fix an unlikely bug that caused 'localtime' etc. to misbehave if
civil time changes a few seconds before time_t wraps around, when
leap seconds are enabled.
Fix bug in zic -r; in some cases, the dummy time type after the
last time transition disagreed with the TZ string, contrary to
Internet RFC 8563 section 3.3.
Fix a bug with 'zic -r @X' when X is a negative leap second that
has a nonnegative correction. Without the fix, the output file
was truncated so that X appeared to be a positive leap second.
Fix a similar, even-less-likely bug when truncating at a positive
leap second that has a nonpositive correction.
zic -r now reports an error if given rolling leap seconds, as this
usage has never generally worked and is evidently unused.
zic now generates a POSIX-conforming TZ string for TZif files
where all-year DST is predicted for the indefinite future.
For example, for all-year Eastern Daylight Time, zic now generates
"XXX3EDT4,0/0,J365/23" where it previously generated
"EST5EDT,0/0,J365/25" or "". (Thanks to Michael Deckers for
noting the possibility of POSIX conformance.)
zic.c no longer requires sys/wait.h (thanks to spazmodius for
noting it wasn't needed).
When reading slim TZif files, zdump no longer mishandles leap
seconds on the rare platforms where time_t counts leap seconds,
fixing a bug introduced in 2014g.
zdump -v now outputs timestamps at boundaries of what localtime
and gmtime can represent, instead of the less-useful timestamps
one day after the minimum and one day before the maximum.
(Thanks to Arthur David Olson for prototype code, and to Manuela
Friedrich for debugging help.)
zdump's -c and -t options are now consistently inclusive for the
lower time bound and exclusive for the upper. Formerly they were
inconsistent. (Confusion noted by Martin Burnicki.)
Changes to build procedure
You can now compile with -DHAVE_MALLOC_ERRNO=0 to port to
non-POSIX hosts where malloc doesn't set errno.
(Problem reported by Jan Engelhardt.)
Changes to documentation
tzfile.5 better matches a draft successor to RFC 8536
<https://datatracker.ietf.org/doc/draft-murchison-rfc8536bis/01/>.
Release 2021a - 2021-01-24 10:54:57 -0800
Changes to future timestamps
@@ -31,7 +377,7 @@ Release 2020e - 2020-12-22 15:14:34 -0800
Correct many pre-1986 transitions, fixing entries originally
derived from Shanks. The fixes include:
- Australia: several 1917 through 1971 transitions
- Bahamas: several 1941 through 1945 transitions
- The Bahamas: several 1941 through 1945 transitions
- Bermuda: several 1917 through 1956 transitions
- Belize: several 1942 through 1968 transitions
- Ghana: several 1915 through 1956 transitions
@@ -287,13 +633,13 @@ Release 2019c - 2019-09-11 08:59:48 -0700
probably wrong.)
Fix several errors in pre-1970 transitions in Perry County, IN.
(Thanks to Alois Triendl for pointing out the 1967/9 errors.)
(Thanks to Alois Treindl for pointing out the 1967/9 errors.)
Edmonton did not observe DST in 1967 or 1969. In 1946 Vancouver
ended DST on 09-29 not 10-13, and Vienna ended DST on 10-07 not
10-06. In 1945 Königsberg (now Kaliningrad) switched from +01/+02
to +02/+03 on 04-10 not 01-01, and its +02/+03 is abbreviated
EET/EEST, not CET/CEST. (Thanks to Alois Triendl.) In 1946
EET/EEST, not CET/CEST. (Thanks to Alois Treindl.) In 1946
Königsberg switched to +03 on 04-07 not 01-01.
In 1946 Louisville switched from CST to CDT on 04-28 at 00:01, not
@@ -825,8 +1171,8 @@ Release 2018d - 2018-03-22 07:05:46 -0700
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.)
East Kiribati 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
+3 -3
View File
@@ -1,10 +1,10 @@
[
{
"Name": "IANA Time Zone Database",
"Name": "openEuler:tzdata",
"License": "BSD 3-Clause License",
"License File": "LICENSE",
"Version Number": "2021a",
"Upstream URL": "https://data.iana.org/time-zones/releases/tzcode2021a.tar.gz, https://data.iana.org/time-zones/releases/tzdata2021a.tar.gz",
"Version Number": "2022a",
"Upstream URL": "https://repo.openeuler.org/openEuler-22.03-LTS-SP1/source/Packages/tzdata-2022a-11.oe2203sp1.src.rpm",
"Description": "The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe."
}
]
+22 -106
View File
@@ -30,9 +30,6 @@
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# https://www.jstor.org/stable/1774359
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
# European-style abbreviations are commonly used along the Mediterranean.
# For sub-Saharan Africa abbreviations were less standardized.
# Previous editions of this database used WAT, CAT, SAT, and EAT
@@ -153,8 +150,9 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Abidjan -0:16:08 - LMT 1912
0:00 - GMT
Link Africa/Abidjan Africa/Accra # Ghana
Link Africa/Abidjan Africa/Bamako # Mali
Link Africa/Abidjan Africa/Banjul # Gambia
Link Africa/Abidjan Africa/Banjul # The Gambia
Link Africa/Abidjan Africa/Conakry # Guinea
Link Africa/Abidjan Africa/Dakar # Senegal
Link Africa/Abidjan Africa/Freetown # Sierra Leone
@@ -381,93 +379,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# Gabon
# See Africa/Lagos.
# Gambia
# See Africa/Abidjan.
# The Gambia
# Ghana
# From P Chan (2020-11-20):
# Interpretation Amendment Ordinance, 1915 (No.24 of 1915) [1915-11-02]
# Ordinances of the Gold Coast, Ashanti, Northern Territories 1915, p 69-71
# https://books.google.com/books?id=ErA-AQAAIAAJ&pg=PA70
# This Ordinance added "'Time' shall mean Greenwich Mean Time" to the
# Interpretation Ordinance, 1876.
#
# Determination of the Time Ordinance, 1919 (No. 18 of 1919) [1919-11-24]
# Ordinances of the Gold Coast, Ashanti, Northern Territories 1919, p 75-76
# https://books.google.com/books?id=MbA-AQAAIAAJ&pg=PA75
# This Ordinance removed the previous definition of time and introduced DST.
#
# Time Determination Ordinance (Cap. 214)
# The Laws of the Gold Coast (including Togoland Under British Mandate)
# Vol. II (1937), p 2328
# https://books.google.com/books?id=Z7M-AQAAIAAJ&pg=PA2328
# Revised edition of the 1919 Ordinance.
#
# Time Determination (Amendment) Ordinance, 1940 (No. 9 of 1940) [1940-04-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1940, p 22
# https://books.google.com/books?id=1ao-AQAAIAAJ&pg=PA22
# This Ordinance changed the forward transition from September to May.
#
# Defence (Time Determination Ordinance Amendment) Regulations, 1942
# (Regulations No. 6 of 1942) [1942-01-31, commenced on 1942-02-08]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1942, p 48
# https://books.google.com/books?id=Das-AQAAIAAJ&pg=PA48
# These regulations advanced the [standard] time by thirty minutes.
#
# Defence (Time Determination Ordinance Amendment (No.2)) Regulations,
# 1942 (Regulations No. 28 of 1942) [1942-04-25]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1942, p 87
# https://books.google.com/books?id=Das-AQAAIAAJ&pg=PA87
# These regulations abolished DST and changed the time to GMT+0:30.
#
# Defence (Revocation) (No.4) Regulations, 1945 (Regulations No. 45 of
# 1945) [1945-10-24, commenced on 1946-01-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1945, p 256
# https://books.google.com/books?id=9as-AQAAIAAJ&pg=PA256
# These regulations revoked the previous two sets of Regulations.
#
# Time Determination (Amendment) Ordinance, 1945 (No. 18 of 1945) [1946-01-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1945, p 69
# https://books.google.com/books?id=9as-AQAAIAAJ&pg=PA69
# This Ordinance abolished DST.
#
# Time Determination (Amendment) Ordinance, 1950 (No. 26 of 1950) [1950-07-22]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1950, p 35
# https://books.google.com/books?id=e60-AQAAIAAJ&pg=PA35
# This Ordinance restored DST but with thirty minutes offset.
#
# Time Determination Ordinance (Cap. 264)
# The Laws of the Gold Coast, Vol. V (1954), p 380
# https://books.google.com/books?id=Mqc-AQAAIAAJ&pg=PA380
# Revised edition of the Time Determination Ordinance.
#
# Time Determination (Amendment) Ordinance, 1956 (No. 21 of 1956) [1956-08-29]
# Annual Volume of the Ordinances of the Gold Coast Enacted During the
# Year 1956, p 83
# https://books.google.com/books?id=VLE-AQAAIAAJ&pg=PA83
# This Ordinance abolished DST.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Ghana 1919 only - Nov 24 0:00 0:20 +0020
Rule Ghana 1920 1942 - Jan 1 2:00 0 GMT
Rule Ghana 1920 1939 - Sep 1 2:00 0:20 +0020
Rule Ghana 1940 1941 - May 1 2:00 0:20 +0020
Rule Ghana 1950 1955 - Sep 1 2:00 0:30 +0030
Rule Ghana 1951 1956 - Jan 1 2:00 0 GMT
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Accra -0:00:52 - LMT 1915 Nov 2
0:00 Ghana %s 1942 Feb 8
0:30 - +0030 1946 Jan 6
0:00 Ghana %s
# Guinea
# See Africa/Abidjan.
@@ -732,7 +645,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# See Africa/Nairobi.
# Morocco
# See the 'europe' file for Spanish Morocco (Africa/Ceuta).
# See Africa/Ceuta for Spanish Morocco.
# From Alex Krivenyshev (2008-05-09):
# Here is an article that Morocco plan to introduce Daylight Saving Time between
@@ -1005,6 +918,10 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
#
# From Milamber (2021-03-31, 2022-03-10), confirming these predictions:
# https://www.mmsp.gov.ma/fr/actualites.aspx?id=2076
# https://www.ecoactu.ma/horaires-administration-ramadan-gmtheure-gmt-a-partir-de-dimanche-27-mars/
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 -
@@ -1382,23 +1299,21 @@ Zone Africa/Lagos 0:13:35 - LMT 1905 Jul 1
0:13:35 - LMT 1914 Jan 1
0:30 - +0030 1919 Sep 1
1:00 - WAT
Link Africa/Lagos Africa/Bangui # Central African Republic
Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo
Link Africa/Lagos Africa/Douala # Cameroon
Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west)
Link Africa/Lagos Africa/Libreville # Gabon
Link Africa/Lagos Africa/Luanda # Angola
Link Africa/Lagos Africa/Malabo # Equatorial Guinea
Link Africa/Lagos Africa/Niamey # Niger
Link Africa/Lagos Africa/Porto-Novo # Benin
Link Africa/Lagos Africa/Bangui # Central African Republic
Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo
Link Africa/Lagos Africa/Douala # Cameroon
Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west)
Link Africa/Lagos Africa/Libreville # Gabon
Link Africa/Lagos Africa/Luanda # Angola
Link Africa/Lagos Africa/Malabo # Equatorial Guinea
Link Africa/Lagos Africa/Niamey # Niger
Link Africa/Lagos Africa/Porto-Novo # Benin
# Réunion
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis
4:00 - +04
#
# Crozet Islands also observes Réunion time; see the 'antarctica' file.
#
# Scattered Islands (Îles Éparses) administered from Réunion are as follows.
# The following information about them is taken from
# Îles Éparses (<http://www.outre-mer.gouv.fr/domtom/ile.htm>, 1997-07-22,
@@ -1490,8 +1405,8 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 -
Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
1:30 - SAST 1903 Mar
2:00 SA SAST
Link Africa/Johannesburg Africa/Maseru # Lesotho
Link Africa/Johannesburg Africa/Mbabane # Eswatini
Link Africa/Johannesburg Africa/Maseru # Lesotho
Link Africa/Johannesburg Africa/Mbabane # Eswatini
#
# Marion and Prince Edward Is
# scientific station since 1947
@@ -1527,12 +1442,13 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
3:00 - EAT 2017 Nov 1
2:00 - CAT
# South Sudan
# From Steffen Thorsen (2021-01-18):
# "South Sudan will change its time zone by setting the clock back 1
# hour on February 1, 2021...."
# from https://eyeradio.org/south-sudan-adopts-new-time-zone-makuei/
# South Sudan
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Juba 2:06:28 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
@@ -1637,7 +1553,7 @@ Rule Tunisia 2005 only - Sep 30 1:00s 0 -
Rule Tunisia 2006 2008 - Mar lastSun 2:00s 1:00 S
Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 -
# See Europe/Paris for PMT-related transitions.
# See Europe/Paris commentary for PMT-related transitions.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
0:09:21 - PMT 1911 Mar 11 # Paris Mean Time
+3 -26
View File
@@ -148,7 +148,7 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
#
# Alfred Faure, Possession Island, Crozet Islands, -462551+0515152, since 1964;
# sealing & whaling stations operated variously 1802/1911+;
# see Indian/Reunion.
# see Asia/Dubai.
#
# Martin-de-Viviès, Amsterdam Island, -374105+0773155, since 1950
# Port-aux-Français, Kerguelen Islands, -492110+0701303, since 1951;
@@ -162,17 +162,7 @@ Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
5:00 - +05
#
# year-round base in the main continent
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/DumontDUrville 0 - -00 1947
10:00 - +10 1952 Jan 14
0 - -00 1956 Nov
10:00 - +10
# Dumont d'Urville - see Pacific/Port_Moresby.
# France & Italy - year-round base
# Concordia, -750600+1232000, since 2005
@@ -188,20 +178,7 @@ Zone Antarctica/DumontDUrville 0 - -00 1947
# Zuchelli, Terra Nova Bay, -744140+1640647, since 1986
# Japan - year-round bases
# Syowa (also known as Showa), -690022+0393524, since 1957
#
# From Hideyuki Suzuki (1999-02-06):
# In all Japanese stations, +0300 is used as the standard time.
#
# Syowa station, which is the first antarctic station of Japan,
# was established on 1957-01-29. Since Syowa station is still the main
# station of Japan, it's appropriate for the principal location.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Syowa 0 - -00 1957 Jan 29
3:00 - +03
# See:
# NIPR Antarctic Research Activities (1999-08-17)
# http://www.nipr.ac.jp/english/ara01.html
# See Asia/Riyadh.
# S Korea - year-round base
# Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014
+39 -13
View File
@@ -34,9 +34,6 @@
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
# (See the 'europe' file for a fuller citation.)
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
# The following alphabetic abbreviations appear in these tables
# (corrections are welcome):
# std dst
@@ -2234,6 +2231,14 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# From Paul Eggert (2013-12-11):
# As Steffen suggested, consider the past 21-month experiment to be DST.
# From Steffen Thorsen (2021-09-24):
# The Jordanian Government announced yesterday that they will start DST
# in February instead of March:
# https://petra.gov.jo/Include/InnerPage.jsp?ID=37683&lang=en&name=en_news (English)
# https://petra.gov.jo/Include/InnerPage.jsp?ID=189969&lang=ar&name=news (Arabic)
# From the Arabic version, it seems to say it would be at midnight
# (assume 24:00) on the last Thursday in February, starting from 2022.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Jordan 1973 only - Jun 6 0:00 1:00 S
Rule Jordan 1973 1975 - Oct 1 0:00 0 -
@@ -2264,8 +2269,9 @@ Rule Jordan 2004 only - Oct 15 0:00s 0 -
Rule Jordan 2005 only - Sep lastFri 0:00s 0 -
Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 -
Rule Jordan 2013 only - Dec 20 0:00 0 -
Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S
Rule Jordan 2014 2021 - Mar lastThu 24:00 1:00 S
Rule Jordan 2014 max - Oct lastFri 0:00s 0 -
Rule Jordan 2022 max - Feb lastThu 24:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Amman 2:23:44 - LMT 1931
2:00 Jordan EE%sT
@@ -2740,7 +2746,8 @@ Rule NBorneo 1935 1941 - Dec 14 0:00 0 -
#
# peninsular Malaysia
# taken from Mok Ly Yng (2003-10-30)
# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html
# https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html
# This agrees with Singapore since 1905-06-01.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1
6:55:25 - SMT 1905 Jun 1 # Singapore M.T.
@@ -3379,11 +3386,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes.
# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584
# From Tim Parenti (2020-10-20):
# Predict future fall transitions at 01:00 on the Saturday preceding October's
# last Sunday (i.e., Sat>=24). This is consistent with our predictions since
# 2016, although the time of the change differed slightly in 2019.
# From Pierre Cashon (2020-10-20):
# The summer time this year started on March 28 at 00:00.
# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ
@@ -3396,6 +3398,21 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# For now, guess spring-ahead transitions are at 00:00 on the Saturday
# preceding March's last Sunday (i.e., Sat>=24).
# From P Chan (2021-10-18):
# http://wafa.ps/Pages/Details/34701
# Palestine winter time will start from midnight 2021-10-29 (Thursday-Friday).
#
# From Heba Hemad, Palestine Ministry of Telecom & IT (2021-10-20):
# ... winter time will begin in Palestine from Friday 10-29, 01:00 AM
# by 60 minutes backwards.
#
# From Tim Parenti (2021-10-25), per Paul Eggert (2021-10-24):
# Guess future fall transitions at 01:00 on the Friday preceding October's
# last Sunday (i.e., Fri>=23), as this is more consistent with recent practice.
# From Heba Hamad (2022-03-10):
# summer time will begin in Palestine from Sunday 03-27-2022, 00:00 AM.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 -
@@ -3430,8 +3447,10 @@ Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S
Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 -
Rule Palestine 2019 only - Mar 29 0:00 1:00 S
Rule Palestine 2019 only - Oct Sat>=24 0:00 0 -
Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S
Rule Palestine 2020 max - Oct Sat>=24 1:00 0 -
Rule Palestine 2020 2021 - Mar Sat>=24 0:00 1:00 S
Rule Palestine 2020 only - Oct 24 1:00 0 -
Rule Palestine 2021 max - Oct Fri>=23 1:00 0 -
Rule Palestine 2022 max - Mar Sun>=25 0:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
@@ -3500,6 +3519,12 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
# influence of the sources. There is no current abbreviation for DST,
# so use "PDT", the usual American style.
# From P Chan (2021-05-10):
# Here's a fairly comprehensive article in Japanese:
# https://wiki.suikawiki.org/n/Philippine%20Time
# From Paul Eggert (2021-05-10):
# The info in the Japanese table has not been absorbed (yet) below.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Phil 1936 only - Nov 1 0:00 1:00 D
Rule Phil 1937 only - Feb 1 0:00 0 S
@@ -3566,12 +3591,13 @@ Link Asia/Qatar Asia/Bahrain
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
3:00 - +03
Link Asia/Riyadh Antarctica/Syowa
Link Asia/Riyadh Asia/Aden # Yemen
Link Asia/Riyadh Asia/Kuwait
# Singapore
# taken from Mok Ly Yng (2003-10-30)
# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html
# https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
6:55:25 - SMT 1905 Jun 1 # Singapore M.T.
+123 -18
View File
@@ -385,9 +385,22 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# "Minister for Employment, Parveen Bala says they had never thought of
# stopping daylight saving. He says it was just to decide on when it should
# start and end. Bala says it is a short period..."
# Since the end date is still in line with our ongoing predictions, assume for
# now that the later-than-usual start date is a one-time departure from the
# recent second Sunday in November pattern.
#
# From Tim Parenti (2021-10-11), per Jashneel Kumar (2021-10-11) and P Chan
# (2021-10-12):
# https://www.fiji.gov.fj/Media-Centre/Speeches/English/PM-BAINIMARAMA-S-COVID-19-ANNOUNCEMENT-10-10-21
# https://www.fbcnews.com.fj/news/covid-19/curfew-moved-back-to-11pm/
# In a 2021-10-10 speech concerning updated Covid-19 mitigation measures in
# Fiji, prime minister Josaia Voreqe "Frank" Bainimarama announced the
# suspension of DST for the 2021/2022 season: "Given that we are in the process
# of readjusting in the midst of so many changes, we will also put Daylight
# Savings Time on hold for this year. It will also make the reopening of
# scheduled commercial air service much smoother if we don't have to be
# concerned shifting arrival and departure times, which may look like a simple
# thing but requires some significant logistical adjustments domestically and
# internationally."
# Assume for now that DST will resume with the recent pre-2020 rules for the
# 2022/2023 season.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 -
@@ -399,10 +412,11 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 2015 max - Jan Sun>=12 3:00 0 -
Rule Fiji 2015 2021 - Jan Sun>=12 3:00 0 -
Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2020 only - Dec 20 2:00 1:00 -
Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2022 max - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2023 max - Jan Sun>=12 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13
@@ -464,7 +478,7 @@ Link Pacific/Guam Pacific/Saipan # N Mariana Is
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki
12:00 - +12
Zone Pacific/Enderbury -11:24:20 - LMT 1901
Zone Pacific/Kanton 0 - -00 1937 Aug 31
-12:00 - -12 1979 Oct
-11:00 - -11 1994 Dec 31
13:00 - +13
@@ -597,13 +611,46 @@ Link Pacific/Auckland Antarctica/McMurdo
# was probably like Pacific/Auckland
# Cook Is
# From Shanks & Pottenger:
#
# From Alexander Krivenyshev (2021-03-24):
# In 1899 the Cook Islands celebrated Christmas twice to correct the calendar.
# According to the old books, missionaries were unaware of
# the International Date line, when they came from Sydney.
# Thus the Cook Islands were one day ahead....
# http://nzetc.victoria.ac.nz/tm/scholarly/tei-KloDisc-t1-body-d18.html
# ... Appendix to the Journals of the House of Representatives, 1900
# https://atojs.natlib.govt.nz/cgi-bin/atojs?a=d&d=AJHR1900-I.2.1.2.3
# (page 20)
#
# From Michael Deckers (2021-03-24):
# ... in the Cook Island Act of 1915-10-11, online at
# http://www.paclii.org/ck/legis/ck-nz_act/cia1915132/
# "651. The hour of the day shall in each of the islands included in the
# Cook Islands be determined in accordance with the meridian of that island."
# so that local (mean?) time was still used in Rarotonga (and Niue) in 1915.
# This was changed in the Cook Island Amendment Act of 1952-10-16 ...
# http://www.paclii.org/ck/legis/ck-nz_act/ciaa1952212/
# "651 (1) The hour of the day in each of the islands included in the Cook
# Islands, other than Niue, shall be determined as if each island were
# situated on the meridian one hundred and fifty-seven degrees thirty minutes
# West of Greenwich. (2) The hour of the day in the Island of Niue shall be
# determined as if that island were situated on the meridian one hundred and
# seventy degrees West of Greenwich."
# This act does not state when it takes effect, so one has to assume it
# applies since 1952-10-16. But there is the possibility that the act just
# legalized prior existing practice, as we had seen with the Guernsey law of
# 1913-06-18 for the switch in 1909-04-19.
#
# From Paul Eggert (2021-03-24):
# Transitions after 1952 are from Shanks & Pottenger.
#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Cook 1978 only - Nov 12 0:00 0:30 -
Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 -
Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua
Zone Pacific/Rarotonga 13:20:56 - LMT 1899 Dec 26 # Avarua
-10:39:04 - LMT 1952 Oct 16
-10:30 - -1030 1978 Nov 12
-10:00 Cook -10/-0930
@@ -611,10 +658,18 @@ Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua
# Niue
# See Pacific/Raratonga comments for 1952 transition.
#
# From Tim Parenti (2021-09-13):
# Consecutive contemporaneous editions of The Air Almanac listed -11:20 for
# Niue as of Apr 1964 but -11 as of Aug 1964:
# Apr 1964: https://books.google.com/books?id=_1So677Y5vUC&pg=SL1-PA23
# Aug 1964: https://books.google.com/books?id=MbJloqd-zyUC&pg=SL1-PA23
# Without greater specificity, guess 1964-07-01 for this transition.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Niue -11:19:40 - LMT 1901 # Alofi
-11:20 - -1120 1951
-11:30 - -1130 1978 Oct 1
Zone Pacific/Niue -11:19:40 - LMT 1952 Oct 16 # Alofi
-11:20 - -1120 1964 Jul
-11:00 - -11
# Norfolk
@@ -638,6 +693,7 @@ Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror
Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
9:48:32 - PMMT 1895 # Port Moresby Mean Time
10:00 - +10
Link Pacific/Port_Moresby Antarctica/DumontDUrville
#
# From Paul Eggert (2014-10-13):
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
@@ -742,13 +798,17 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
# From Paul Eggert (2014-07-08):
# That web page currently lists transitions for 2012/3 and 2013/4.
# Assume the pattern instituted in 2012 will continue indefinitely.
#
# From Geoffrey D. Bennett (2021-09-20):
# https://www.mcil.gov.ws/storage/2021/09/MCIL-Scan_20210920_120553.pdf
# DST has been cancelled for this year.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule WS 2010 only - Sep lastSun 0:00 1 -
Rule WS 2011 only - Apr Sat>=1 4:00 0 -
Rule WS 2011 only - Sep lastSat 3:00 1 -
Rule WS 2012 max - Apr Sun>=1 4:00 0 -
Rule WS 2012 max - Sep lastSun 3:00 1 -
Rule WS 2012 2021 - Apr Sun>=1 4:00 0 -
Rule WS 2012 2020 - Sep lastSun 3:00 1 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5
-11:26:56 - LMT 1911
@@ -795,8 +855,8 @@ Rule Tonga 2001 2002 - Jan lastSun 2:00 0 -
Rule Tonga 2016 only - Nov Sun>=1 2:00 1:00 -
Rule Tonga 2017 only - Jan Sun>=15 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
12:20 - +1220 1941
Zone Pacific/Tongatapu 12:19:12 - LMT 1945 Sep 10
12:20 - +1220 1961
13:00 - +13 1999
13:00 Tonga +13/+14
@@ -1738,6 +1798,23 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# One source for this is page 202 of: Bartky IR. One Time Fits All:
# The Campaigns for Global Uniformity (2007).
# Kanton
# From Paul Eggert (2021-05-27):
# Kiribati's +13 timezone is represented by Kanton, its only populated
# island. (It was formerly spelled "Canton", but Gilbertese lacks "C".)
# Kanton was settled on 1937-08-31 by two British radio operators
# <https://history.state.gov/historicaldocuments/frus1937v02/d94>;
# Americans came the next year and built an airfield, partly to
# establish airline service and perhaps partly anticipating the
# next war. Aside from the war, the airfield was used by commercial
# airlines until long-range jets became standard; although currently
# for emergency use only, China says it is considering rebuilding the
# airfield for high-end niche tourism. Kanton has about two dozen
# people, caretakers who rotate in from the rest of Kiribati in 2-5
# year shifts, and who use some of the leftover structures
# <http://pipa.neaq.org/2012/06/images-of-kanton-island.html>.
# Kwajalein
# From an AP article (1993-08-22):
@@ -2021,6 +2098,17 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Tonga
# From Paul Eggert (2021-03-04):
# In 1943 "The standard time kept is 12 hrs. 19 min. 12 sec. fast
# on Greenwich mean time." according to the Admiralty's Hydrographic
# Dept., Pacific Islands Pilot, Vol. II, 7th ed., 1943, p 360.
# From Michael Deckers (2021-03-03):
# [Ian R Bartky: "One Time Fits All: The Campaigns for Global Uniformity".
# Stanford University Press. 2007. p. 255]:
# On 10 September 1945 Tonga adopted a standard time 12 hours,
# 20 minutes in advance of Greenwich.
# From Paul Eggert (1996-01-22):
# Today's _Wall Street Journal_ (p 1) reports that "Tonga has been plotting
# to sneak ahead of [New Zealanders] by introducing daylight-saving time."
@@ -2049,9 +2137,26 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# The Crown Prince, presented an unanswerable argument: "Remember that
# on the World Day of Prayer, you would be the first people on Earth
# to say your prayers in the morning."
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
#
# From Tim Parenti (2021-09-13), per Paul Eggert (2006-03-22) and Michael
# Deckers (2021-03-03):
# Mundell places the transition from +12:20 to +13 in 1941, while Shanks &
# Pottenger say the transition was on 1968-10-01.
#
# The Air Almanac published contemporaneous tables of standard times,
# which listed +12:20 as of Nov 1960 and +13 as of Mar 1961:
# Nov 1960: https://books.google.com/books?id=bVgtWM6kPZUC&pg=SL1-PA19
# Mar 1961: https://books.google.com/books?id=W2nItAul4g0C&pg=SL1-PA19
# (Thanks to P Chan for pointing us toward these sources.)
# This agrees with Bartky, who writes that "since 1961 [Tonga's] official time
# has been thirteen hours in advance of Greenwich time" (p. 202) and further
# writes in an endnote that this was because "the legislation was amended" on
# 1960-10-19. (p. 255)
#
# Without greater specificity, presume that Bartky and the Air Almanac point to
# a 1961-01-01 transition, as Tāufaʻāhau Tupou IV was still Crown Prince in
# 1961 and this still jives with the gist of Mundell's telling, and go with
# this over Shanks & Pottenger.
# From Eric Ulevik (1999-05-03):
# Tonga's director of tourism, who is also secretary of the National Millennium
+7 -4
View File
@@ -3,8 +3,10 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This file provides links between current names for timezones
# and their old names. Many names changed in late 1993.
# This file provides links from old or merged timezone names to current ones.
# Many names changed in late 1993. Several of these names are
# also present in the file 'backzone', which has data important only
# for pre-1970 timestamps and so is out of scope for tzdb proper.
# Link TARGET LINK-NAME
Link Africa/Nairobi Africa/Asmera
@@ -13,7 +15,7 @@ Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
Link America/Argentina/Buenos_Aires America/Buenos_Aires
Link America/Argentina/Catamarca America/Catamarca
Link America/Atikokan America/Coral_Harbour
Link America/Panama America/Coral_Harbour
Link America/Argentina/Cordoba America/Cordoba
Link America/Tijuana America/Ensenada
Link America/Indiana/Indianapolis America/Fort_Wayne
@@ -28,7 +30,7 @@ Link America/Rio_Branco America/Porto_Acre
Link America/Argentina/Cordoba America/Rosario
Link America/Tijuana America/Santa_Isabel
Link America/Denver America/Shiprock
Link America/Port_of_Spain America/Virgin
Link America/Puerto_Rico America/Virgin
Link Pacific/Auckland Antarctica/South_Pole
Link Asia/Ashgabat Asia/Ashkhabad
Link Asia/Kolkata Asia/Calcutta
@@ -103,6 +105,7 @@ Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
Link Asia/Shanghai PRC
Link Pacific/Kanton Pacific/Enderbury
Link Pacific/Honolulu Pacific/Johnston
Link Pacific/Pohnpei Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
+416 -21
View File
@@ -68,6 +68,91 @@
#
# As explained in the zic man page, the zone columns are:
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# and the rule columns are:
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
# Ghana
# From P Chan (2020-11-20):
# Interpretation Amendment Ordinance, 1915 (No.24 of 1915) [1915-11-02]
# Ordinances of the Gold Coast, Ashanti, Northern Territories 1915, p 69-71
# https://books.google.com/books?id=ErA-AQAAIAAJ&pg=PA70
# This Ordinance added "'Time' shall mean Greenwich Mean Time" to the
# Interpretation Ordinance, 1876.
#
# Determination of the Time Ordinance, 1919 (No. 18 of 1919) [1919-11-24]
# Ordinances of the Gold Coast, Ashanti, Northern Territories 1919, p 75-76
# https://books.google.com/books?id=MbA-AQAAIAAJ&pg=PA75
# This Ordinance removed the previous definition of time and introduced DST.
#
# Time Determination Ordinance (Cap. 214)
# The Laws of the Gold Coast (including Togoland Under British Mandate)
# Vol. II (1937), p 2328
# https://books.google.com/books?id=Z7M-AQAAIAAJ&pg=PA2328
# Revised edition of the 1919 Ordinance.
#
# Time Determination (Amendment) Ordinance, 1940 (No. 9 of 1940) [1940-04-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1940, p 22
# https://books.google.com/books?id=1ao-AQAAIAAJ&pg=PA22
# This Ordinance changed the forward transition from September to May.
#
# Defence (Time Determination Ordinance Amendment) Regulations, 1942
# (Regulations No. 6 of 1942) [1942-01-31, commenced on 1942-02-08]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1942, p 48
# https://books.google.com/books?id=Das-AQAAIAAJ&pg=PA48
# These regulations advanced the [standard] time by thirty minutes.
#
# Defence (Time Determination Ordinance Amendment (No.2)) Regulations,
# 1942 (Regulations No. 28 of 1942) [1942-04-25]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1942, p 87
# https://books.google.com/books?id=Das-AQAAIAAJ&pg=PA87
# These regulations abolished DST and changed the time to GMT+0:30.
#
# Defence (Revocation) (No.4) Regulations, 1945 (Regulations No. 45 of
# 1945) [1945-10-24, commenced on 1946-01-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1945, p 256
# https://books.google.com/books?id=9as-AQAAIAAJ&pg=PA256
# These regulations revoked the previous two sets of Regulations.
#
# Time Determination (Amendment) Ordinance, 1945 (No. 18 of 1945) [1946-01-06]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1945, p 69
# https://books.google.com/books?id=9as-AQAAIAAJ&pg=PA69
# This Ordinance abolished DST.
#
# Time Determination (Amendment) Ordinance, 1950 (No. 26 of 1950) [1950-07-22]
# Annual Volume of the Laws of the Gold Coast:
# Containing All Legislation Enacted During Year 1950, p 35
# https://books.google.com/books?id=e60-AQAAIAAJ&pg=PA35
# This Ordinance restored DST but with thirty minutes offset.
#
# Time Determination Ordinance (Cap. 264)
# The Laws of the Gold Coast, Vol. V (1954), p 380
# https://books.google.com/books?id=Mqc-AQAAIAAJ&pg=PA380
# Revised edition of the Time Determination Ordinance.
#
# Time Determination (Amendment) Ordinance, 1956 (No. 21 of 1956) [1956-08-29]
# Annual Volume of the Ordinances of the Gold Coast Enacted During the
# Year 1956, p 83
# https://books.google.com/books?id=VLE-AQAAIAAJ&pg=PA83
# This Ordinance abolished DST.
Rule Ghana 1919 only - Nov 24 0:00 0:20 +0020
Rule Ghana 1920 1942 - Jan 1 2:00 0 GMT
Rule Ghana 1920 1939 - Sep 1 2:00 0:20 +0020
Rule Ghana 1940 1941 - May 1 2:00 0:20 +0020
Rule Ghana 1950 1955 - Sep 1 2:00 0:30 +0030
Rule Ghana 1951 1956 - Jan 1 2:00 0 GMT
Zone Africa/Accra -0:00:52 - LMT 1915 Nov 2
0:00 Ghana %s 1942 Feb 8
0:30 - +0030 1946 Jan 6
0:00 Ghana %s
# Ethiopia
# From Paul Eggert (2014-07-31):
@@ -101,14 +186,36 @@ Zone Africa/Bamako -0:32:00 - LMT 1912
Zone Africa/Bangui 1:14:20 - LMT 1912
1:00 - WAT
# Gambia
# The Gambia
# From P Chan (2020-12-09):
# Standard time of GMT-1 was adopted on 1933-04-01. On 1942-02-01, GMT was
# adopted as a war time measure. This was made permanent in 1946.
#
# Interpretation Ordinance, 1914 (No. 12 of 1914) [1914-09-29]
# Interpretation Ordinance, 1933 (No. 10 of 1933) [1933-03-31]
# Notice No. 5 of 1942, Colony of the Gambia Government Gazette, Vol. LIX,
# No.2, 1942-01-15, p 2
# Interpretation (Amendment) Ordinance, 1946 (No. 3 of 1946) [1946-07-15]
Zone Africa/Banjul -1:06:36 - LMT 1912
-1:06:36 - BMT 1935 # Banjul Mean Time
-1:00 - -01 1964
-1:06:36 - BMT 1933 Apr 1 # Banjul Mean Time
-1:00 - -01 1942 Feb 1 0:00
0:00 - GMT
# Malawi
Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar
# From P Chan (2020-12-09):
# In 1911, Zomba mean time was adopted as the legal time of Nyasaland. In
# 1914, Zomba mean time switched from GMT+2:21:10 to GMT+2:21. On 1925-07-01,
# GMT+2 was adopted.
#
# Interpretation and General Clauses Ordinance, 1911 (No. 12 of 1911)
# [1911-07-24]
# Notice No. 124 of 1914, 1914-06-30, The Nyasaland Government Gazette, Vol.
# XXI, No. 8, 1914-06-30, p 122
# Interpretation and General Clauses (Amendment) Ordinance, 1925 (No. 3 of
# 1925) [1925-04-02]
Zone Africa/Blantyre 2:20:00 - LMT 1911 Jul 24
2:21:10 - ZMT 1914 Jun 30 # Zomba Mean Time
2:21 - ZMT 1925 Jul 1
2:00 - CAT
# Republic of the Congo
@@ -145,19 +252,49 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
Zone Africa/Douala 0:38:48 - LMT 1912
1:00 - WAT
# Sierra Leone
# From Paul Eggert (2014-08-12):
# The following table is from Shanks & Pottenger, but it can't be right.
# Whitman gives Mar 31 - Aug 31 for 1931 on.
# The International Hydrographic Bulletin, 1932-33, p 63 says that
# Sierra Leone would advance its clocks by 20 minutes on 1933-10-01.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule SL 1935 1942 - Jun 1 0:00 0:40 -0020
Rule SL 1935 1942 - Oct 1 0:00 0 -01
Rule SL 1957 1962 - Jun 1 0:00 1:00 +01
Rule SL 1957 1962 - Sep 1 0:00 0 GMT
# From P Chan (2020-12-09):
# Standard time of GMT-1 was adopted on 1913-07-01. Twenty minutes of DST was
# introduce[d] in 1932 and was suspended in 1939. In 1941, GMT was adopted by
# Defence Regulations. This was made permanent in 1946.
#
# Government Notice No. 121 of 1913, 1913-06-06, Sierra Leone Royal Gazette,
# Vol. XLIV, No. 1384, 1913-06-14, p 347
# Alteration of Time Ordinance, 1932 (No. 34 of 1932) [1932-12-01]
# Alteration of Time (Amendment) Ordinance, 1938 (No. 25 of 1938) [1938-11-24]
# Defence Regulations (No. 9), 1939 (Regulations No. 9 of 1939), 1939-09-05
# Defence Regulations (No. 11), 1939 (Regulations No. 11 of 1939), 1939-09-27
# Defence (Amendment) (No. 17) Regulations, 1941 (Public Notice No. 157 of
# 1941), 1914-12-04
# Alteration of Time (Amendment) Ordinance, 1946 (No. 2 of 1946) [1946-02-07]
# From Tim Parenti (2021-03-02), per P Chan (2021-02-25):
# For Sierra Leone in 1957-1962, the standard time was defined in the
# Alteration of Time Ordinance, 1932 (as amended in 1946, renamed to Local Time
# Ordinance in 1960 and Local Time Act in 1961). It was unamended throughout
# that period. See references to "Time" in the Alphabetical Index of the
# Legislation in force on the 31st day of December,
# 1957: https://books.google.com/books?id=lvQ-AQAAIAAJ&pg=RA2-PA49
# 1958: https://books.google.com/books?id=4fQ-AQAAIAAJ&pg=RA2-PA50
# 1959: https://books.google.com/books?id=p_U-AQAAIAAJ&pg=RA2-PA55
# 1960: https://books.google.com/books?id=JPY-AQAAIAAJ&pg=RA3-PA37
# 1961: https://books.google.com/books?id=7vY-AQAAIAAJ&pg=RA3-PA41
# 1962: https://books.google.com/books?id=W_c-AQAAIAAJ&pg=RA3-PA44
# 1963: https://books.google.com/books?id=9vk-AQAAIAAJ&pg=RA1-PA47
#
# Although Shanks & Pottenger had DST from Jun 1 00:00 to Sep 1 00:00 in this
# period, many contemporaneous almanacs agree that it wasn't used:
# https://mm.icann.org/pipermail/tz/2021-February/029866.html
# Go with the above.
Rule SL 1932 only - Dec 1 0:00 0:20 -0040
Rule SL 1933 1938 - Mar 31 24:00 0 -01
Rule SL 1933 1939 - Aug 31 24:00 0:20 -0040
Rule SL 1939 only - May 31 24:00 0 -01
Zone Africa/Freetown -0:53:00 - LMT 1882
-0:53:00 - FMT 1913 Jun # Freetown Mean Time
-1:00 SL %s 1957
-0:53:00 - FMT 1913 Jul 1 # Freetown MT
-1:00 SL %s 1939 Sep 5
-1:00 - -01 1941 Dec 6 24:00
0:00 SL GMT/+01
# Botswana
@@ -209,7 +346,15 @@ Zone Africa/Luanda 0:52:56 - LMT 1892
1:00 - WAT
# Democratic Republic of the Congo (east)
Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
#
# From Alois Treindl (2022-02-28):
# My main source for its time zone history is
# Henri le Corre, Régimes horaires pour l'Europe et l'Afrique.
# Shanks follows le Corre. As does Françoise Schneider-Gauquelin in her book
# Problèmes de l'heure résolus pour le monde entier.
#
Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
1:00 - WAT 1920 Apr 25
2:00 - CAT
# Zambia
@@ -298,6 +443,85 @@ Zone America/Aruba -4:40:24 - LMT 1912 Feb 12 # Oranjestad
-4:30 - -0430 1965
-4:00 - AST
# Atikokan, Ontario
# From Paul Eggert (1997-10-17):
# Mark Brader writes that an article in the 1997-10-14 Toronto Star
# says that Atikokan, Ontario currently does not observe DST,
# but will vote on 11-10 whether to use EST/EDT.
# He also writes that the Ontario Time Act (1990, Chapter T.9)
# http://www.gov.on.ca/MBS/english/publications/statregs/conttext.html
# says that Ontario east of 90W uses EST/EDT, and west of 90W uses CST/CDT.
# Officially Atikokan is therefore on CST/CDT, and most likely this report
# concerns a non-official time observed as a matter of local practice.
#
# From Paul Eggert (2000-10-02):
# Matthews and Vincent (1998) write that Atikokan, Pickle Lake, and
# New Osnaburgh observe CST all year, that Big Trout Lake observes
# CST/CDT, and that Upsala and Shebandowan observe EST/EDT, all in
# violation of the official Ontario rules.
#
# From Paul Eggert (2006-07-09):
# Chris Walton (2006-07-06) mentioned an article by Stephanie MacLellan in the
# 2005-07-21 Chronicle-Journal, which said:
#
# The clocks in Atikokan stay set on standard time year-round.
# This means they spend about half the time on central time and
# the other half on eastern time.
#
# For the most part, the system works, Mayor Dennis Brown said.
#
# "The majority of businesses in Atikokan deal more with Eastern
# Canada, but there are some that deal with Western Canada," he
# said. "I don't see any changes happening here."
#
# Walton also writes "Supposedly Pickle Lake and Mishkeegogamang
# [New Osnaburgh] follow the same practice."
# From Garry McKinnon (2006-07-14) via Chris Walton:
# I chatted with a member of my board who has an outstanding memory
# and a long history in Atikokan (and in the telecom industry) and he
# can say for certain that Atikokan has been practicing the current
# time keeping since 1952, at least.
# From Paul Eggert (2006-07-17):
# Shanks & Pottenger say that Atikokan has agreed with Rainy River
# ever since standard time was introduced, but the information from
# McKinnon sounds more authoritative. For now, assume that Atikokan
# switched to EST immediately after WWII era daylight saving time
# ended. This matches the old (less-populous) America/Coral_Harbour
# entry since our cutoff date of 1970, so we can move
# America/Coral_Harbour to the 'backward' file.
Zone America/Atikokan -6:06:28 - LMT 1895
-6:00 Canada C%sT 1940 Sep 29
-6:00 1:00 CDT 1942 Feb 9 2:00s
-6:00 Canada C%sT 1945 Sep 30 2:00
-5:00 - EST
# Quebec east of Natashquan
# From Paul Eggert (2021-05-09):
# H. David Matthews and Mary Vincent's map
# "It's about TIME", _Canadian Geographic_ (September-October 1998)
# http://www.canadiangeographic.ca/Magazine/SO98/alacarte.asp
# says that Quebec east of the -63 meridian is supposed to observe
# AST, but residents as far east as Natashquan use EST/EDT, and
# residents east of Natashquan use AST.
# The Quebec department of justice writes in
# "The situation in Minganie and Basse-Côte-Nord"
# https://www.justice.gouv.qc.ca/en/department/ministre/functions-and-responsabilities/legal-time-in-quebec/the-situation-in-minganie-and-basse-cote-nord/
# that the coastal strip from just east of Natashquan to Blanc-Sablon
# observes Atlantic standard time all year round.
# This common practice was codified into law as of 2007; see Legal Time Act,
# CQLR c T-5.1 <http://legisquebec.gouv.qc.ca/en/ShowDoc/cs/T-5.1>.
# For lack of better info, guess this practice began around 1970, contra to
# Shanks & Pottenger who have this region observing AST/ADT.
Zone America/Blanc-Sablon -3:48:28 - LMT 1884
-4:00 Canada A%sT 1970
-4:00 - AST
# Cayman Is
Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
-5:07:10 - KMT 1912 Feb # Kingston Mean Time
@@ -318,6 +542,85 @@ Zone America/Coral_Harbour -5:32:40 - LMT 1884
-5:00 NT_YK E%sT 1946
-5:00 - EST
# From Chris Walton (2011-12-01):
# There are two areas within the Canadian province of British Columbia
# that do not currently observe daylight saving:
# a) The Creston Valley (includes the town of Creston and surrounding area)
# b) The eastern half of the Peace River Regional District
# (includes the cities of Dawson Creek and Fort St. John)
# Earlier this year I stumbled across a detailed article about the time
# keeping history of Creston; it was written by Tammy Hardwick who is the
# manager of the Creston & District Museum. The article was written in May 2009.
# http://www.ilovecreston.com/?p=articles&t=spec&ar=260
# According to the article, Creston has not changed its clocks since June 1918.
# i.e. Creston has been stuck on UT-7 for 93 years.
# Dawson Creek, on the other hand, changed its clocks as recently as April 1972.
# Unfortunately the exact date for the time change in June 1918 remains
# unknown and will be difficult to ascertain. I e-mailed Tammy a few months
# ago to ask if Sunday June 2 was a reasonable guess. She said it was just
# as plausible as any other date (in June). She also said that after writing
# the article she had discovered another time change in 1916; this is the
# subject of another article which she wrote in October 2010.
# http://www.creston.museum.bc.ca/index.php?module=comments&uop=view_comment&cm+id=56
# Here is a summary of the three clock change events in Creston's history:
# 1. 1884 or 1885: adoption of Mountain Standard Time (GMT-7)
# Exact date unknown
# 2. Oct 1916: switch to Pacific Standard Time (GMT-8)
# Exact date in October unknown; Sunday October 1 is a reasonable guess.
# 3. June 1918: switch to Pacific Daylight Time (GMT-7)
# Exact date in June unknown; Sunday June 2 is a reasonable guess.
# note 1:
# On Oct 27/1918 when daylight saving ended in the rest of Canada,
# Creston did not change its clocks.
# note 2:
# During WWII when the Federal Government legislated a mandatory clock change,
# Creston did not oblige.
# note 3:
# There is no guarantee that Creston will remain on Mountain Standard Time
# (UTC-7) forever.
# The subject was debated at least once this year by the town Council.
# http://www.bclocalnews.com/kootenay_rockies/crestonvalleyadvance/news/116760809.html
# During a period WWII, summer time (Daylight saying) was mandatory in Canada.
# In Creston, that was handled by shifting the area to PST (-8:00) then applying
# summer time to cause the offset to be -7:00, the same as it had been before
# the change. It can be argued that the timezone abbreviation during this
# period should be PDT rather than MST, but that doesn't seem important enough
# (to anyone) to further complicate the rules.
# The transition dates (and times) are guesses.
Zone America/Creston -7:46:04 - LMT 1884
-7:00 - MST 1916 Oct 1
-8:00 - PST 1918 Jun 2
-7:00 - MST
# Curaçao
# Milne gives 4:35:46.9 for Curaçao mean time; round to nearest.
#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at
# -4:00 since standard time was introduced on 1912-03-02; and that
# Kralendijk and Rincon used Kralendijk Mean Time (-4:33:08) from
# 1912-02-02 to 1965-01-01. The former is dubious, since S&P also say
# Saba Island has been like Curaçao.
# This all predates our 1970 cutoff, though.
#
# By July 2007 Curaçao and St Maarten are planned to become
# associated states within the Netherlands, much like Aruba;
# Bonaire, Saba and St Eustatius would become directly part of the
# Netherlands as Kingdom Islands. This won't affect their time zones
# though, as far as we know.
#
Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
-4:30 - -0430 1965
-4:00 - AST
Link America/Curacao America/Kralendijk
Link America/Curacao America/Lower_Princes
# Dominica
Zone America/Dominica -4:05:36 - LMT 1911 Jul 1 0:01 # Roseau
-4:00 - AST
@@ -340,6 +643,7 @@ Zone America/Grenada -4:07:00 - LMT 1911 Jul # St George's
Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe-à-Pitre
-4:00 - AST
# Canada
#
# From Paul Eggert (2015-03-24):
@@ -351,7 +655,6 @@ Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe-à-Pitre
# Pottenger data. The post-1970 entries have been corrected, but the
# pre-1970 entries are unchecked and probably have errors.
#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Mont 1917 only - Mar 25 2:00 1:00 D
Rule Mont 1917 only - Apr 24 0:00 0 S
Rule Mont 1919 only - Mar 31 2:30 1:00 D
@@ -387,6 +690,48 @@ Zone America/Montreal -4:54:16 - LMT 1884
Zone America/Montserrat -4:08:52 - LMT 1911 Jul 1 0:01 # Cork Hill
-4:00 - AST
# The Bahamas
#
# For 1899 Milne gives -5:09:29.5; round that.
#
# From P Chan (2020-11-27, corrected on 2020-12-02):
# There were two periods of DST observed in 1942-1945: 1942-05-01
# midnight to 1944-12-31 midnight and 1945-02-01 to 1945-10-17 midnight.
# "midnight" should mean 24:00 from the context.
#
# War Time Order 1942 [1942-05-01] and War Time (No. 2) Order 1942 [1942-09-29]
# Appendix to the Statutes of 7 George VI. and the Year 1942. p 34, 43
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA3-PA34
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA3-PA43
#
# War Time Order 1943 [1943-03-31] and War Time Order 1944 [1943-12-29]
# Appendix to the Statutes of 8 George VI. and the Year 1943. p 9-10, 28-29
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA4-PA9
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA4-PA28
#
# War Time Order 1945 [1945-01-31] and the Order which revoke War Time Order
# 1945 [1945-10-16] Appendix to the Statutes of 9 George VI. and the Year
# 1945. p 160, 247-248
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA6-PA160
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA6-PA247
#
# From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007....
# http://www.jonesbahamas.com/?c=45&a=10412
Rule Bahamas 1942 only - May 1 24:00 1:00 W
Rule Bahamas 1944 only - Dec 31 24:00 0 S
Rule Bahamas 1945 only - Feb 1 0:00 1:00 W
Rule Bahamas 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule Bahamas 1945 only - Oct 17 24:00 0 S
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976
-5:00 US E%sT
# United States
#
# From Paul Eggert (2018-03-18):
@@ -411,6 +756,12 @@ Zone America/Montserrat -4:08:52 - LMT 1911 Jul 1 0:01 # Cork Hill
# https://cdnc.ucr.edu/cgi-bin/cdnc?a=d&d=DS19470110
# front page reports on end.
# Trinidad and Tobago
Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2
-4:00 - AST
Link America/Port_of_Spain America/Marigot
Link America/Port_of_Spain America/St_Barthelemy
# Argentina
# This entry was intended for the following areas, but has been superseded by
# more detailed zones.
@@ -434,9 +785,10 @@ Zone America/St_Lucia -4:04:00 - LMT 1890 # Castries
-4:04:00 - CMT 1912 # Castries Mean Time
-4:00 - AST
# Virgin Is
# US Virgin Is
Zone America/St_Thomas -4:19:44 - LMT 1911 Jul # Charlotte Amalie
-4:00 - AST
Link America/St_Thomas America/Virgin
# St Vincent and the Grenadines
Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown
@@ -447,11 +799,36 @@ Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown
Zone America/Tortola -4:18:28 - LMT 1911 Jul # Road Town
-4:00 - AST
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.
#
Zone Antarctica/DumontDUrville 0 - -00 1947
10:00 - +10 1952 Jan 14
0 - -00 1956 Nov
10:00 - +10
# McMurdo, Ross Island, since 1955-12
Zone Antarctica/McMurdo 0 - -00 1956
12:00 NZ NZ%sT
Link Antarctica/McMurdo Antarctica/South_Pole
# Syowa, Antarctica
#
# From Hideyuki Suzuki (1999-02-06):
# In all Japanese stations, +0300 is used as the standard time.
#
# Syowa station, which is the first antarctic station of Japan,
# was established on 1957-01-29. Since Syowa station is still the main
# station of Japan, it's appropriate for the principal location.
# See:
# NIPR Antarctic Research Activities (1999-08-17)
# http://www.nipr.ac.jp/english/ara01.html
Zone Antarctica/Syowa 0 - -00 1957 Jan 29
3:00 - +03
# Yemen
# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
@@ -711,6 +1088,8 @@ Zone Europe/Skopje 1:25:44 - LMT 1884
1:00 - CET 1982 Nov 27
1:00 EU CE%sT
# Moldova / Transnistria
Zone Europe/Tiraspol 1:58:32 - LMT 1880
1:55 - CMT 1918 Feb 15 # Chisinau MT
@@ -749,10 +1128,22 @@ Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# US minor outlying islands
# Phoenix Islands, Kiribati
# From Paul Eggert (2021-05-27):
# Enderbury was inhabited 1860/1880s to mine guano, and 1938-03-06/1942-02-09
# for aviation (ostensibly commercial, but military uses foreseen).
# The 19th-century dates are approximate. See Pacific/Kanton for
# the currently-inhabited representative for this timezone.
Zone Pacific/Enderbury 0 - -00 1860
-11:24:20 - LMT 1885
0 - -00 1938 Mar 6
-12:00 - -12 1942 Feb 9
0 - -00
# Johnston
Zone Pacific/Johnston -10:00 - HST
# US minor outlying islands
# Midway
#
# From Mark Brader (2005-01-23):
# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
@@ -775,3 +1166,7 @@ Zone Pacific/Saipan -14:17:00 - LMT 1844 Dec 31
9:00 - +09 1969 Oct
10:00 - +10 2000 Dec 23
10:00 - ChST # Chamorro Standard Time
# Local Variables:
# coding: utf-8
# End:
+26 -28
View File
@@ -58,11 +58,12 @@ BEGIN {
zone_table, zone_NR >>"/dev/stderr"
status = 1
}
split($1, cca, /,/)
cc = cca[1]
ccs = input_ccs[zone_NR] = $1
coordinates = $2
tz = $3
comments = $4
comments = input_comments[zone_NR] = $4
split(ccs, cca, /,/)
cc = cca[1]
# Don't complain about a special case for Crimea in zone.tab.
# FIXME: zone.tab should be removed, since it is obsolete.
@@ -77,12 +78,9 @@ BEGIN {
cc0 = cc
tz0 = tz
tztab[tz] = 1
tz2comments[tz] = comments
tz2NR[tz] = zone_NR
for (i in cca) {
cc = cca[i]
cctz = cc tz
cctztab[cctz] = 1
if (cc2name[cc]) {
cc_used[cc]++
} else {
@@ -99,27 +97,27 @@ BEGIN {
}
}
for (cctz in cctztab) {
cc = substr (cctz, 1, 2)
tz = substr (cctz, 3)
if (1 < cc_used[cc]) {
comments_needed[tz] = cc
}
}
for (cctz in cctztab) {
cc = substr (cctz, 1, 2)
tz = substr (cctz, 3)
if (!comments_needed[tz] && tz2comments[tz]) {
for (i = 1; i <= zone_NR; i++) {
ccs = input_ccs[i]
if (!ccs) continue
comments = input_comments[i]
split(ccs, cca, /,/)
used_max = 0
for (j in cca) {
cc = cca[j]
if (used_max < cc_used[cc]) {
used_max = cc_used[cc]
}
}
if (used_max <= 1 && comments) {
printf "%s:%d: unnecessary comment '%s'\n", \
zone_table, tz2NR[tz], tz2comments[tz] \
>>"/dev/stderr"
tz2comments[tz] = 0
status = 1
} else if (comments_needed[tz] && !tz2comments[tz]) {
printf "%s:%d: missing comment for %s\n", \
zone_table, tz2NR[tz], comments_needed[tz] \
zone_table, i, comments \
>>"/dev/stderr"
status = 1
} else if (1 < cc_used[cc] && !comments) {
printf "%s:%d: missing comment for %s\n", \
zone_table, i, cc \
>>"/dev/stderr"
tz2comments[tz] = 1
status = 1
}
}
@@ -149,8 +147,8 @@ $1 ~ /^#/ { next }
ruleUsed[$2] = 1
if ($3 ~ /%/) rulePercentUsed[$2] = 1
}
if (tz && tz ~ /\//) {
if (!tztab[tz]) {
if (tz && tz ~ /\// && tz !~ /^Etc\//) {
if (!tztab[tz] && FILENAME != "backward") {
printf "%s: no data for '%s'\n", zone_table, tz \
>>"/dev/stderr"
status = 1
@@ -173,7 +171,7 @@ END {
}
}
for (tz in tztab) {
if (!zoneSeen[tz]) {
if (!zoneSeen[tz] && tz !~ /^Etc\//) {
printf "%s:%d: no Zone table for '%s'\n", \
zone_table, tz2NR[tz], tz >>"/dev/stderr"
status = 1
+1 -1
View File
@@ -5,7 +5,7 @@ date \- show and set date and time
.if n .nh
.if n .na
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B date
[
.B \*-u
+2 -2
View File
@@ -92,7 +92,7 @@ main(const int argc, char *argv[])
}
rflag = true;
errno = 0;
secs = strtoimax (optarg, &endarg, 0);
secs = strtoimax(optarg, &endarg, 0);
if (*endarg || optarg == endarg)
errno = EINVAL;
else if (! (TIME_T_MIN <= secs && secs <= TIME_T_MAX))
@@ -138,7 +138,7 @@ dogmt(void)
continue;
fakeenv = malloc((n + 2) * sizeof *fakeenv);
if (fakeenv == NULL) {
perror(_("Memory exhausted"));
fprintf(stderr, _("date: Memory exhausted\n"));
errensure();
exit(retval);
}
+2 -2
View File
@@ -23,7 +23,7 @@ difftime(time_t time1, time_t time0)
** If double is large enough, simply convert and subtract
** (assuming that the larger type has more precision).
*/
if (sizeof (time_t) < sizeof (double)) {
if (sizeof(time_t) < sizeof(double)) {
double t1 = time1, t0 = time0;
return t1 - t0;
}
@@ -36,7 +36,7 @@ difftime(time_t time1, time_t time0)
return time0 <= time1 ? time1 - time0 : dminus(time0 - time1);
/* Use uintmax_t if wide enough. */
if (sizeof (time_t) <= sizeof (uintmax_t)) {
if (sizeof(time_t) <= sizeof(uintmax_t)) {
uintmax_t t1 = time1, t0 = time0;
return time0 <= time1 ? t1 - t0 : dminus(t0 - t1);
}
+69 -18
View File
@@ -68,7 +68,6 @@
# 0:00 GMT BST BDST Greenwich, British Summer
# 0:00 GMT IST Greenwich, Irish Summer
# 0:00 WET WEST WEMT Western Europe
# 0:19:32.13 AMT* NST* Amsterdam, Netherlands Summer (1835-1937)
# 1:00 BST British Standard (1968-1971)
# 1:00 IST GMT Irish Standard (1968-) with winter DST
# 1:00 CET CEST CEMT Central Europe
@@ -822,7 +821,7 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# Shanks & Pottenger give 02:00, the BEV 00:00. Go with the BEV,
# and guess 02:00 for 1945-04-12.
# From Alois Triendl (2019-07-22):
# From Alois Treindl (2019-07-22):
# In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am.
# Shanks had this right. Source: Die Weltpresse, 5. Oktober 1946, page 5.
@@ -1736,19 +1735,22 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
# advanced to sixty minutes later starting at hour two on 1944-04-02; ...
# Starting at hour three on the date 1944-09-17 standard time will be resumed.
#
# From Alois Triendl (2019-07-02):
# From Alois Treindl (2019-07-02):
# I spent 6 Euros to buy two archive copies of Il Messaggero, a Roman paper,
# for 1 and 2 April 1944. The edition of 2 April has this note: "Tonight at 2
# am, put forward the clock by one hour. Remember that in the night between
# today and Monday the 'ora legale' will come in force again." That makes it
# clear that in Rome the change was on Monday, 3 April 1944 at 2 am.
#
# From Paul Eggert (2016-10-27):
# From Paul Eggert (2021-10-05):
# Go with INRiM for DST rules, except as corrected by Inglis for 1944
# for the Kingdom of Italy. This is consistent with Renzo Baldini.
# Model Rome's occupation by using C-Eur rules from 1943-09-10
# to 1944-06-04; although Rome was an open city during this period, it
# was effectively controlled by Germany.
# was effectively controlled by Germany. Using C-Eur is consistent
# with Treindl's comment about Rome in April 1944, as the "Rule Italy"
# lines during German occupation do not affect Europe/Rome
# (though they do affect Europe/Malta).
#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Italy 1916 only - Jun 3 24:00 1:00 S
@@ -1800,6 +1802,10 @@ Zone Europe/Rome 0:49:56 - LMT 1866 Dec 12
1:00 Italy CE%sT 1980
1:00 EU CE%sT
# Kosovo
# See Europe/Belgrade.
Link Europe/Rome Europe/Vatican
Link Europe/Rome Europe/San_Marino
@@ -2150,6 +2156,10 @@ Zone Europe/Monaco 0:29:32 - LMT 1892 Jun 1
# The data entries before 1945 are taken from
# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
# From Paul Eggert (2021-05-09):
# I invented the abbreviations AMT for Amsterdam Mean Time and NST for
# Netherlands Summer Time, used in the Netherlands from 1835 to 1937.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
Rule Neth 1916 only - Oct 1 0:00 0 AMT # Amsterdam Mean Time
@@ -2376,12 +2386,10 @@ Rule Port 1943 1945 - Aug Sat>=25 22:00s 1:00 S
Rule Port 1944 1945 - Apr Sat>=21 22:00s 2:00 M
Rule Port 1946 only - Apr Sat>=1 23:00s 1:00 S
Rule Port 1946 only - Oct Sat>=1 23:00s 0 -
Rule Port 1947 1949 - Apr Sun>=1 2:00s 1:00 S
Rule Port 1947 1949 - Oct Sun>=1 2:00s 0 -
# Shanks & Pottenger say DST was observed in 1950; go with Whitman.
# Whitman says DST was not observed in 1950; go with Shanks & Pottenger.
# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger.
Rule Port 1951 1965 - Apr Sun>=1 2:00s 1:00 S
Rule Port 1951 1965 - Oct Sun>=1 2:00s 0 -
Rule Port 1947 1965 - Apr Sun>=1 2:00s 1:00 S
Rule Port 1947 1965 - Oct Sun>=1 2:00s 0 -
Rule Port 1977 only - Mar 27 0:00s 1:00 S
Rule Port 1977 only - Sep 25 0:00s 0 -
Rule Port 1978 1979 - Apr Sun>=1 0:00s 1:00 S
@@ -2618,7 +2626,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Although Shanks lists 1945-01-01 as the date for transition from
# +01/+02 to +02/+03, more likely this is a placeholder. Guess that
# the transition occurred at 1945-04-10 00:00, which is about when
# Königsberg surrendered to Soviet troops. (Thanks to Alois Triendl.)
# Königsberg surrendered to Soviet troops. (Thanks to Alois Treindl.)
# From Paul Eggert (2016-03-18):
# The 1989 transition is from USSR act No. 227 (1989-03-14).
@@ -2777,8 +2785,26 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
# says he remembers that Samara opted out of the 1992-01-19 exception
# 2 days before the switch.
#
# From Alois Treindl (2022-02-15):
# the Russian wikipedia page
# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток
# contains the sentence (in Google translation) "In the autumn of
# 1981, Arkhangelsk, Vologda, Yaroslavl, Ivanovo, Vladimir, Ryazan,
# Lipetsk, Voronezh, Rostov-on-Don, Krasnodar and regions to the east
# of those named (about 30 in total) parted ways with Moscow time.
# However, the convenience of common time with Moscow turned out to be
# decisive - in 1982, these regions again switched to Moscow time."
# Shanks International atlas has similar information, and also the
# Russian book Zaitsev A., Kutalev D. A new astrologer's reference
# book. Coordinates of cities and time corrections, - The World of
# Urania, 2012 (Russian: Зайцев А., Куталёв Д., Новый справочник
# астролога. Координаты городов и временные поправки).
# To me it seems that an extra zone is needed, which starts with LMT
# util 1919, later follows Moscow since 1930, but deviates from it
# between 1 October 1981 until 1 April 1982.
#
# From Paul Eggert (2016-03-18):
#
# From Paul Eggert (2022-02-15):
# Given the above, we appear to be missing some Zone entries for the
# chaotic early 1980s in Russia. It's not clear what these entries
# should be. For now, sweep this under the rug and just document the
@@ -2825,7 +2851,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
1:00 C-Eur CE%sT 1944 Apr 13
3:00 Russia MSK/MSD 1990
3:00 - MSK 1990 Jul 1 2:00
2:00 - EET 1992
2:00 - EET 1992 Mar 20
# Central Crimea used Moscow time 1994/1997.
#
# From Paul Eggert (2006-03-22):
@@ -2835,7 +2861,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
# sometime between the 1994 DST switches. Shanks & Pottenger simply say
# 1994-09-25 03:00, but that can't be right. For now, guess it
# changed in May.
2:00 E-Eur EE%sT 1994 May
2:00 C-Eur EE%sT 1994 May
# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
3:00 E-Eur MSK/MSD 1996 Mar 31 0:00s
3:00 1:00 MSD 1996 Oct 27 3:00s
@@ -3683,6 +3709,9 @@ Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
#
# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
# An extra-special abbreviation style is SET for Swedish Time (svensk
# normaltid) 1879-1899, 3° west of the Stockholm Observatory.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
1:00:14 - SET 1900 Jan 1 # Swedish Time
@@ -3999,6 +4028,27 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine
#
# From Alois Triendl (2014-03-01):
# REGULATION A N O V A on March 20, 1992 N 139 ... means that from
# 1992 on, Ukraine had DST with begin time at 02:00 am, on last Sunday
# in March, and end time 03:00 am, last Sunday in September....
# CABINET OF MINISTERS OF UKRAINE RESOLUTION on May 13, 1996 N 509
# "On the order of computation time on the territory of Ukraine" ....
# As this cabinet decision is from May 1996, it seems likely that the
# transition in March 1996, which predates it, was still at 2:00 am
# and not at 3:00 as would have been under EU rules.
# This is why I have set the change to EU rules into May 1996,
# so that the change in March is stil covered by the Ukraine rule.
# The next change in October 1996 happened under EU rules....
# TZ database holds three other zones for Ukraine.... I have not yet
# worked out the consequences for these three zones, as we (me and my
# US colleague David Cochrane) are still trying to get more
# information upon these local deviations from Kiev rules.
#
# From Paul Eggert (2022-02-08):
# For now, assume that Ukraine's other three zones followed the same rules,
# except that Crimea switched to Moscow time in 1994 as described elsewhere.
# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
# via Garrett Wollman (2003-01-27):
# BTW, I've found the official document on this matter. It's government
@@ -4088,7 +4138,7 @@ Zone Europe/Kiev 2:02:04 - LMT 1880
1:00 C-Eur CE%sT 1943 Nov 6
3:00 Russia MSK/MSD 1990 Jul 1 2:00
2:00 1:00 EEST 1991 Sep 29 3:00
2:00 E-Eur EE%sT 1995
2:00 C-Eur EE%sT 1996 May 13
2:00 EU EE%sT
# Transcarpathia used CET 1990/1991.
# "Uzhhorod" is the transliteration of the Rusyn/Ukrainian pronunciation, but
@@ -4101,8 +4151,8 @@ Zone Europe/Uzhgorod 1:29:12 - LMT 1890 Oct
3:00 Russia MSK/MSD 1990
3:00 - MSK 1990 Jul 1 2:00
1:00 - CET 1991 Mar 31 3:00
2:00 - EET 1992
2:00 E-Eur EE%sT 1995
2:00 - EET 1992 Mar 20
2:00 C-Eur EE%sT 1996 May 13
2:00 EU EE%sT
# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
# "Zaporizhia" is the transliteration of the Ukrainian name, but
@@ -4115,7 +4165,8 @@ Zone Europe/Zaporozhye 2:20:40 - LMT 1880
3:00 - MSK 1941 Aug 25
1:00 C-Eur CE%sT 1943 Oct 25
3:00 Russia MSK/MSD 1991 Mar 31 2:00
2:00 E-Eur EE%sT 1995
2:00 E-Eur EE%sT 1992 Mar 20
2:00 C-Eur EE%sT 1996 May 13
2:00 EU EE%sT
# Vatican City
+4 -4
View File
@@ -204,10 +204,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
# Updated through IERS Bulletin C61
# File expires on: 28 December 2021
# Updated through IERS Bulletin C63
# File expires on: 28 December 2022
#
#@ 3849638400
#@ 3881174400
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -252,4 +252,4 @@
# the hash line is also ignored in the
# computation.
#
#h 2ab8253d d4380d28 75f01343 381504f8 8f8a4bfc
#h 732b2044 5863a938 b7e43179 1339c710 ded63837
+4 -4
View File
@@ -72,11 +72,11 @@ Leap 2016 Dec 31 23:59:60 + S
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
#Expires 2021 Dec 28 00:00:00
#Expires 2022 Dec 28 00:00:00
# POSIX timestamps for the data in this file:
#updated 1467936000 (2016-07-08 00:00:00 UTC)
#expires 1640649600 (2021-12-28 00:00:00 UTC)
#expires 1672185600 (2022-12-28 00:00:00 UTC)
# Updated through IERS Bulletin C61
# File expires on: 28 December 2021
# Updated through IERS Bulletin C63
# File expires on: 28 December 2022
+292 -217
View File
@@ -28,14 +28,6 @@ static int lock(void) { return 0; }
static void unlock(void) { }
#endif
/* NETBSD_INSPIRED_EXTERN functions are exported to callers if
NETBSD_INSPIRED is defined, and are private otherwise. */
#if NETBSD_INSPIRED
# define NETBSD_INSPIRED_EXTERN
#else
# define NETBSD_INSPIRED_EXTERN static
#endif
#ifndef TZ_ABBR_MAX_LEN
#define TZ_ABBR_MAX_LEN 16
#endif /* !defined TZ_ABBR_MAX_LEN */
@@ -107,12 +99,21 @@ struct ttinfo { /* time type information */
struct lsinfo { /* leap second information */
time_t ls_trans; /* transition time */
int_fast64_t ls_corr; /* correction to apply */
int_fast32_t ls_corr; /* correction to apply */
};
#define SMALLEST(a, b) (((a) < (b)) ? (a) : (b))
#define BIGGEST(a, b) (((a) > (b)) ? (a) : (b))
/* This abbreviation means local time is unspecified. */
static char const UNSPEC[] = "-00";
/* How many extra bytes are needed at the end of struct state's chars array.
This needs to be at least 1 for null termination in case the input
data isn't properly terminated, and it also needs to be big enough
for ttunspecified to work without crashing. */
enum { CHARS_EXTRA = BIGGEST(sizeof UNSPEC, 2) - 1 };
#ifdef TZNAME_MAX
#define MY_TZNAME_MAX TZNAME_MAX
#endif /* defined TZNAME_MAX */
@@ -130,7 +131,8 @@ struct state {
time_t ats[TZ_MAX_TIMES];
unsigned char types[TZ_MAX_TIMES];
struct ttinfo ttis[TZ_MAX_TYPES];
char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, sizeof gmt),
char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + CHARS_EXTRA,
sizeof gmt),
(2 * (MY_TZNAME_MAX + 1)))];
struct lsinfo lsis[TZ_MAX_LEAPS];
@@ -158,12 +160,12 @@ static struct tm *gmtsub(struct state const *, time_t const *, int_fast32_t,
struct tm *);
static bool increment_overflow(int *, int);
static bool increment_overflow_time(time_t *, int_fast32_t);
static int_fast64_t leapcorr(struct state const *, time_t);
static int_fast32_t leapcorr(struct state const *, time_t);
static bool normalize_overflow32(int_fast32_t *, int *, int);
static struct tm *timesub(time_t const *, int_fast32_t, struct state const *,
struct tm *);
static bool typesequiv(struct state const *, int, int);
static bool tzparse(char const *, struct state *, bool);
static bool tzparse(char const *, struct state *, struct state *);
#ifdef ALL_STATE
static struct state * lclptr;
@@ -219,6 +221,15 @@ init_ttinfo(struct ttinfo *s, int_fast32_t utoff, bool isdst, int desigidx)
s->tt_ttisut = false;
}
/* Return true if SP's time type I does not specify local time. */
static bool
ttunspecified(struct state const *sp, int i)
{
char const *abbr = &sp->chars[sp->ttis[i].tt_desigidx];
/* memcmp is likely faster than strcmp, and is safe due to CHARS_EXTRA. */
return memcmp(abbr, UNSPEC, sizeof UNSPEC) == 0;
}
static int_fast32_t
detzcode(const char *const codep)
{
@@ -245,7 +256,7 @@ detzcode(const char *const codep)
static int_fast64_t
detzcode64(const char *const codep)
{
register uint_fast64_t result;
register int_fast64_t result;
register int i;
int_fast64_t one = 1;
int_fast64_t halfmaxval = one << (64 - 2);
@@ -342,21 +353,13 @@ scrub_abbrs(struct state *sp)
}
}
static bool
differ_by_repeat(const time_t t1, const time_t t0)
{
if (TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
return 0;
return t1 - t0 == SECSPERREPEAT;
}
/* Input buffer for data read from a compiled tz file. */
union input_buffer {
/* The first part of the buffer, interpreted as a header. */
struct tzhead tzhead;
/* The entire buffer. */
char buf[2 * sizeof(struct tzhead) + 2 * sizeof (struct state)
char buf[2 * sizeof(struct tzhead) + 2 * sizeof(struct state)
+ 4 * TZ_MAX_TIMES];
};
@@ -375,7 +378,7 @@ union local_storage {
} u;
/* The file name to be opened. */
char fullname[BIGGEST(sizeof (struct file_analysis),
char fullname[BIGGEST(sizeof(struct file_analysis),
sizeof tzdirslash + 1024)];
};
@@ -392,7 +395,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
register ssize_t nread;
register bool doaccess;
register union input_buffer *up = &lsp->u.u;
register int tzheadsize = sizeof (struct tzhead);
register int tzheadsize = sizeof(struct tzhead);
sp->goback = sp->goahead = false;
@@ -450,35 +453,45 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
if (close(fid) < 0)
return errno;
for (stored = 4; stored <= 8; stored *= 2) {
int_fast32_t ttisstdcnt = detzcode(up->tzhead.tzh_ttisstdcnt);
int_fast32_t ttisutcnt = detzcode(up->tzhead.tzh_ttisutcnt);
int_fast64_t prevtr = 0;
int_fast32_t prevcorr = 0;
int_fast32_t leapcnt = detzcode(up->tzhead.tzh_leapcnt);
int_fast32_t timecnt = detzcode(up->tzhead.tzh_timecnt);
int_fast32_t typecnt = detzcode(up->tzhead.tzh_typecnt);
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 <= timecnt && timecnt < TZ_MAX_TIMES
&& 0 <= charcnt && charcnt < TZ_MAX_CHARS
&& (ttisstdcnt == typecnt || ttisstdcnt == 0)
&& (ttisutcnt == typecnt || ttisutcnt == 0)))
return EINVAL;
if (nread
< (tzheadsize /* struct tzhead */
+ timecnt * stored /* ats */
char version = up->tzhead.tzh_version[0];
bool skip_datablock = stored == 4 && version;
int_fast32_t datablock_size;
int_fast32_t ttisstdcnt = detzcode(up->tzhead.tzh_ttisstdcnt);
int_fast32_t ttisutcnt = detzcode(up->tzhead.tzh_ttisutcnt);
int_fast64_t prevtr = -1;
int_fast32_t prevcorr;
int_fast32_t leapcnt = detzcode(up->tzhead.tzh_leapcnt);
int_fast32_t timecnt = detzcode(up->tzhead.tzh_timecnt);
int_fast32_t typecnt = detzcode(up->tzhead.tzh_typecnt);
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 <= timecnt && timecnt < TZ_MAX_TIMES
&& 0 <= charcnt && charcnt < TZ_MAX_CHARS
&& 0 <= ttisstdcnt && ttisstdcnt < TZ_MAX_TYPES
&& 0 <= ttisutcnt && ttisutcnt < TZ_MAX_TYPES))
return EINVAL;
datablock_size
= (timecnt * stored /* ats */
+ timecnt /* types */
+ typecnt * 6 /* ttinfos */
+ charcnt /* chars */
+ leapcnt * (stored + 4) /* lsinfos */
+ ttisstdcnt /* ttisstds */
+ ttisutcnt)) /* ttisuts */
+ ttisutcnt); /* ttisuts */
if (nread < tzheadsize + datablock_size)
return EINVAL;
if (skip_datablock)
p += datablock_size;
else {
if (! ((ttisstdcnt == typecnt || ttisstdcnt == 0)
&& (ttisutcnt == typecnt || ttisutcnt == 0)))
return EINVAL;
sp->leapcnt = leapcnt;
sp->timecnt = timecnt;
sp->typecnt = typecnt;
@@ -534,7 +547,9 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
}
for (i = 0; i < sp->charcnt; ++i)
sp->chars[i] = *p++;
sp->chars[i] = '\0'; /* ensure '\0' at end */
/* Ensure '\0'-terminated, and make it safe to call
ttunspecified later. */
memset(&sp->chars[i], 0, CHARS_EXTRA);
/* Read leap seconds, discarding those out of time_t range. */
leapcnt = 0;
@@ -542,20 +557,29 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
int_fast64_t tr = stored == 4 ? detzcode(p) : detzcode64(p);
int_fast32_t corr = detzcode(p + stored);
p += stored + 4;
/* Leap seconds cannot occur before the Epoch. */
if (tr < 0)
/* Leap seconds cannot occur before the Epoch,
or out of order. */
if (tr <= prevtr)
return EINVAL;
/* To avoid other botches in this code, each leap second's
correction must differ from the previous one's by 1
second or less, except that the first correction can be
any value; these requirements are more generous than
RFC 8536, to allow future RFC extensions. */
if (! (i == 0
|| (prevcorr < corr
? corr == prevcorr + 1
: (corr == prevcorr
|| corr == prevcorr - 1))))
return EINVAL;
prevtr = tr;
prevcorr = corr;
if (tr <= TIME_T_MAX) {
/* Leap seconds cannot occur more than once per UTC month,
and UTC months are at least 28 days long (minus 1
second for a negative leap second). Each leap second's
correction must differ from the previous one's by 1
second. */
if (tr - prevtr < 28 * SECSPERDAY - 1
|| (corr != prevcorr - 1 && corr != prevcorr + 1))
return EINVAL;
sp->lsis[leapcnt].ls_trans = prevtr = tr;
sp->lsis[leapcnt].ls_corr = prevcorr = corr;
sp->lsis[leapcnt].ls_trans = tr;
sp->lsis[leapcnt].ls_corr = corr;
leapcnt++;
}
}
@@ -585,13 +609,14 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
ttisp->tt_ttisut = *p++;
}
}
/*
** If this is an old file, we're done.
*/
if (up->tzhead.tzh_version[0] == '\0')
break;
nread -= p - up->buf;
memmove(up->buf, p, nread);
}
nread -= p - up->buf;
memmove(up->buf, p, nread);
/* If this is an old file, we're done. */
if (!version)
break;
}
if (doextend && nread > 2 &&
up->buf[0] == '\n' && up->buf[nread - 1] == '\n' &&
@@ -599,7 +624,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)) {
if (tzparse(&up->buf[1], ts, sp)) {
/* Attempt to reuse existing abbreviations.
Without this, America/Anchorage would be right on
@@ -640,19 +665,18 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
== sp->types[sp->timecnt - 2]))
sp->timecnt--;
for (i = 0; i < ts->timecnt; i++)
if (sp->timecnt == 0
|| (sp->ats[sp->timecnt - 1]
< ts->ats[i] + leapcorr(sp, ts->ats[i])))
break;
while (i < ts->timecnt
&& sp->timecnt < TZ_MAX_TIMES) {
sp->ats[sp->timecnt]
= ts->ats[i] + leapcorr(sp, ts->ats[i]);
for (i = 0;
i < ts->timecnt && sp->timecnt < TZ_MAX_TIMES;
i++) {
time_t t = ts->ats[i];
if (increment_overflow_time(&t, leapcorr(sp, t))
|| (0 < sp->timecnt
&& t <= sp->ats[sp->timecnt - 1]))
continue;
sp->ats[sp->timecnt] = t;
sp->types[sp->timecnt] = (sp->typecnt
+ ts->types[i]);
sp->timecnt++;
i++;
}
for (i = 0; i < ts->typecnt; i++)
sp->ttis[sp->typecnt++] = ts->ttis[i];
@@ -662,20 +686,26 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
if (sp->typecnt == 0)
return EINVAL;
if (sp->timecnt > 1) {
if (sp->ats[0] <= TIME_T_MAX - SECSPERREPEAT) {
time_t repeatat = sp->ats[0] + SECSPERREPEAT;
int repeattype = sp->types[0];
for (i = 1; i < sp->timecnt; ++i)
if (typesequiv(sp, sp->types[i], sp->types[0]) &&
differ_by_repeat(sp->ats[i], sp->ats[0])) {
if (sp->ats[i] == repeatat
&& typesequiv(sp, sp->types[i], repeattype)) {
sp->goback = true;
break;
}
}
}
if (TIME_T_MIN + SECSPERREPEAT <= sp->ats[sp->timecnt - 1]) {
time_t repeatat = sp->ats[sp->timecnt - 1] - SECSPERREPEAT;
int repeattype = sp->types[sp->timecnt - 1];
for (i = sp->timecnt - 2; i >= 0; --i)
if (typesequiv(sp, sp->types[sp->timecnt - 1],
sp->types[i]) &&
differ_by_repeat(sp->ats[sp->timecnt - 1],
sp->ats[i])) {
if (sp->ats[i] == repeatat
&& typesequiv(sp, sp->types[i], repeattype)) {
sp->goahead = true;
break;
}
}
}
}
/* Infer sp->defaulttype from the data. Although this default
@@ -689,13 +719,13 @@ tzloadbody(char const *name, struct state *sp, bool doextend,
standard-time type. See:
https://mm.icann.org/pipermail/tz/2013-May/019368.html */
/*
** If type 0 is unused in transitions,
** If type 0 does not specify local time, or is unused in transitions,
** it's the type to use for early times.
*/
for (i = 0; i < sp->timecnt; ++i)
if (sp->types[i] == 0)
break;
i = i < sp->timecnt ? -1 : 0;
i = i < sp->timecnt && ! ttunspecified(sp, 0) ? -1 : 0;
/*
** Absent the above,
** if there are transition times
@@ -740,9 +770,9 @@ tzload(char const *name, struct state *sp, bool doextend)
{
#ifdef ALL_STATE
union local_storage *lsp = malloc(sizeof *lsp);
if (!lsp)
return errno;
else {
if (!lsp) {
return HAVE_MALLOC_ERRNO ? errno : ENOMEM;
} else {
int err = tzloadbody(name, sp, doextend, lsp);
free(lsp);
return err;
@@ -785,6 +815,13 @@ static const int year_lengths[2] = {
DAYSPERNYEAR, DAYSPERLYEAR
};
/* Is C an ASCII digit? */
static bool
is_digit(char c)
{
return '0' <= c && c <= '9';
}
/*
** Given a pointer into a timezone string, scan until a character that is not
** a valid character in a time zone abbreviation is found.
@@ -862,6 +899,7 @@ static const char *
getsecs(register const char *strp, int_fast32_t *const secsp)
{
int num;
int_fast32_t secsperhour = SECSPERHOUR;
/*
** 'HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-Posix rules like
@@ -872,7 +910,7 @@ getsecs(register const char *strp, int_fast32_t *const secsp)
strp = getnum(strp, &num, 0, HOURSPERDAY * DAYSPERWEEK - 1);
if (strp == NULL)
return NULL;
*secsp = num * (int_fast32_t) SECSPERHOUR;
*secsp = num * secsperhour;
if (*strp == ':') {
++strp;
strp = getnum(strp, &num, 0, MINSPERHOUR - 1);
@@ -983,7 +1021,6 @@ transtime(const int year, register const struct rule *const rulep,
register int i;
int d, m1, yy0, yy1, yy2, dow;
INITIALIZE(value);
leapyear = isleap(year);
switch (rulep->r_type) {
@@ -1049,6 +1086,8 @@ transtime(const int year, register const struct rule *const rulep,
for (i = 0; i < rulep->r_mon - 1; ++i)
value += mon_lengths[leapyear][i] * SECSPERDAY;
break;
default: UNREACHABLE();
}
/*
@@ -1066,7 +1105,7 @@ transtime(const int year, register const struct rule *const rulep,
*/
static bool
tzparse(const char *name, struct state *sp, bool lastditch)
tzparse(const char *name, struct state *sp, struct state *basep)
{
const char * stdname;
const char * dstname;
@@ -1077,37 +1116,42 @@ tzparse(const char *name, struct state *sp, bool lastditch)
int_fast32_t dstoffset;
register char * cp;
register bool load_ok;
time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN;
stdname = name;
if (lastditch) {
stdlen = sizeof gmt - 1;
name += stdlen;
stdoffset = 0;
if (*name == '<') {
name++;
stdname = name;
name = getqzname(name, '>');
if (*name != '>')
return false;
stdlen = name - stdname;
name++;
} else {
if (*name == '<') {
name++;
stdname = name;
name = getqzname(name, '>');
if (*name != '>')
return false;
stdlen = name - stdname;
name++;
} else {
name = getzname(name);
stdlen = name - stdname;
}
if (!stdlen)
return false;
name = getoffset(name, &stdoffset);
if (name == NULL)
return false;
name = getzname(name);
stdlen = name - stdname;
}
if (!stdlen)
return false;
name = getoffset(name, &stdoffset);
if (name == NULL)
return false;
charcnt = stdlen + 1;
if (sizeof sp->chars < charcnt)
return false;
load_ok = tzload(TZDEFRULES, sp, false) == 0;
if (!load_ok)
sp->leapcnt = 0; /* so, we're off a little */
if (basep) {
if (0 < basep->timecnt)
atlo = basep->ats[basep->timecnt - 1];
load_ok = false;
sp->leapcnt = basep->leapcnt;
memcpy(sp->lsis, basep->lsis, sp->leapcnt * sizeof *sp->lsis);
} else {
load_ok = tzload(TZDEFRULES, sp, false) == 0;
if (!load_ok)
sp->leapcnt = 0; /* So, we're off a little. */
}
if (0 < sp->leapcnt)
leaplo = sp->lsis[sp->leapcnt - 1].ls_trans;
if (*name != '\0') {
if (*name == '<') {
dstname = ++name;
@@ -1137,11 +1181,10 @@ tzparse(const char *name, struct state *sp, bool lastditch)
struct rule start;
struct rule end;
register int year;
register int yearlim;
register int timecnt;
time_t janfirst;
int_fast32_t janoffset = 0;
int yearbeg;
int yearbeg, yearlim;
++name;
if ((name = getrule(name, &start)) == NULL)
@@ -1171,9 +1214,25 @@ tzparse(const char *name, struct state *sp, bool lastditch)
janoffset = -yearsecs;
break;
}
} while (EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg);
} while (atlo < janfirst
&& EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg);
yearlim = yearbeg + YEARSPERREPEAT + 1;
while (true) {
int_fast32_t yearsecs
= year_lengths[isleap(yearbeg)] * SECSPERDAY;
int yearbeg1 = yearbeg;
time_t janfirst1 = janfirst;
if (increment_overflow_time(&janfirst1, yearsecs)
|| increment_overflow(&yearbeg1, 1)
|| atlo <= janfirst1)
break;
yearbeg = yearbeg1;
janfirst = janfirst1;
}
yearlim = yearbeg;
if (increment_overflow(&yearlim, YEARSPERREPEAT + 1))
yearlim = INT_MAX;
for (year = yearbeg; year < yearlim; year++) {
int_fast32_t
starttime = transtime(year, &start, stdoffset),
@@ -1189,24 +1248,29 @@ tzparse(const char *name, struct state *sp, bool lastditch)
}
if (reversed
|| (starttime < endtime
&& (endtime - starttime
< (yearsecs
+ (stdoffset - dstoffset))))) {
&& endtime - starttime < yearsecs)) {
if (TZ_MAX_TIMES - 2 < timecnt)
break;
sp->ats[timecnt] = janfirst;
if (! increment_overflow_time
(&sp->ats[timecnt],
janoffset + starttime))
janoffset + starttime)
&& atlo <= sp->ats[timecnt])
sp->types[timecnt++] = !reversed;
sp->ats[timecnt] = janfirst;
if (! increment_overflow_time
(&sp->ats[timecnt],
janoffset + endtime)) {
janoffset + endtime)
&& atlo <= sp->ats[timecnt]) {
sp->types[timecnt++] = reversed;
yearlim = year + YEARSPERREPEAT + 1;
}
}
if (endtime < leaplo) {
yearlim = year;
if (increment_overflow(&yearlim,
YEARSPERREPEAT + 1))
yearlim = INT_MAX;
}
if (increment_overflow_time
(&janfirst, janoffset + yearsecs))
break;
@@ -1253,7 +1317,6 @@ tzparse(const char *name, struct state *sp, bool lastditch)
** Initially we're assumed to be in standard time.
*/
isdst = false;
theiroffset = theirstdoffset;
/*
** Now juggle transition times and types
** tracking offsets as you do.
@@ -1323,7 +1386,7 @@ static void
gmtload(struct state *const sp)
{
if (tzload(gmt, sp, true) != 0)
tzparse(gmt, sp, true);
tzparse("GMT0", sp, NULL);
}
/* Initialize *SP to a value appropriate for the TZ setting NAME.
@@ -1346,7 +1409,7 @@ zoneinit(struct state *sp, char const *name)
return 0;
} else {
int err = tzload(name, sp, true);
if (err != 0 && name && name[0] != ':' && tzparse(name, sp, false))
if (err != 0 && name && name[0] != ':' && tzparse(name, sp, NULL))
err = 0;
if (err == 0)
scrub_abbrs(sp);
@@ -1417,7 +1480,8 @@ tzalloc(char const *name)
errno = err;
return NULL;
}
}
} else if (!HAVE_MALLOC_ERRNO)
errno = ENOMEM;
return sp;
}
@@ -1469,7 +1533,7 @@ localsub(struct state const *sp, time_t const *timep, int_fast32_t setname,
}
if ((sp->goback && t < sp->ats[0]) ||
(sp->goahead && t > sp->ats[sp->timecnt - 1])) {
time_t newt = t;
time_t newt;
register time_t seconds;
register time_t years;
@@ -1477,11 +1541,17 @@ localsub(struct state const *sp, time_t const *timep, int_fast32_t setname,
seconds = sp->ats[0] - t;
else seconds = t - sp->ats[sp->timecnt - 1];
--seconds;
years = (seconds / SECSPERREPEAT + 1) * YEARSPERREPEAT;
/* Beware integer overflow, as SECONDS might
be close to the maximum time_t. */
years = seconds / SECSPERREPEAT * YEARSPERREPEAT;
seconds = years * AVGSECSPERYEAR;
years += YEARSPERREPEAT;
if (t < sp->ats[0])
newt += seconds;
else newt -= seconds;
newt = t + seconds + SECSPERREPEAT;
else
newt = t - seconds - SECSPERREPEAT;
if (newt < sp->ats[0] ||
newt > sp->ats[sp->timecnt - 1])
return NULL; /* "cannot happen" */
@@ -1512,7 +1582,7 @@ localsub(struct state const *sp, time_t const *timep, int_fast32_t setname,
hi = mid;
else lo = mid + 1;
}
i = (int) sp->types[lo - 1];
i = sp->types[lo - 1];
}
ttisp = &sp->ttis[i];
/*
@@ -1626,14 +1696,14 @@ offtime(const time_t *timep, long offset)
** where, to make the math easy, the answer for year zero is defined as zero.
*/
static int
leaps_thru_end_of_nonneg(int y)
static time_t
leaps_thru_end_of_nonneg(time_t y)
{
return y / 4 - y / 100 + y / 400;
}
static int
leaps_thru_end_of(register const int y)
static time_t
leaps_thru_end_of(time_t y)
{
return (y < 0
? -1 - leaps_thru_end_of_nonneg(-1 - y)
@@ -1646,111 +1716,106 @@ timesub(const time_t *timep, int_fast32_t offset,
{
register const struct lsinfo * lp;
register time_t tdays;
register int idays; /* unsigned would be so 2003 */
register int_fast64_t rem;
int y;
register const int * ip;
register int_fast64_t corr;
register bool hit;
register int_fast32_t corr;
register int i;
int_fast32_t idays, rem, dayoff, dayrem;
time_t y;
/* If less than SECSPERMIN, the number of seconds since the
most recent positive leap second; otherwise, do not add 1
to localtime tm_sec because of leap seconds. */
time_t secs_since_posleap = SECSPERMIN;
corr = 0;
hit = false;
i = (sp == NULL) ? 0 : sp->leapcnt;
while (--i >= 0) {
lp = &sp->lsis[i];
if (*timep >= lp->ls_trans) {
corr = lp->ls_corr;
hit = (*timep == lp->ls_trans
&& (i == 0 ? 0 : lp[-1].ls_corr) < corr);
if ((i == 0 ? 0 : lp[-1].ls_corr) < corr)
secs_since_posleap = *timep - lp->ls_trans;
break;
}
}
y = EPOCH_YEAR;
/* Calculate the year, avoiding integer overflow even if
time_t is unsigned. */
tdays = *timep / SECSPERDAY;
rem = *timep % SECSPERDAY;
while (tdays < 0 || tdays >= year_lengths[isleap(y)]) {
int newy;
register time_t tdelta;
register int idelta;
rem += offset % SECSPERDAY - corr % SECSPERDAY + 3 * SECSPERDAY;
dayoff = offset / SECSPERDAY - corr / SECSPERDAY + rem / SECSPERDAY - 3;
rem %= SECSPERDAY;
/* y = (EPOCH_YEAR
+ floor((tdays + dayoff) / DAYSPERREPEAT) * YEARSPERREPEAT),
sans overflow. But calculate against 1570 (EPOCH_YEAR -
YEARSPERREPEAT) instead of against 1970 so that things work
for localtime values before 1970 when time_t is unsigned. */
dayrem = tdays % DAYSPERREPEAT;
dayrem += dayoff % DAYSPERREPEAT;
y = (EPOCH_YEAR - YEARSPERREPEAT
+ ((1 + dayoff / DAYSPERREPEAT + dayrem / DAYSPERREPEAT
- ((dayrem % DAYSPERREPEAT) < 0)
+ tdays / DAYSPERREPEAT)
* YEARSPERREPEAT));
/* idays = (tdays + dayoff) mod DAYSPERREPEAT, sans overflow. */
idays = tdays % DAYSPERREPEAT;
idays += dayoff % DAYSPERREPEAT + 2 * DAYSPERREPEAT;
idays %= DAYSPERREPEAT;
/* Increase Y and decrease IDAYS until IDAYS is in range for Y. */
while (year_lengths[isleap(y)] <= idays) {
int tdelta = idays / DAYSPERLYEAR;
int_fast32_t ydelta = tdelta + !tdelta;
time_t newy = y + ydelta;
register int leapdays;
tdelta = tdays / DAYSPERLYEAR;
if (! ((! TYPE_SIGNED(time_t) || INT_MIN <= tdelta)
&& tdelta <= INT_MAX))
goto out_of_range;
idelta = tdelta;
if (idelta == 0)
idelta = (tdays < 0) ? -1 : 1;
newy = y;
if (increment_overflow(&newy, idelta))
goto out_of_range;
leapdays = leaps_thru_end_of(newy - 1) -
leaps_thru_end_of(y - 1);
tdays -= ((time_t) newy - y) * DAYSPERNYEAR;
tdays -= leapdays;
idays -= ydelta * DAYSPERNYEAR;
idays -= leapdays;
y = newy;
}
/*
** Given the range, we can now fearlessly cast...
*/
idays = tdays;
rem += offset - corr;
while (rem < 0) {
rem += SECSPERDAY;
--idays;
if (!TYPE_SIGNED(time_t) && y < TM_YEAR_BASE) {
int signed_y = y;
tmp->tm_year = signed_y - TM_YEAR_BASE;
} else if ((!TYPE_SIGNED(time_t) || INT_MIN + TM_YEAR_BASE <= y)
&& y - TM_YEAR_BASE <= INT_MAX)
tmp->tm_year = y - TM_YEAR_BASE;
else {
errno = EOVERFLOW;
return NULL;
}
while (rem >= SECSPERDAY) {
rem -= SECSPERDAY;
++idays;
}
while (idays < 0) {
if (increment_overflow(&y, -1))
goto out_of_range;
idays += year_lengths[isleap(y)];
}
while (idays >= year_lengths[isleap(y)]) {
idays -= year_lengths[isleap(y)];
if (increment_overflow(&y, 1))
goto out_of_range;
}
tmp->tm_year = y;
if (increment_overflow(&tmp->tm_year, -TM_YEAR_BASE))
goto out_of_range;
tmp->tm_yday = idays;
/*
** The "extra" mods below avoid overflow problems.
*/
tmp->tm_wday = EPOCH_WDAY +
((y - EPOCH_YEAR) % DAYSPERWEEK) *
(DAYSPERNYEAR % DAYSPERWEEK) +
leaps_thru_end_of(y - 1) -
leaps_thru_end_of(EPOCH_YEAR - 1) +
idays;
tmp->tm_wday = (TM_WDAY_BASE
+ ((tmp->tm_year % DAYSPERWEEK)
* (DAYSPERNYEAR % DAYSPERWEEK))
+ leaps_thru_end_of(y - 1)
- leaps_thru_end_of(TM_YEAR_BASE - 1)
+ idays);
tmp->tm_wday %= DAYSPERWEEK;
if (tmp->tm_wday < 0)
tmp->tm_wday += DAYSPERWEEK;
tmp->tm_hour = (int) (rem / SECSPERHOUR);
tmp->tm_hour = rem / SECSPERHOUR;
rem %= SECSPERHOUR;
tmp->tm_min = (int) (rem / SECSPERMIN);
/*
** A positive leap second requires a special
** representation. This uses "... ??:59:60" et seq.
*/
tmp->tm_sec = (int) (rem % SECSPERMIN) + hit;
tmp->tm_min = rem / SECSPERMIN;
tmp->tm_sec = rem % SECSPERMIN;
/* Use "... ??:??:60" at the end of the localtime minute containing
the second just before the positive leap second. */
tmp->tm_sec += secs_since_posleap <= tmp->tm_sec;
ip = mon_lengths[isleap(y)];
for (tmp->tm_mon = 0; idays >= ip[tmp->tm_mon]; ++(tmp->tm_mon))
idays -= ip[tmp->tm_mon];
tmp->tm_mday = (int) (idays + 1);
tmp->tm_mday = idays + 1;
tmp->tm_isdst = 0;
#ifdef TM_GMTOFF
tmp->TM_GMTOFF = offset;
#endif /* defined TM_GMTOFF */
return tmp;
out_of_range:
errno = EOVERFLOW;
return NULL;
}
char *
@@ -2005,10 +2070,10 @@ time2sub(struct tm *const tmp,
&& (yourtm.TM_GMTOFF < 0
? (-SECSPERDAY <= yourtm.TM_GMTOFF
&& (mytm.TM_GMTOFF <=
(SMALLEST (INT_FAST32_MAX, LONG_MAX)
(SMALLEST(INT_FAST32_MAX, LONG_MAX)
+ yourtm.TM_GMTOFF)))
: (yourtm.TM_GMTOFF <= SECSPERDAY
&& ((BIGGEST (INT_FAST32_MIN, LONG_MIN)
&& ((BIGGEST(INT_FAST32_MIN, LONG_MIN)
+ yourtm.TM_GMTOFF)
<= mytm.TM_GMTOFF)))) {
/* MYTM matches YOURTM except with the wrong UT offset.
@@ -2045,6 +2110,8 @@ time2sub(struct tm *const tmp,
for (j = sp->typecnt - 1; j >= 0; --j) {
if (sp->ttis[j].tt_isdst == yourtm.tm_isdst)
continue;
if (ttunspecified(sp, j))
continue;
newt = (t + sp->ttis[j].tt_utoff
- sp->ttis[i].tt_utoff);
if (! funcp(sp, &newt, offset, &mytm))
@@ -2093,8 +2160,8 @@ time2(struct tm * const tmp,
static time_t
time1(struct tm *const tmp,
struct tm *(*funcp) (struct state const *, time_t const *,
int_fast32_t, struct tm *),
struct tm *(*funcp)(struct state const *, time_t const *,
int_fast32_t, struct tm *),
struct state const *sp,
const int_fast32_t offset)
{
@@ -2137,7 +2204,7 @@ time1(struct tm *const tmp,
seen[i] = false;
nseen = 0;
for (i = sp->timecnt - 1; i >= 0; --i)
if (!seen[sp->types[i]]) {
if (!seen[sp->types[i]] && !ttunspecified(sp, sp->types[i])) {
seen[sp->types[i]] = true;
types[nseen++] = sp->types[i];
}
@@ -2226,7 +2293,7 @@ timeoff(struct tm *tmp, long offset)
#endif /* defined STD_INSPIRED */
static int_fast64_t
static int_fast32_t
leapcorr(struct state const *sp, time_t t)
{
register struct lsinfo const * lp;
@@ -2247,6 +2314,14 @@ leapcorr(struct state const *sp, time_t t)
#ifdef STD_INSPIRED
/* NETBSD_INSPIRED_EXTERN functions are exported to callers if
NETBSD_INSPIRED is defined, and are private otherwise. */
# if NETBSD_INSPIRED
# define NETBSD_INSPIRED_EXTERN
# else
# define NETBSD_INSPIRED_EXTERN static
# endif
/*
** IEEE Std 1003.1 (POSIX) says that 536457599
** shall correspond to "Wed Dec 31 23:59:59 UTC 1986", which
@@ -2352,7 +2427,7 @@ time(time_t *p)
if (r != (time_t) -1) {
int_fast32_t offset = EPOCH_LOCAL ? (daylight ? timezone : altzone) : 0;
if (increment_overflow32(&offset, -EPOCH_OFFSET)
|| increment_overflow_time (&r, offset)) {
|| increment_overflow_time(&r, offset)) {
errno = EOVERFLOW;
r = -1;
}
+1 -1
View File
@@ -4,7 +4,7 @@ asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time
.SH SYNOPSIS
.nf
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B #include <time.h>
.PP
.BR "extern char *tzname[];" " /\(** (optional) \(**/"
+1 -1
View File
@@ -41,7 +41,7 @@ strftime \- format date and time
.SH SYNOPSIS
.nf
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B #include <time.h>
.PP
.B "size_t strftime(char *restrict buf, size_t maxsize,"
+1 -1
View File
@@ -4,7 +4,7 @@ tzset \- initialize time conversion information
.SH SYNOPSIS
.nf
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B #include <time.h>
.PP
.B timezone_t tzalloc(char const *TZ);
+88 -184
View File
@@ -729,7 +729,11 @@ Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35
-11:00 US B%sT 1983 Oct 30 2:00
-10:00 US AH%sT 1983 Nov 30
-10:00 US H%sT
# The following switches don't quite make our 1970 cutoff.
# The following switches don't make our 1970 cutoff.
#
# Kiska observed Tokyo date and time during Japanese occupation from
# 1942-06-06 to 1943-07-29, and similarly for Attu from 1942-06-07 to
# 1943-05-29 (all dates American). Both islands are now uninhabited.
#
# Shanks writes that part of southwest Alaska (e.g. Aniak)
# switched from -11:00 to -10:00 on 1968-09-22 at 02:00,
@@ -825,6 +829,8 @@ Zone America/Phoenix -7:28:18 - LMT 1883 Nov 18 11:31:42
-7:00 - MST 1967
-7:00 US M%sT 1968 Mar 21
-7:00 - MST
Link America/Phoenix America/Creston
# From Arthur David Olson (1988-02-13):
# A writer from the Inter Tribal Council of Arizona, Inc.,
# notes in private correspondence dated 1987-12-28 that "Presently, only the
@@ -970,7 +976,7 @@ Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov 18 12:09:53
-5:00 US E%sT
#
# Perry County, Indiana, switched from eastern to central time in April 2006.
# From Alois Triendl (2019-07-09):
# From Alois Treindl (2019-07-09):
# The Indianapolis News, Friday 27 October 1967 states that Perry County
# returned to CST. It went again to EST on 27 April 1969, as documented by the
# Indianapolis star of Saturday 26 April.
@@ -1593,24 +1599,7 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
# From Paul Eggert (2020-01-10):
# See America/Toronto for most of Quebec, including Montreal.
# See America/Halifax for the Îles de la Madeleine and the Listuguj reserve.
#
# Matthews and Vincent (1998) also write that Quebec east of the -63
# meridian is supposed to observe AST, but residents as far east as
# Natashquan use EST/EDT, and residents east of Natashquan use AST.
# The Quebec department of justice writes in
# "The situation in Minganie and Basse-Côte-Nord"
# https://www.justice.gouv.qc.ca/en/department/ministre/functions-and-responsabilities/legal-time-in-quebec/the-situation-in-minganie-and-basse-cote-nord/
# that the coastal strip from just east of Natashquan to Blanc-Sablon
# observes Atlantic standard time all year round.
# This common practice was codified into law as of 2007; see Legal Time Act,
# CQLR c T-5.1 <http://legisquebec.gouv.qc.ca/en/ShowDoc/cs/T-5.1>.
# For lack of better info, guess this practice began around 1970, contra to
# Shanks & Pottenger who have this region observing AST/ADT.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Blanc-Sablon -3:48:28 - LMT 1884
-4:00 Canada A%sT 1970
-4:00 - AST
# See America/Puerto_Rico for east of Natashquan.
# Ontario
@@ -1649,54 +1638,6 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# time became a comic failure in Orillia. Toronto Star 2017-07-08.
# https://www.thestar.com/news/insight/2017/07/08/bold-attempt-at-daylight-saving-time-became-a-comic-failure-in-orillia.html
# From Paul Eggert (1997-10-17):
# Mark Brader writes that an article in the 1997-10-14 Toronto Star
# says that Atikokan, Ontario currently does not observe DST,
# but will vote on 11-10 whether to use EST/EDT.
# He also writes that the Ontario Time Act (1990, Chapter T.9)
# http://www.gov.on.ca/MBS/english/publications/statregs/conttext.html
# says that Ontario east of 90W uses EST/EDT, and west of 90W uses CST/CDT.
# Officially Atikokan is therefore on CST/CDT, and most likely this report
# concerns a non-official time observed as a matter of local practice.
#
# From Paul Eggert (2000-10-02):
# Matthews and Vincent (1998) write that Atikokan, Pickle Lake, and
# New Osnaburgh observe CST all year, that Big Trout Lake observes
# CST/CDT, and that Upsala and Shebandowan observe EST/EDT, all in
# violation of the official Ontario rules.
#
# From Paul Eggert (2006-07-09):
# Chris Walton (2006-07-06) mentioned an article by Stephanie MacLellan in the
# 2005-07-21 Chronicle-Journal, which said:
#
# The clocks in Atikokan stay set on standard time year-round.
# This means they spend about half the time on central time and
# the other half on eastern time.
#
# For the most part, the system works, Mayor Dennis Brown said.
#
# "The majority of businesses in Atikokan deal more with Eastern
# Canada, but there are some that deal with Western Canada," he
# said. "I don't see any changes happening here."
#
# Walton also writes "Supposedly Pickle Lake and Mishkeegogamang
# [New Osnaburgh] follow the same practice."
# From Garry McKinnon (2006-07-14) via Chris Walton:
# I chatted with a member of my board who has an outstanding memory
# and a long history in Atikokan (and in the telecom industry) and he
# can say for certain that Atikokan has been practicing the current
# time keeping since 1952, at least.
# From Paul Eggert (2006-07-17):
# Shanks & Pottenger say that Atikokan has agreed with Rainy River
# ever since standard time was introduced, but the information from
# McKinnon sounds more authoritative. For now, assume that Atikokan
# switched to EST immediately after WWII era daylight saving time
# ended. This matches the old (less-populous) America/Coral_Harbour
# entry since our cutoff date of 1970, so we can move
# America/Coral_Harbour to the 'backward' file.
# From Mark Brader (2010-03-06):
#
# Currently the database has:
@@ -1827,6 +1768,7 @@ Zone America/Toronto -5:17:32 - LMT 1895
-5:00 Canada E%sT 1946
-5:00 Toronto E%sT 1974
-5:00 Canada E%sT
Link America/Toronto America/Nassau
Zone America/Thunder_Bay -5:57:00 - LMT 1895
-6:00 - CST 1910
-5:00 - EST 1942
@@ -1842,11 +1784,7 @@ Zone America/Rainy_River -6:18:16 - LMT 1895
-6:00 Canada C%sT 1940 Sep 29
-6:00 1:00 CDT 1942 Feb 9 2:00s
-6:00 Canada C%sT
Zone America/Atikokan -6:06:28 - LMT 1895
-6:00 Canada C%sT 1940 Sep 29
-6:00 1:00 CDT 1942 Feb 9 2:00s
-6:00 Canada C%sT 1945 Sep 30 2:00
-5:00 - EST
# For Atikokan see America/Panama.
# Manitoba
@@ -1998,7 +1936,7 @@ Zone America/Swift_Current -7:11:20 - LMT 1905 Sep
# Alberta
# From Alois Triendl (2019-07-19):
# From Alois Treindl (2019-07-19):
# There was no DST in Alberta in 1967... Calgary Herald, 29 April 1967.
# 1969, no DST, from Edmonton Journal 18 April 1969
#
@@ -2037,60 +1975,6 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep
# Shanks & Pottenger write that since 1970 most of this region has
# been like Vancouver.
# Dawson Creek uses MST. Much of east BC is like Edmonton.
# Matthews and Vincent (1998) write that Creston is like Dawson Creek.
# It seems though that (re: Creston) is not entirely correct:
# From Chris Walton (2011-12-01):
# There are two areas within the Canadian province of British Columbia
# that do not currently observe daylight saving:
# a) The Creston Valley (includes the town of Creston and surrounding area)
# b) The eastern half of the Peace River Regional District
# (includes the cities of Dawson Creek and Fort St. John)
# Earlier this year I stumbled across a detailed article about the time
# keeping history of Creston; it was written by Tammy Hardwick who is the
# manager of the Creston & District Museum. The article was written in May 2009.
# http://www.ilovecreston.com/?p=articles&t=spec&ar=260
# According to the article, Creston has not changed its clocks since June 1918.
# i.e. Creston has been stuck on UT-7 for 93 years.
# Dawson Creek, on the other hand, changed its clocks as recently as April 1972.
# Unfortunately the exact date for the time change in June 1918 remains
# unknown and will be difficult to ascertain. I e-mailed Tammy a few months
# ago to ask if Sunday June 2 was a reasonable guess. She said it was just
# as plausible as any other date (in June). She also said that after writing
# the article she had discovered another time change in 1916; this is the
# subject of another article which she wrote in October 2010.
# http://www.creston.museum.bc.ca/index.php?module=comments&uop=view_comment&cm+id=56
# Here is a summary of the three clock change events in Creston's history:
# 1. 1884 or 1885: adoption of Mountain Standard Time (GMT-7)
# Exact date unknown
# 2. Oct 1916: switch to Pacific Standard Time (GMT-8)
# Exact date in October unknown; Sunday October 1 is a reasonable guess.
# 3. June 1918: switch to Pacific Daylight Time (GMT-7)
# Exact date in June unknown; Sunday June 2 is a reasonable guess.
# note 1:
# On Oct 27/1918 when daylight saving ended in the rest of Canada,
# Creston did not change its clocks.
# note 2:
# During WWII when the Federal Government legislated a mandatory clock change,
# Creston did not oblige.
# note 3:
# There is no guarantee that Creston will remain on Mountain Standard Time
# (UTC-7) forever.
# The subject was debated at least once this year by the town Council.
# http://www.bclocalnews.com/kootenay_rockies/crestonvalleyadvance/news/116760809.html
# During a period WWII, summer time (Daylight saying) was mandatory in Canada.
# In Creston, that was handled by shifting the area to PST (-8:00) then applying
# summer time to cause the offset to be -7:00, the same as it had been before
# the change. It can be argued that the timezone abbreviation during this
# period should be PDT rather than MST, but that doesn't seem important enough
# (to anyone) to further complicate the rules.
# The transition dates (and times) are guesses.
# From Matt Johnson (2015-09-21):
# Fort Nelson, BC, Canada will cancel DST this year. So while previously they
@@ -2107,7 +1991,7 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep
#
# From Paul Eggert (2019-07-25):
# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver.
# Alois Triendl confirmed this on 07-22, citing the 1946-04-27 Vancouver Daily
# Alois Treindl confirmed this on 07-22, citing the 1946-04-27 Vancouver Daily
# Province. He also cited the 1946-09-28 Victoria Daily Times, which said
# that Vancouver, Victoria, etc. "change at midnight Saturday"; for now,
# guess they meant 02:00 Sunday since 02:00 was common practice in Vancouver.
@@ -2144,10 +2028,7 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884
-8:00 Vanc P%sT 1987
-8:00 Canada P%sT 2015 Mar 8 2:00
-7:00 - MST
Zone America/Creston -7:46:04 - LMT 1884
-7:00 - MST 1916 Oct 1
-8:00 - PST 1918 Jun 2
-7:00 - MST
# For Creston see America/Phoenix.
# Northwest Territories, Nunavut, Yukon
@@ -2929,64 +2810,61 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
# Anguilla
# Antigua and Barbuda
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# Bahamas
#
# For 1899 Milne gives -5:09:29.5; round that.
#
# From P Chan (2020-11-27, corrected on 2020-12-02):
# There were two periods of DST observed in 1942-1945: 1942-05-01
# midnight to 1944-12-31 midnight and 1945-02-01 to 1945-10-17 midnight.
# "midnight" should mean 24:00 from the context.
#
# War Time Order 1942 [1942-05-01] and War Time (No. 2) Order 1942 [1942-09-29]
# Appendix to the Statutes of 7 George VI. and the Year 1942. p 34, 43
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA3-PA34
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA3-PA43
#
# War Time Order 1943 [1943-03-31] and War Time Order 1944 [1943-12-29]
# Appendix to the Statutes of 8 George VI. and the Year 1943. p 9-10, 28-29
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA4-PA9
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA4-PA28
#
# War Time Order 1945 [1945-01-31] and the Order which revoke War Time Order
# 1945 [1945-10-16] Appendix to the Statutes of 9 George VI. and the Year
# 1945. p 160, 247-248
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA6-PA160
# https://books.google.com/books?id=5rlNAQAAIAAJ&pg=RA6-PA247
#
# From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007....
# http://www.jonesbahamas.com/?c=45&a=10412
# The Bahamas
# See America/Toronto.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Bahamas 1942 only - May 1 24:00 1:00 W
Rule Bahamas 1944 only - Dec 31 24:00 0 S
Rule Bahamas 1945 only - Feb 1 0:00 1:00 W
Rule Bahamas 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule Bahamas 1945 only - Oct 17 24:00 0 S
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976
-5:00 US E%sT
# Barbados
# For 1899 Milne gives -3:58:29.2; round that.
# From P Chan (2020-12-09 and 2020-12-11):
# Standard time of GMT-4 was adopted in 1911.
# Definition of Time Act, 1911 (1911-7) [1911-08-28]
# 1912, Laws of Barbados (5 v.), OCLC Number: 919801291, Vol. 4, Image No. 522
# 1944, Laws of Barbados (5 v.), OCLC Number: 84548697, Vol. 4, Image No. 122
# http://llmc.com/browse.aspx?type=2&coll=85&div=297
#
# DST was observed in 1942-44.
# Defence (Daylight Saving) Regulations, 1942, 1942-04-13
# Defence (Daylight Saving) (Repeal) Regulations, 1942, 1942-08-22
# Defence (Daylight Saving) Regulations, 1943, 1943-04-16
# Defence (Daylight Saving) (Repeal) Regulations, 1943, 1943-09-01
# Defence (Daylight Saving) Regulations, 1944, 1944-03-21
# [Defence (Daylight Saving) (Amendment) Regulations 1944, 1944-03-28]
# Defence (Daylight Saving) (Repeal) Regulations, 1944, 1944-08-30
#
# 1914-, Subsidiary Legis., Annual Vols. OCLC Number: 226290591
# 1942: Image Nos. 527-528, 555-556
# 1943: Image Nos. 178-179, 198
# 1944: Image Nos. 113-115, 129
# http://llmc.com/titledescfull.aspx?type=2&coll=85&div=297&set=98437
#
# From Tim Parenti (2021-02-20):
# The transitions below are derived from P Chan's sources, except that the 1977
# through 1980 transitions are from Shanks & Pottenger since we have no better
# data there. Of particular note, the 1944 DST regulation only advanced the
# time to "exactly three and a half hours later than Greenwich mean time", as
# opposed to "three hours" in the 1942 and 1943 regulations.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Barb 1942 only - Apr 19 5:00u 1:00 D
Rule Barb 1942 only - Aug 31 6:00u 0 S
Rule Barb 1943 only - May 2 5:00u 1:00 D
Rule Barb 1943 only - Sep 5 6:00u 0 S
Rule Barb 1944 only - Apr 10 5:00u 0:30 -
Rule Barb 1944 only - Sep 10 6:00u 0 S
Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown
-3:58:29 - BMT 1932 # Bridgetown Mean Time
Zone America/Barbados -3:58:29 - LMT 1911 Aug 28 # Bridgetown
-4:00 Barb A%sT 1944
-4:00 Barb AST/-0330 1945
-4:00 Barb A%sT
# Belize
@@ -3148,6 +3026,9 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 1890 # Hamilton
-4:00 Canada A%sT 1976
-4:00 US A%sT
# Caribbean Netherlands
# See America/Puerto_Rico.
# Cayman Is
# See America/Panama.
@@ -3376,7 +3257,7 @@ Zone America/Havana -5:29:28 - LMT 1890
-5:00 Cuba C%sT
# Dominica
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# Dominican Republic
@@ -3428,7 +3309,7 @@ Zone America/El_Salvador -5:56:48 - LMT 1921 # San Salvador
# Guadeloupe
# St Barthélemy
# St Martin (French part)
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# Guatemala
#
@@ -3615,7 +3496,7 @@ Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France
-4:00 - AST
# Montserrat
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# Nicaragua
#
@@ -3687,6 +3568,7 @@ Zone America/Managua -5:45:08 - LMT 1890
Zone America/Panama -5:18:08 - LMT 1890
-5:19:36 - CMT 1908 Apr 22 # Colón Mean Time
-5:00 - EST
Link America/Panama America/Atikokan
Link America/Panama America/Cayman
# Puerto Rico
@@ -3696,10 +3578,29 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan
-4:00 - AST 1942 May 3
-4:00 US A%sT 1946
-4:00 - AST
Link America/Puerto_Rico America/Anguilla
Link America/Puerto_Rico America/Antigua
Link America/Puerto_Rico America/Aruba
Link America/Puerto_Rico America/Curacao
Link America/Puerto_Rico America/Blanc-Sablon # Quebec (Lower North Shore)
Link America/Puerto_Rico America/Dominica
Link America/Puerto_Rico America/Grenada
Link America/Puerto_Rico America/Guadeloupe
Link America/Puerto_Rico America/Kralendijk # Caribbean Netherlands
Link America/Puerto_Rico America/Lower_Princes # Sint Maarten
Link America/Puerto_Rico America/Marigot # St Martin (French part)
Link America/Puerto_Rico America/Montserrat
Link America/Puerto_Rico America/Port_of_Spain # Trinidad & Tobago
Link America/Puerto_Rico America/St_Barthelemy # St Barthélemy
Link America/Puerto_Rico America/St_Kitts # St Kitts & Nevis
Link America/Puerto_Rico America/St_Lucia
Link America/Puerto_Rico America/St_Thomas # Virgin Islands (US)
Link America/Puerto_Rico America/St_Vincent
Link America/Puerto_Rico America/Tortola # Virgin Islands (UK)
# St Kitts-Nevis
# St Lucia
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# St Pierre and Miquelon
# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
@@ -3710,7 +3611,10 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
-3:00 Canada -03/-02
# St Vincent and the Grenadines
# See America/Port_of_Spain.
# See America/Puerto_Rico.
# Sint Maarten
# See America/Puerto_Rico.
# Turks and Caicos
#
@@ -3781,8 +3685,8 @@ Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:00 US E%sT
# British Virgin Is
# Virgin Is
# See America/Port_of_Spain.
# US Virgin Is
# See America/Puerto_Rico.
# Local Variables:
+51 -29
View File
@@ -66,6 +66,10 @@
#define HAVE_LINK 1
#endif /* !defined HAVE_LINK */
#ifndef HAVE_MALLOC_ERRNO
#define HAVE_MALLOC_ERRNO 1
#endif
#ifndef HAVE_POSIX_DECLS
#define HAVE_POSIX_DECLS 1
#endif
@@ -90,10 +94,6 @@
#define HAVE_SYS_STAT_H 1
#endif /* !defined HAVE_SYS_STAT_H */
#ifndef HAVE_SYS_WAIT_H
#define HAVE_SYS_WAIT_H 1
#endif /* !defined HAVE_SYS_WAIT_H */
#ifndef HAVE_UNISTD_H
#define HAVE_UNISTD_H 1
#endif /* !defined HAVE_UNISTD_H */
@@ -164,9 +164,16 @@
#include <errno.h>
#ifndef EINVAL
# define EINVAL ERANGE
#endif
#ifndef ENAMETOOLONG
# define ENAMETOOLONG EINVAL
#endif
#ifndef ENOMEM
# define ENOMEM EINVAL
#endif
#ifndef ENOTSUP
# define ENOTSUP EINVAL
#endif
@@ -218,9 +225,6 @@
#define R_OK 4
#endif /* !defined R_OK */
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/*
** Define HAVE_STDINT_H's default value here, rather than at the
** start, since __GLIBC__ and INTMAX_MAX's values depend on
@@ -321,6 +325,10 @@ typedef long intmax_t;
# endif
#endif
#ifndef UINT_FAST32_MAX
typedef unsigned long uint_fast32_t;
#endif
#ifndef UINT_FAST64_MAX
# if defined ULLONG_MAX || defined __LONG_LONG_MAX__
typedef unsigned long long uint_fast64_t;
@@ -361,10 +369,10 @@ typedef unsigned long uintmax_t;
#endif
#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))
# 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 */
@@ -374,7 +382,7 @@ typedef unsigned long uintmax_t;
#if !defined _Noreturn && __STDC_VERSION__ < 201112
# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
# define _Noreturn __attribute__ ((__noreturn__))
# define _Noreturn __attribute__((__noreturn__))
# else
# define _Noreturn
# endif
@@ -418,10 +426,11 @@ typedef unsigned long uintmax_t;
# define TZ_TIME_T 0
#endif
#if TZ_TIME_T
# ifdef LOCALTIME_IMPLEMENTATION
#if defined LOCALTIME_IMPLEMENTATION && TZ_TIME_T
static time_t sys_time(time_t *x) { return time(x); }
# endif
#endif
#if TZ_TIME_T
typedef time_tz tz_time_t;
@@ -619,7 +628,7 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
# define bool int
#endif
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
#define TYPE_BIT(type) (sizeof(type) * CHAR_BIT)
#define TYPE_SIGNED(type) (((type) -1) < 0)
#define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0)
@@ -637,7 +646,7 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
#define TIME_T_MAX_NO_PADDING MAXVAL(time_t, TYPE_BIT(time_t))
/* The extreme time values. These are macros, not constants, so that
any portability problem occur only when compiling .c files that use
any portability problems occur only when compiling .c files that use
the macros, which is safer for applications that need only zdump and zic.
This implementation assumes no padding if time_t is signed and
either the compiler lacks support for _Generic or time_t is not one
@@ -680,10 +689,29 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
# define INITIALIZE(x)
#endif
/* Whether memory access must strictly follow the C standard.
If 0, it's OK to read uninitialized storage so long as the value is
not relied upon. Defining it to 0 lets mktime access parts of
struct tm that might be uninitialized, as a heuristic when the
standard doesn't say what to return and when tm_gmtoff can help
mktime likely infer a better value. */
#ifndef UNINIT_TRAP
# define UNINIT_TRAP 0
#endif
#ifdef DEBUG
# define UNREACHABLE() abort()
#elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
# define UNREACHABLE() __builtin_unreachable()
#elif defined __has_builtin
# if __has_builtin(__builtin_unreachable)
# define UNREACHABLE() __builtin_unreachable()
# endif
#endif
#ifndef UNREACHABLE
# define UNREACHABLE() ((void) 0)
#endif
/*
** For the benefit of GNU folk...
** '_(MSGID)' uses the current locale's message library string for MSGID.
@@ -709,8 +737,6 @@ char *ctime_r(time_t const *, char *);
/* Handy macros that are independent of tzfile implementation. */
#define YEARSPERREPEAT 400 /* years before a Gregorian repeat */
#define SECSPERMIN 60
#define MINSPERHOUR 60
#define HOURSPERDAY 24
@@ -721,6 +747,11 @@ char *ctime_r(time_t const *, char *);
#define SECSPERDAY ((int_fast32_t) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR 12
#define YEARSPERREPEAT 400 /* years before a Gregorian repeat */
#define DAYSPERREPEAT ((int_fast32_t) 400 * 365 + 100 - 4 + 1)
#define SECSPERREPEAT ((int_fast64_t) DAYSPERREPEAT * SECSPERDAY)
#define AVGSECSPERYEAR (SECSPERREPEAT / YEARSPERREPEAT)
#define TM_SUNDAY 0
#define TM_MONDAY 1
#define TM_TUESDAY 2
@@ -743,6 +774,7 @@ char *ctime_r(time_t const *, char *);
#define TM_DECEMBER 11
#define TM_YEAR_BASE 1900
#define TM_WDAY_BASE TM_MONDAY
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
@@ -763,14 +795,4 @@ char *ctime_r(time_t const *, char *);
#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
/*
** The Gregorian year averages 365.2425 days, which is 31556952 seconds.
*/
#define AVGSECSPERYEAR 31556952L
#define SECSPERREPEAT \
((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
#endif /* !defined PRIVATE_H */
+76 -58
View File
@@ -574,7 +574,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
-3:00 - -03
# Aruba
Link America/Curacao America/Aruba
# See America/Puerto_Rico.
# Bolivia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1086,7 +1086,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Chile
# From Paul Eggert (2015-04-03):
# From Paul Eggert (2022-03-15):
# Shanks & Pottenger says America/Santiago introduced standard time in
# 1890 and rounds its UT offset to 70W40; guess that in practice this
# was the same offset as in 1916-1919. It also says Pacific/Easter
@@ -1109,7 +1109,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Historia de la hora oficial de Chile (retrieved 2012-10-24). See:
# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
# A fancier Spanish version (requiring mouse-clicking) is at:
# http://www.horaoficial.cl/historia_hora.html
# http://www.horaoficial.cl/historia_hora.php
# Conflicts between [1] and [2] were resolved as follows:
#
# - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
@@ -1118,7 +1118,8 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# - [1] says SMT was -4:42:45, [2] says Chile's official time from
# 1916 to 1919 was -4:42:46.3, the meridian of Chile's National
# Astronomical Observatory (OAN), then located in what is now
# Quinta Normal in Santiago. Go with [2], rounding it to -4:42:46.
# Quinta Normal in Santiago. Go with [1], as this matches the meridian
# referred to by the relevant Chilean laws to this day.
#
# - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
# Boletín No. 22, Aviso No. 129/1918 (1918-08-23). Go with [2].
@@ -1140,6 +1141,32 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# this is known to work for DST transitions starting in 2008 and
# may well be true for earlier transitions.
# From Tim Parenti (2022-03-15):
# For a brief period of roughly six weeks in 1946, DST was only observed on an
# emergency basis in specific regions of central Chile; namely, "the national
# territory between the provinces of Coquimbo and Concepción, inclusive".
# This was enacted by Decree 3,891, dated 1946-07-13, and took effect
# 1946-07-14 24:00, advancing these central regions to -03.
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460715/#page/1
# The decree contemplated "[t]hat this advancement of the Official Time, even
# though it has been proposed for the cities of Santiago and Valparaíso only,
# must be agreed with that of other cities, due to the connection of various
# activities that require it, such as, for example, the operation of rail
# services". It was originally set to expire after 30 days but was extended
# through 1946-08-31 by Decree 4,506, dated 1946-08-13.
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460814/#page/1
#
# Law Number 8,522, promulgated 1946-08-27, reunified Chilean clocks at their
# new "Summer Time" of -04, reckoned as that of "the meridian of the
# Astronomical Observatory of Lo Espejo, advanced by 42 minutes and 45
# seconds".
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460828/#page/1
# After a brief "Winter Time" stint at -05 beginning 1947-04-01, Law Number
# 8,777, promulgated 1947-05-17, established year-round -04 "from 23:00 on the
# second day after it is published in the 'Diario Oficial'." It was published
# on Monday 1947-05-19 and so took effect from Wednesday 1947-05-21 23:00.
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19470519/#page/1
# From Eduardo Krell (1995-10-19):
# The law says to switch to DST at midnight [24:00] on the second SATURDAY
# of October.... The law is the same for March and October.
@@ -1298,12 +1325,12 @@ Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Santiago -4:42:46 - LMT 1890
-4:42:46 - SMT 1910 Jan 10 # Santiago Mean Time
Zone America/Santiago -4:42:45 - LMT 1890
-4:42:45 - SMT 1910 Jan 10 # Santiago Mean Time
-5:00 - -05 1916 Jul 1
-4:42:46 - SMT 1918 Sep 10
-4:42:45 - SMT 1918 Sep 10
-4:00 - -04 1919 Jul 1
-4:42:46 - SMT 1927 Sep 1
-4:42:45 - SMT 1927 Sep 1
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
@@ -1313,11 +1340,11 @@ Zone America/Santiago -4:42:46 - LMT 1890
-5:00 - -05 1947 May 21 23:00
-4:00 Chile -04/-03
Zone America/Punta_Arenas -4:43:40 - LMT 1890
-4:42:46 - SMT 1910 Jan 10
-4:42:45 - SMT 1910 Jan 10
-5:00 - -05 1916 Jul 1
-4:42:46 - SMT 1918 Sep 10
-4:42:45 - SMT 1918 Sep 10
-4:00 - -04 1919 Jul 1
-4:42:46 - SMT 1927 Sep 1
-4:42:45 - SMT 1927 Sep 1
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
@@ -1369,35 +1396,14 @@ Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
# no information; probably like America/Bogota
# Curaçao
# Milne gives 4:35:46.9 for Curaçao mean time; round to nearest.
# See America/Puerto_Rico.
#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at
# -4:00 since standard time was introduced on 1912-03-02; and that
# Kralendijk and Rincon used Kralendijk Mean Time (-4:33:08) from
# 1912-02-02 to 1965-01-01. The former is dubious, since S&P also say
# Saba Island has been like Curaçao.
# This all predates our 1970 cutoff, though.
#
# By July 2007 Curaçao and St Maarten are planned to become
# associated states within the Netherlands, much like Aruba;
# Bonaire, Saba and St Eustatius would become directly part of the
# Netherlands as Kingdom Islands. This won't affect their time zones
# though, as far as we know.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
-4:30 - -0430 1965
-4:00 - AST
# From Arthur David Olson (2011-06-15):
# use links for places with new iso3166 codes.
# The name "Lower Prince's Quarter" is both longer than fourteen characters
# and contains an apostrophe; use "Lower_Princes" below.
Link America/Curacao America/Lower_Princes # Sint Maarten
Link America/Curacao America/Kralendijk # Caribbean Netherlands
# and contains an apostrophe; use "Lower_Princes"....
# From Paul Eggert (2021-09-29):
# These backward-compatibility links now are in the 'northamerica' file.
# Ecuador
#
@@ -1540,11 +1546,40 @@ Zone America/Cayenne -3:29:20 - LMT 1911 Jul
-3:00 - -03
# Guyana
# From P Chan (2020-11-27):
# https://books.google.com/books?id=5-5CAQAAMAAJ&pg=SA1-PA547
# The Official Gazette of British Guiana. (New Series.) Vol. XL. July to
# December, 1915, p 1547, lists as several notes:
# "Local Mean Time 3 hours 52 mins. 39 secs. slow of Greenwich Mean Time
# (Georgetown.) From 1st August, 1911, British Guiana Standard Mean Time 4
# hours slow of Greenwich Mean Time, by notice in Official Gazette on 1st July,
# 1911. From 1st March, 1915, British Guiana Standard Mean Time 3 hours 45
# mins. 0 secs. slow of Greenwich Mean Time, by notice in Official Gazette on
# 23rd January, 1915."
#
# https://parliament.gov.gy/documents/acts/10923-act_no._27_of_1975_-_interpretation_and_general_clauses_(amendment)_act_1975.pdf
# Interpretation and general clauses (Amendment) Act 1975 (Act No. 27 of 1975)
# [dated 1975-07-31]
# "This Act...shall come into operation on 1st August, 1975."
# "...where any expression of time occurs...the time referred to shall signify
# the standard time of Guyana which shall be three hours behind Greenwich Mean
# Time."
#
# Circular No. 10/1992 dated 1992-03-20
# https://dps.gov.gy/wp-content/uploads/2018/12/1992-03-20-Circular-010.pdf
# "...cabinet has decided that with effect from Sunday 29th March, 1992, Guyana
# Standard Time would be re-established at 01:00 hours by adjusting the hands
# of the clock back to 24:00 hours."
# Legislated in the Interpretation and general clauses (Amendment) Act 1992
# (Act No. 6 of 1992) [passed 1992-03-27, published 1992-04-18]
# https://parliament.gov.gy/documents/acts/5885-6_of_1992_interpretation_and_general_clauses_(amendment)_act_1992.pdf
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Guyana -3:52:40 - LMT 1915 Mar # Georgetown
-3:45 - -0345 1975 Jul 31
-3:00 - -03 1991
# IATA SSIM (1996-06) says -4:00. Assume a 1991 switch.
Zone America/Guyana -3:52:39 - LMT 1911 Aug 1 # Georgetown
-4:00 - -04 1915 Mar 1
-3:45 - -0345 1975 Aug 1
-3:00 - -03 1992 Mar 29 1:00
-4:00 - -04
# Paraguay
@@ -1685,24 +1720,7 @@ Zone America/Paramaribo -3:40:40 - LMT 1911
-3:00 - -03
# Trinidad and Tobago
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2
-4:00 - AST
# These all agree with Trinidad and Tobago since 1970.
Link America/Port_of_Spain America/Anguilla
Link America/Port_of_Spain America/Antigua
Link America/Port_of_Spain America/Dominica
Link America/Port_of_Spain America/Grenada
Link America/Port_of_Spain America/Guadeloupe
Link America/Port_of_Spain America/Marigot # St Martin (French part)
Link America/Port_of_Spain America/Montserrat
Link America/Port_of_Spain America/St_Barthelemy # St Barthélemy
Link America/Port_of_Spain America/St_Kitts # St Kitts & Nevis
Link America/Port_of_Spain America/St_Lucia
Link America/Port_of_Spain America/St_Thomas # Virgin Islands (US)
Link America/Port_of_Spain America/St_Vincent
Link America/Port_of_Spain America/Tortola # Virgin Islands (UK)
# See America/Puerto_Rico.
# Uruguay
# From Paul Eggert (1993-11-18):
+7 -5
View File
@@ -335,11 +335,13 @@ label:
&& tm.tm_sec == tm_1.tm_sec))
return NULL;
}
if (TYPE_SIGNED(time_t))
sprintf(buf, "%"PRIdMAX,
(intmax_t) mkt);
else sprintf(buf, "%"PRIuMAX,
(uintmax_t) mkt);
if (TYPE_SIGNED(time_t)) {
intmax_t n = mkt;
sprintf(buf, "%"PRIdMAX, n);
} else {
uintmax_t n = mkt;
sprintf(buf, "%"PRIuMAX, n);
}
pt = _add(buf, pt, ptlim);
}
continue;
+41 -25
View File
@@ -42,12 +42,13 @@ 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 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
to the wide variety of local practices before computer timekeeping
became prevalent.
Most timezones correspond to a notable location and the database
records all known clock transitions for that location;
some timezones correspond instead to a fixed <abbr>UTC</abbr> offset.
</p>
<p>
@@ -58,8 +59,9 @@ 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.
time (<abbr>DST</abbr>),
<code>America/Mazatlan</code> which observes Mexican-style <abbr>DST</abbr>,
and <code>America/Phoenix</code> which does not observe <abbr>DST</abbr>.
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
@@ -68,7 +70,7 @@ time but differs from other timezones for some timestamps after 1970.
</p>
<p>
Clock transitions before 1970 are recorded for each timezone,
Clock transitions before 1970 are recorded for location-based timezones,
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
@@ -190,8 +192,8 @@ in decreasing order of importance:
<code>TZ</code> strings</a>.
A file name component must not exceed 14 characters or start with
'<code>-</code>'.
E.g., prefer <code>Asia/Brunei</code> to
<code>Asia/Bandar_Seri_Begawan</code>.
E.g., prefer <code>America/Noronha</code> to
<code>America/Fernando_de_Noronha</code>.
Exceptions: see the discussion of legacy names below.
</li>
<li>
@@ -294,7 +296,7 @@ in decreasing order of importance:
</li>
<li>
If a name is changed, put its old spelling in the
'<code>backward</code>' file.
'<code>backward</code>' file as a link to the new spelling.
This means old spellings will continue to work.
Ordinarily a name change should occur only in the rare case when
a location's consensus English-language spelling changes; for example,
@@ -346,22 +348,37 @@ timestamps correctly and it increased maintenance burden.
</ul>
<p>
The file '<code>zone1970.tab</code>' lists geographical locations used
The file <code>zone1970.tab</code> lists geographical locations used
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 timezones in the data.
Although a '<code>zone1970.tab</code>' location's
Although a <code>zone1970.tab</code> location's
<a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
corresponds to
its <a href="https://en.wikipedia.org/wiki/Local_mean_time">local mean
time (<abbr>LMT</abbr>)</a> offset with one hour for every 15&deg;
east longitude, this relationship is not exact.
The backward-compatibility file <code>zone.tab</code> is similar
but conforms to the older-version guidelines related to <abbr>ISO</abbr> 3166-1;
it lists only one country code per entry and unlike <code>zone1970.tab</code>
it can list names defined in <code>backward</code>.
</p>
<p>
Excluding '<code>backward</code>' should not affect the other data.
If '<code>backward</code>' is excluded, excluding
'<code>etcetera</code>' should not affect the remaining data.
The database defines each timezone name to be a zone, or a link to a zone.
The source file <code>backward</code> defines links for backward
compatibility; it does not define zones.
Although <code>backward</code> was originally designed to be optional,
nowadays distributions typically use it
and no great weight should be attached to whether a link
is defined in <code>backward</code> or in some other file.
The source file <code>etcetera</code> defines names that may be useful
on platforms that do not support POSIX-style <code>TZ</code> strings;
no other source file other than <code>backward</code>
contains links to its zones.
One of <code>etcetera</code>'s names is <code>GMT</code>,
used by functions like <code>gmtime</code> to obtain leap
second information on platforms that support leap seconds.
</p>
</section>
@@ -473,10 +490,10 @@ in decreasing order of importance:
<p>
<small>These abbreviations are:
AMT Amsterdam, Asunción, Athens;
AMT Asunción, Athens;
BMT Baghdad, Bangkok, Batavia, Bermuda, Bern, Bogotá, Bridgetown,
Brussels, Bucharest;
CMT Calamarca, Caracas, Chisinau, Colón, Copenhagen, Córdoba;
CMT Calamarca, Caracas, Chisinau, Colón, Córdoba;
DMT Dublin/Dunsink;
EMT Easter;
FFMT Fort-de-France;
@@ -499,7 +516,8 @@ in decreasing order of importance:
SMT Santiago, Simferopol, Singapore, Stanley;
TBMT Tbilisi;
TMT Tallinn, Tehran;
WMT Warsaw</small>.
WMT Warsaw;
ZMT Zomba.</small>
</p>
<p>
@@ -513,9 +531,7 @@ in decreasing order of importance:
1880&ndash;1916,
MMT/MST/MDST for Moscow 1880&ndash;1919, and
RMT/LST for Riga Mean Time and Latvian Summer time 1880&ndash;1926.
An extra-special case is SET for Swedish Time (<em>svensk
normaltid</em>) 1879&ndash;1899, 3&deg; west of the Stockholm
Observatory.</small>
</small>
</p>
</li>
<li>
@@ -702,11 +718,9 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
<li>
Sometimes historical timekeeping was specified more precisely
than what the <code><abbr>tz</abbr></code> code can handle.
For example, from 1909 to 1937 <a
href="https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm"
hreflang="nl">Netherlands clocks</a> were legally Amsterdam Mean
For example, from 1880 to 1916 clocks in Ireland observed Dublin Mean
Time (estimated to be <abbr>UT</abbr>
+00:19:32.13), but the <code><abbr>tz</abbr></code>
&minus;00:25:21.1), but the <code><abbr>tz</abbr></code>
code cannot represent the fractional second.
In practice these old specifications were rarely if ever
implemented to subsecond precision.
@@ -753,7 +767,8 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
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
such as that required by POSIX.
If <abbr>DST</abbr> 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.
@@ -1271,7 +1286,8 @@ The directly-supported mechanism assumes that <code>time_t</code>
counts of seconds since the POSIX epoch normally include leap seconds,
as opposed to POSIX <code>time_t</code> counts which exclude leap seconds.
This modified timescale is converted to <abbr>UTC</abbr>
at the same point that time zone and DST adjustments are applied &ndash;
at the same point that time zone and <abbr>DST</abbr>
adjustments are applied &ndash;
namely, at calls to <code>localtime</code> and analogous functions &ndash;
and the process is driven by leap second information
stored in alternate versions of the <abbr>TZif</abbr> files.
+1 -1
View File
@@ -4,7 +4,7 @@ time2posix, posix2time \- convert seconds since the Epoch
.SH SYNOPSIS
.nf
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B #include <time.h>
.PP
.B time_t time2posix(time_t t);
+10 -8
View File
@@ -144,12 +144,13 @@ In the "14 Days to Go"/"T Minus..." episode of
(first aired 2015-11-11 in the UK, 2016-03-10 in the US),
the success of a mission to deal with a comet
hinges on whether or not Russia observes daylight saving time.
(In the US, the episode first aired in the week before the switch to DST.)
(In the US,
the episode first aired in the week before the switch to <abbr>DST</abbr>.)
</li>
<li>
"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.
Despite Indiana's then-lack of <abbr>DST</abbr>,
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>".
@@ -157,7 +158,8 @@ Indiana</em> was a few dimensions ahead of its time</a>".
<li>
"Time Tunnel", <em>The Adventures of Pete &amp; Pete</em>, season 2, episode 5,
Nickelodeon, 1994-10-23.
The two Petes travel back in time an hour on the day that DST ends.
The two Petes travel back in time an hour
on the day that <abbr>DST</abbr> ends.
</li>
<li>
"King-Size Homer", <em>The Simpsons</em>, episode 135, Fox, 1995-11-05.
@@ -178,7 +180,7 @@ 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
Jonah's inability to understand <abbr>DST</abbr> ends up impressing a wealthy
backer who sets him up for a 2020 presidential run.
</li>
</ul>
@@ -223,7 +225,7 @@ of the 1999-11 <em>Atlantic Monthly</em>.
<li>
"Gloom, Gloom, Go Away" by Walter Kirn appeared on page 106 of <em>Time</em>
magazine's 2002-11-11 issue; among other things, it proposed
year-round DST as a way of lessening wintertime despair.
year-round <abbr>DST</abbr> as a way of lessening wintertime despair.
</li>
</ul>
<h2>Music</h2>
@@ -395,8 +397,8 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
<tr><td>Total Time</td><td>4:13</td></tr>
<tr><td>Notes</td><td>Won the 2004 Record of the Year honor at the
Grammy Awards. Co-written and performed by Chris Martin,
great-great-grandson of DST inventor William Willett. The song's first
line is "Lights go out and I can't be saved".</td></tr>
great-great-grandson of <abbr>DST</abbr> inventor William Willett.
The song's first line is "Lights go out and I can't be saved".</td></tr>
<tr><td>&nbsp;</td><td></td></tr>
<tr><td>Artist</td><td>Jaime Guevara</td></tr>
+67 -50
View File
@@ -89,7 +89,6 @@ title="Berkeley Software Distribution">BSD</abbr></a>,
title="Web Operating System">webOS</abbr></a>,
<a href="https://en.wikipedia.org/wiki/IBM_AIX"><abbr
title="Advanced Interactive eXecutive">AIX</abbr></a>,
<a href="https://en.wikipedia.org/wiki/BlackBerry_10">BlackBerry 10</a>,
<a href="https://www.apple.com/ios"><abbr
title="iPhone OS">iOS</abbr></a>,
<a href="https://www.apple.com/macos">macOS</a>,
@@ -167,6 +166,10 @@ Since 1996, each version has been a four-digit year followed by
lower-case letter (<samp>a</samp> through <samp>z</samp>,
then <samp>za</samp> through <samp>zz</samp>, then <samp>zza</samp>
through <samp>zzz</samp>, and so on).
Since version 1999g, each release has been distributed in
<a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06">POSIX
ustar interchange format</a>, compressed as described above;
older releases use a nearly-compatible format.
Since version 2016h, each release has contained a text file named
"<samp>version</samp>" whose first (and currently only) line is the version.
Older releases are <a href="https://ftp.iana.org/tz/releases/">archived</a>,
@@ -239,18 +242,18 @@ the process by tailoring the generic instructions in
the <code><abbr>tz</abbr> README</code> file and installing the latest
data yourself. System-specific instructions for installing the
latest <code><abbr>tz</abbr></code> data have also been published
for <a href="https://www.ibm.com/developerworks/aix/library/au-aix-olson-time-zone/index.html"><abbr>AIX</abbr></a>,
for <a href="https://developer.ibm.com/articles/au-aix-olson-time-zone/"><abbr>AIX</abbr></a>,
<a
href="https://play.google.com/store/apps/details?id=com.google.android.timezone.data">Android</a>,
href="https://source.android.com/devices/tech/config/timezone-rules">Android</a>,
<a
href="http://userguide.icu-project.org/datetime/timezone"><abbr
href="https://unicode-org.github.io/icu/userguide/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 href="https://www.ibm.com/support/pages/java-sdk-time-zone-update-utility"><abbr>IBM</abbr>
JDK</a>,
<a href="https://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>,
<a href="https://nodatime.org/userguide/tzdb">Noda Time</a>, and <a
href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html#usage">OpenJDK/Oracle JDK</a>.
href="https://www.oracle.com/java/technologies/javase/tzupdater-readme.html">OpenJDK/Oracle JDK</a>.
</p>
<p>Sources for the <code><abbr>tz</abbr></code> database are
<a href="https://en.wikipedia.org/wiki/UTF-8"><abbr
@@ -295,6 +298,8 @@ database format.</li>
href="https://blog.jonudell.net/2009/10/23/a-literary-appreciation-of-the-olsonzoneinfotz-database/">A
literary appreciation of the Olson/Zoneinfo/tz database</a> comments on the
database's style.</li>
<li><a href="https://doi.org/10.1145/3340301.3341125">What time is it:
managing time in the internet</a> analyzes the database longitudinally.</li>
</ul>
</section>
@@ -326,7 +331,8 @@ Time in 1000 Places</a> uses descriptions of the values.</li>
<li><a href="https://timezoneconverterapp.com/">Time Zone Converter</a>
uses a pulldown menu.</li>
<li><a href="https://home.kpn.nl/vanadovv/time/TZworld.html">Complete
timezone information for all countries</a> displays tables of DST rules.
timezone information for all countries</a>
displays tables of <abbr>DST</abbr> 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="https://24timezones.com">24TimeZones</a> has a world
@@ -474,28 +480,49 @@ It is freely available under the Apache License.</li>
<a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>
runtimes support <code><abbr>tz</abbr></code> natively via the
<samp>timeZone</samp> option of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat"><samp>Intl.DateTimeFormat</samp></a>.
On other runtimes, you can use one of the following.
This can be used as-is or with most of the following libraries,
many of which also support runtimes lacking the <samp>timeZone</samp> option.
<ul>
<li>The <a
href="https://github.com/formatjs/date-time-format-timezone"><samp>Intl.DateTimeFormat</samp>
timezone polyfill</a>
is freely available under a <abbr>BSD</abbr>-style license.</li>
<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>The <a href="https://date-fns.org/">date-fns</a>
library manipulates timezone-aware timestamps in browsers and
in <a href="https://nodejs.org/en/">Node.js</a>.
It is freely available under the <abbr>MIT</abbr> license.</li>
<li><a href="https://github.com/iamkun/dayjs">Day.js</a> is a
minimalist replacement for the date and time API of
the <a href="https://momentjs.com/docs/">now-legacy Moment.js</a> date
manipulation library.
It is freely available under the <abbr>MIT</abbr> license.</li>
<li><a href="https://moment.github.io/luxon/">Luxon</a> improves
timezone support for the <samp>Intl</samp> API.
It is freely available under the <abbr>MIT</abbr> 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>
license.</li>
Moment.js plugin.
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>
<li><a href="https://github.com/mde/timezone-js">TimezoneJS.Date</a>'s
<abbr>API</abbr> is upward compatible with standard JavaScript
Dates. It is freely available under the Apache License.</li>
<li><a href="https://www.npmjs.com/package/@tubular/time">@tubular/time</a>
supports live <code><abbr>tzdb</abbr></code> updates,
astronomical and atomic time, a command-line interface,
and full <a
href="https://en.wikipedia.org/wiki/TypeScript">TypeScript</a>.
Its companion <a
href="https://www.npmjs.com/package/@tubular/time-tzdb">@tubular/time-tzdb</a>
can generate <abbr>TZif</abbr> and other files, and a companion website
<a href="https://tzexplorer.org">Timezone Database Explorer</a> lets you
convert timestamps, view transition histories, and download code and data.
It is freely available under the <abbr>MIT</abbr> license.</li>
</ul>
The proposed <a
href="https://github.com/tc39/proposal-temporal"><samp>Temporal</samp>
objects</a> let programs access an abstract view of
<code><abbr>tzdb</abbr></code> data, and are designed to replace <a
href="https://codeofmatt.com/javascript-date-type-is-horribly-broken/">JavaScript's
problematic <samp>Date</samp> objects</a> when working with dates and times.
<li><a href="https://github.com/JuliaTime/">JuliaTime</a> contains a
compiler from <code><abbr>tz</abbr></code> source into
<a href="https://julialang.org/">Julia</a>. It is freely available
@@ -513,9 +540,9 @@ It is freely available under a <abbr>BSD</abbr>-style license.</li>
Definitions for Python</a> compiles <code><abbr>tz</abbr></code> source into
<a href="https://www.python.org">Python</a>.
It is freely available under a <abbr>BSD</abbr>-style license.
In code that can assume Python 3.9 or later it is superseded by
<a href="#python-zoneinfo"><code>zoneinfo.ZoneInfo</code></a>
and the <a href="#pypi-tzdata"><code>tzdata</code> Python package</a>.</li>
In code that can assume Python 3.6 or later it is largely superseded; see <a
href="https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html">pytz:
The Fastest Footgun in the West</a>.</li>
<li><a href="https://tzinfo.github.io">TZInfo &ndash;
Ruby Timezone Library</a>
compiles <code><abbr>tz</abbr></code> source into
@@ -561,9 +588,6 @@ the Apache License.</li>
library that translates between <abbr>UT</abbr> and civil time and
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 <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 <abbr>TZif</abbr> files and converts
timestamps from one time zone or format to another.
@@ -580,11 +604,11 @@ 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>Python has a <a id="python-zoneinfo"
href="https://docs.python.org/3.9/library/zoneinfo.html"><code>zoneinfo.ZoneInfo</code>
href="https://docs.python.org/3/library/zoneinfo.html"><code>zoneinfo.ZoneInfo</code>
class</a> that reads <abbr>TZif</abbr> data and creates objects
that represent <code><abbr>tzdb</abbr></code> timezones.
Python is freely available under the
<a href="https://docs.python.org/3.9/license.html">Python Software Foundation
<a href="https://docs.python.org/3/license.html">Python Software Foundation
License</a>.
A companion <a id="pypi-tzdata" href="https://pypi.org/">PyPI</a> module
<a href="https://pypi.org/project/tzdata/"><code>tzdata</code></a>
@@ -611,7 +635,7 @@ available under a <abbr>BSD</abbr>-style license.</li>
<li><a href="https://foxclocks.org">FoxClocks</a>
is an extension for <a href="https://www.google.com/chrome/">Google
Chrome</a> and for <a
href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Toolkit_API">Mozilla
href="https://wiki.mozilla.org/Modules/Toolkit">Mozilla
Toolkit</a> applications like <a
href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> and <a
href="https://www.mozilla.org/en-US/thunderbird/">Thunderbird</a>.
@@ -648,15 +672,6 @@ href="https://www.oracle.com/java/index.html">Oracle
Java</a> contains a copy of a subset of a recent
<code><abbr>tz</abbr></code> database in a
Java-specific format.</li>
<li><a href="https://relativedata.com/page/Time-Zone-Master">Time Zone
Master</a> is a Microsoft Windows clock program that can automatically
download, compile and use <code><abbr>tz</abbr></code> releases.
The Basic version is free.</li>
<li><a
href="http://veladg.com/velaterra.html">VelaTerra</a> is
a macOS program. Its developers
<a href="http://veladg.com/tzoffer.html">offer free
licenses</a> to <code><abbr>tz</abbr></code> contributors.</li>
</ul>
</section>
@@ -749,7 +764,7 @@ is written in Go and is freely available under the Apache License.</li>
in both Java and
<a href="https://en.wikipedia.org/wiki/Swift_(programming_language)">Swift</a>
form, is freely available under the MIT license.</li>
<li>For <a href="https://nodejs.org/en/">Node.js</a>,
<li>For Node.js,
the <a href="https://www.npmjs.com/package/geo-tz">geo-tz module</a>
is freely available under the MIT license, and
the <a href="https://www.npmjs.com/package/tz-lookup">tz-lookup module</a>
@@ -852,7 +867,7 @@ href="https://nrc.canada.ca/en/certifications-evaluations-standards/canadas-offi
zones and daylight saving time</a>.</dd>
<dt>Chile</dt>
<dd>The Hydrographic and Oceanographic Service of the Chilean Navy publishes a
<a href="https://www.horaoficial.cl/historia_hora.html" hreflang="es">history of
<a href="https://www.horaoficial.cl/historia_hora.php" hreflang="es">history of
Chile's official time (in Spanish)</a>.</dd>
<dt>China</dt>
<dd>The Hong Kong Observatory maintains a
@@ -865,7 +880,7 @@ Unfortunately the latter is incomplete and has errors.</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>
summarizes and cites historical <abbr>DST</abbr> 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
@@ -889,6 +904,10 @@ covers the history of local time in the Netherlands from ancient times.</dd>
<dd>The Department of Internal Affairs maintains a brief <a
href="https://www.dia.govt.nz/Daylight-Saving-History">History of
Daylight Saving</a>.</dd>
<dt>Portugal</dt>
<dd>The Lisbon Astronomical Observatory publishes a
<a href="https://oal.ul.pt/hora-legal/" hreflang="pt">history of
legal time (in Portuguese)</a>.</dd>
<dt>Singapore</dt>
<dd><a id="Singapore"
href="https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html">Why
@@ -933,23 +952,24 @@ saving save electricity? A meta-analysis</a>. <em>Energy J.</em>
doi:<a href="https://doi.org/10.5547/01956574.39.2.thav">10.5547/01956574.39.2.thav</a>.
This analyzes research literature and concludes, "Electricity savings
are larger for countries farther away from the equator, while
subtropical regions consume more electricity because of DST."</li>
subtropical regions consume more electricity because of <abbr>DST</abbr>."</li>
<li>Rishi MA, Ahmed O, Barrantes Perez JH <em>et al</em>.
<a href="https://jcsm.aasm.org/doi/10.5664/jcsm.8780">Daylight saving time:
an American Academy of Sleep Medicine position statement</a>.
<em>J Clin Sleep Med.</em>
2020;<a href="https://doi.org/10.5664/jcsm.8780">10.5664/jcsm.8780</a>.
This argues for permanent standard time due to health risks of both
DST transitions and permanent DST.</li>
<abbr>DST</abbr> transitions and permanent <abbr>DST</abbr>.</li>
<li>Roenneberg T, Winnebeck EC, Klerman EB.
<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6692659/">Daylight
saving time and artificial time zones &ndash; a battle between
biological and social times</a>. <em>Front Physiol.</em> 2019;10:944.
doi:<a href="https://doi.org/10.3389/fphys.2019.00944">10.3389/fphys.2019.00944</a>.
This reviews evidence about the health effects of DST and concludes,
This reviews evidence about the health effects of <abbr>DST</abbr>
and concludes,
"In summary, the scientific literature strongly argues against the
switching between DST and Standard Time and even more so against
adopting DST permanently."</li>
switching between <abbr>DST</abbr> and Standard Time and even more so against
adopting <abbr>DST</abbr> permanently."</li>
</ul>
</section>
@@ -984,14 +1004,11 @@ specifies a <a
href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol"><abbr>DHCP</abbr></a>
option for a server to configure
a client's time zone and daylight saving settings automatically.</li>
<li><a
href="https://www.cv.nrao.edu/~rfisher/Ephemerides/times.html">Astronomical
Times</a> explains more abstruse astronomical time scales like
<li><a href="https://www.ucolick.org/~sla/leapsecs/timescales.html">Time
Scales</a> describes 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="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
href="http://www.iausofa.org"><abbr
+98 -24
View File
@@ -10,7 +10,7 @@ tzfile \- timezone information
\\$3\*(lq\\$1\*(rq\\$2
..
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
The timezone information files used by
.BR tzset (3)
are typically found under a directory with a name like
@@ -30,10 +30,11 @@ The magic four-byte ASCII sequence
identifies the file as a timezone information file.
.IP *
A byte identifying the version of the file's format
(as of 2017, either an ASCII NUL, or
(as of 2021, either an ASCII NUL,
.q "2",
.q "3",
or
.q "3" ).
.q "4" ).
.IP *
Fifteen bytes containing zeros reserved for future use.
.IP *
@@ -117,7 +118,9 @@ and
serves as an index into the array of time zone abbreviation bytes
that follow the
.B ttinfo
structure(s) in the file.
entries in the file; if the designated string is "\*-00", the
.B ttinfo
entry is a placeholder indicating that local time is unspecified.
The
.B tt_utoff
value is never equal to \-2**31, to let 32-bit clients negate it without
@@ -128,19 +131,40 @@ is in the range [\-89999, 93599] (i.e., more than \-25 hours and less
than 26 hours); this allows easy support by implementations that
already support the POSIX-required range [\-24:59:59, 25:59:59].
.IP *
.B tzh_charcnt
bytes that represent time zone designations,
which are null-terminated byte strings, each indexed by the
.B tt_desigidx
values mentioned above.
The byte strings can overlap if one is a suffix of the other.
The encoding of these strings is not specified.
.IP *
.B tzh_leapcnt
pairs of four-byte values, written in network byte order;
the first value of each pair gives the nonnegative time
(as returned by
.BR time (2))
at which a leap second occurs;
the second is a signed integer specifying the
at which a leap second occurs or at which the leap second table expires;
the second is a signed integer specifying the correction, which is the
.I total
number of leap seconds to be applied during the time period
starting at the given time.
The pairs of values are sorted in ascending order by time.
Each transition is for one leap second, either positive or negative;
transitions always separated by at least 28 days minus 1 second.
The pairs of values are sorted in strictly ascending order by time.
Each pair denotes one leap second, either positive or negative,
except that if the last pair has the same correction as the previous one,
the last pair denotes the leap second table's expiration time.
Each leap second is at the end of a UTC calendar month.
The first leap second has a nonnegative occurrence time,
and is a positive leap second if and only if its correction is positive;
the correction for each leap second after the first differs
from the previous leap second by either 1 for a positive leap second,
or \-1 for a negative leap second.
If the leap second table is empty, the leap-second correction is zero
for all timestamps;
otherwise, for timestamps before the first occurrence time,
the leap-second correction is zero if the first pair's correction is 1 or \-1,
and is unspecified otherwise (which can happen only in files
truncated at the start).
.IP *
.B tzh_ttisstdcnt
standard/wall indicators, each stored as a one-byte boolean;
@@ -190,7 +214,7 @@ POSIX-TZ-environment-variable-style string for use in handling instants
after the last transition time stored in the file
or for all instants if the file has no transitions.
The POSIX-style TZ string is empty (i.e., nothing between the newlines)
if there is no POSIX representation for such instants.
if there is no POSIX-style 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
@@ -212,33 +236,52 @@ from 0 through 24.
Second, DST is in effect all year if it starts
January 1 at 00:00 and ends December 31 at 24:00 plus the difference
between daylight saving and standard time.
.SS Version 4 format
For version-4-format TZif files,
the first leap second record can have a correction that is neither
+1 nor \-1, to represent truncation of the TZif file at the start.
Also, if two or more leap second transitions are present and the last
entry's correction equals the previous one, the last entry
denotes the expiration of the leap second table instead of a leap second;
timestamps after this expiration are unreliable in that future
releases will likely add leap second entries after the expiration, and
the added leap seconds will change how post-expiration timestamps are treated.
.SS Interoperability considerations
Future changes to the format may append more data.
.PP
Version 1 files are considered a legacy format and
should be avoided, as they do not support transition
should not be generated, as they do not support transition
times after the year 2038.
Readers that only understand Version 1 must ignore
Readers that understand only Version 1 must ignore
any data that extends beyond the calculated end of the version
1 data block.
.PP
Writers should generate a version 3 file if
Other than version 1, writers should generate
the lowest version number needed by a file's data.
For example, a writer should generate a version 4 file
only if its leap second table either expires or is truncated at the start.
Likewise, a writer not generating a version 4 file
should generate a version 3 file only if
TZ string extensions are necessary to accurately
model transition times.
Otherwise, version 2 files should be generated.
.PP
The sequence of time changes defined by the version 1
header and data block should be a contiguous subsequence
header and data block should be a contiguous sub-sequence
of the time changes defined by the version 2+ header and data
block, and by the footer.
This guideline helps obsolescent version 1 readers
agree with current readers about timestamps within the
contiguous subsequence. It also lets writers not
contiguous sub-sequence. It also lets writers not
supporting obsolescent readers use a
.B tzh_timecnt
of zero
in the version 1 data block to save space.
.PP
When a TZif file contains a leap second table expiration
time, TZif readers should either refuse to process
post-expiration timestamps, or process them as if the expiration
time did not exist (possibly with an error indication).
.PP
Time zone designations should consist of at least three (3)
and no more than six (6) ASCII characters from the set of
alphanumerics,
@@ -248,13 +291,20 @@ and
This is for compatibility with POSIX requirements for
time zone abbreviations.
.PP
When reading a version 2 or 3 file, readers
When reading a version 2 or higher file, readers
should ignore the version 1 header and data block except for
the purpose of skipping over them.
.PP
Readers should calculate the total lengths of the
headers and data blocks and check that they all fit within
the actual file size, as part of a validity check for the file.
.PP
When a positive leap second occurs, readers should append an extra
second to the local minute containing the second just before the leap
second. If this occurs when the UTC offset is not a multiple of 60
seconds, the leap second occurs earlier than the last second of the
local minute and the minute's remaining local seconds are numbered
through 60 instead of the usual 59; the UTC offset is unaffected.
.SS Common interoperability issues
This section documents common problems in reading or writing TZif files.
Most of these are problems in generating TZif files for use by
@@ -275,7 +325,7 @@ design goal has been that a reader can successfully use a TZif
file even if the file is of a later TZif version than what the
reader was designed for.
When complete compatibility was not achieved, an attempt was
made to limit glitches to rarely-used timestamps, and to allow
made to limit glitches to rarely used timestamps and allow
simple partial workarounds in writers designed to generate
new-version data useful even for older-version readers.
This section attempts to document these compatibility issues and
@@ -292,20 +342,33 @@ version 2+ data even if the reader's native timestamps have only
32 bits.
.IP *
Some readers designed for version 2 might mishandle
timestamps after a version 3 file's last transition, because
timestamps after a version 3 or higher file's last transition, because
they cannot parse extensions to POSIX in the TZ-like string.
As a partial workaround, a writer can output more transitions
than necessary, so that only far-future timestamps are
mishandled by version 2 readers.
.IP *
Some readers designed for version 2 do not support
permanent daylight saving time, e.g., a TZ string
permanent daylight saving time with transitions after 24:00
\(en e.g., a TZ string
.q "EST5EDT,0/0,J365/25"
denoting permanent Eastern Daylight Time (\-04).
As a partial workaround, a writer can substitute standard time
for the next time zone east, e.g.,
denoting permanent Eastern Daylight Time
(\-04).
As a workaround, a writer can substitute standard time
for two time zones east, e.g.,
.q "XXX3EDT4,0/0,J365/23"
for a time zone with a never-used standard time (XXX, \-03)
and negative daylight saving time (EDT, \-04) all year.
Alternatively,
as a partial workaround a writer can substitute standard time
for the next time zone east \(en e.g.,
.q "AST4"
for permanent Atlantic Standard Time (\-04).
for permanent
Atlantic Standard Time (\-04).
.IP *
Some readers designed for version 2 or 3, and that require strict
conformance to RFC 8536, reject version 4 files whose leap second
tables are truncated at the start or that end in expiration times.
.IP *
Some readers ignore the footer, and instead predict future
timestamps from the time type of the last transition.
@@ -370,6 +433,17 @@ thus swapping standard and daylight saving time.
Although this workaround misidentifies which part of the year
uses daylight saving time, it records UT offsets and time zone
abbreviations correctly.
.IP *
Some readers generate ambiguous timestamps for positive leap seconds
that occur when the UTC offset is not a multiple of 60 seconds.
For example, in a timezone with UTC offset +01:23:45 and with
a positive leap second 78796801 (1972-06-30 23:59:60 UTC), some readers will
map both 78796800 and 78796801 to 01:23:45 local time the next day
instead of mapping the latter to 01:23:46, and they will map 78796815 to
01:23:59 instead of to 01:23:60.
This has not yet been a practical problem, since no civil authority
has observed such UTC offsets since leap seconds were
introduced in 1972.
.PP
Some interoperability problems are reader bugs that
are listed here mostly as warnings to developers of readers.
+107 -43
View File
@@ -17,8 +17,8 @@ DESCRIPTION
* The magic four-byte ASCII sequence "TZif" identifies the file as a
timezone information file.
* A byte identifying the version of the file's format (as of 2017,
either an ASCII NUL, or "2", or "3").
* A byte identifying the version of the file's format (as of 2021,
either an ASCII NUL, "2", "3", or "4").
* Fifteen bytes containing zeros reserved for future use.
@@ -77,21 +77,40 @@ DESCRIPTION
tt_utoff gives the number of seconds to be added to UT, tt_isdst
tells whether tm_isdst should be set by localtime(3) and tt_desigidx
serves as an index into the array of time zone abbreviation bytes
that follow the ttinfo structure(s) in the file. The tt_utoff value
is never equal to -2**31, to let 32-bit clients negate it without
overflow. Also, in realistic applications tt_utoff is in the range
[-89999, 93599] (i.e., more than -25 hours and less than 26 hours);
this allows easy support by implementations that already support the
POSIX-required range [-24:59:59, 25:59:59].
that follow the ttinfo entries in the file; if the designated string
is "-00", the ttinfo entry is a placeholder indicating that local
time is unspecified. The tt_utoff value is never equal to -2**31, to
let 32-bit clients negate it without overflow. Also, in realistic
applications tt_utoff is in the range [-89999, 93599] (i.e., more
than -25 hours and less than 26 hours); this allows easy support by
implementations that already support the POSIX-required range
[-24:59:59, 25:59:59].
* tzh_charcnt bytes that represent time zone designations, which are
null-terminated byte strings, each indexed by the tt_desigidx values
mentioned above. The byte strings can overlap if one is a suffix of
the other. The encoding of these strings is not specified.
* tzh_leapcnt pairs of four-byte values, written in network byte order;
the first value of each pair gives the nonnegative time (as returned
by time(2)) at which a leap second occurs; the second is a signed
integer specifying the total number of leap seconds to be applied
by time(2)) at which a leap second occurs or at which the leap second
table expires; the second is a signed integer specifying the
correction, which is the total number of leap seconds to be applied
during the time period starting at the given time. The pairs of
values are sorted in ascending order by time. Each transition is for
one leap second, either positive or negative; transitions always
separated by at least 28 days minus 1 second.
values are sorted in strictly ascending order by time. Each pair
denotes one leap second, either positive or negative, except that if
the last pair has the same correction as the previous one, the last
pair denotes the leap second table's expiration time. Each leap
second is at the end of a UTC calendar month. The first leap second
has a nonnegative occurrence time, and is a positive leap second if
and only if its correction is positive; the correction for each leap
second after the first differs from the previous leap second by
either 1 for a positive leap second, or -1 for a negative leap
second. If the leap second table is empty, the leap-second
correction is zero for all timestamps; otherwise, for timestamps
before the first occurrence time, the leap-second correction is zero
if the first pair's correction is 1 or -1, and is unspecified
otherwise (which can happen only in files truncated at the start).
* tzh_ttisstdcnt standard/wall indicators, each stored as a one-byte
boolean; they tell whether the transition times associated with local
@@ -131,15 +150,15 @@ DESCRIPTION
string for use in handling instants after the last transition time
stored in the file or for all instants if the file has no transitions.
The POSIX-style TZ string is empty (i.e., nothing between the newlines)
if there is no POSIX representation for such instants. If nonempty,
the POSIX-style TZ string must agree with the local time type after the
last transition time if present in the eight-byte data; for example,
given the string "WET0WEST,M3.5.0,M10.5.0/3" then if a last transition
time is in July, the transition's local time type must specify a
daylight-saving time abbreviated "WEST" that is one hour east of UT.
Also, if there is at least one transition, time type 0 is associated
with the time period from the indefinite past up to but not including
the earliest transition time.
if there is no POSIX-style representation for such instants. If
nonempty, the POSIX-style TZ string must agree with the local time type
after the last transition time if present in the eight-byte data; for
example, given the string "WET0WEST,M3.5.0,M10.5.0/3" then if a last
transition time is in July, the transition's local time type must
specify a daylight-saving time abbreviated "WEST" that is one hour east
of UT. Also, if there is at least one transition, time type 0 is
associated with the time period from the indefinite past up to but not
including the earliest transition time.
Version 3 format
For version-3-format timezone files, the POSIX-TZ-style string may use
@@ -150,38 +169,65 @@ DESCRIPTION
if it starts January 1 at 00:00 and ends December 31 at 24:00 plus the
difference between daylight saving and standard time.
Version 4 format
For version-4-format TZif files, the first leap second record can have
a correction that is neither +1 nor -1, to represent truncation of the
TZif file at the start. Also, if two or more leap second transitions
are present and the last entry's correction equals the previous one,
the last entry denotes the expiration of the leap second table instead
of a leap second; timestamps after this expiration are unreliable in
that future releases will likely add leap second entries after the
expiration, and the added leap seconds will change how post-expiration
timestamps are treated.
Interoperability considerations
Future changes to the format may append more data.
Version 1 files are considered a legacy format and should be avoided,
as they do not support transition times after the year 2038. Readers
that only understand Version 1 must ignore any data that extends beyond
the calculated end of the version 1 data block.
Version 1 files are considered a legacy format and should not be
generated, as they do not support transition times after the year 2038.
Readers that understand only Version 1 must ignore any data that
extends beyond the calculated end of the version 1 data block.
Writers should generate a version 3 file if TZ string extensions are
necessary to accurately model transition times. Otherwise, version 2
files should be generated.
Other than version 1, writers should generate the lowest version number
needed by a file's data. For example, a writer should generate a
version 4 file only if its leap second table either expires or is
truncated at the start. Likewise, a writer not generating a version 4
file should generate a version 3 file only if TZ string extensions are
necessary to accurately model transition times.
The sequence of time changes defined by the version 1 header and data
block should be a contiguous subsequence of the time changes defined by
the version 2+ header and data block, and by the footer. This
block should be a contiguous sub-sequence of the time changes defined
by the version 2+ header and data block, and by the footer. This
guideline helps obsolescent version 1 readers agree with current
readers about timestamps within the contiguous subsequence. It also
readers about timestamps within the contiguous sub-sequence. It also
lets writers not supporting obsolescent readers use a tzh_timecnt of
zero in the version 1 data block to save space.
When a TZif file contains a leap second table expiration time, TZif
readers should either refuse to process post-expiration timestamps, or
process them as if the expiration time did not exist (possibly with an
error indication).
Time zone designations should consist of at least three (3) and no more
than six (6) ASCII characters from the set of alphanumerics, "-", and
"+". This is for compatibility with POSIX requirements for time zone
abbreviations.
When reading a version 2 or 3 file, readers should ignore the version 1
header and data block except for the purpose of skipping over them.
When reading a version 2 or higher file, readers should ignore the
version 1 header and data block except for the purpose of skipping over
them.
Readers should calculate the total lengths of the headers and data
blocks and check that they all fit within the actual file size, as part
of a validity check for the file.
When a positive leap second occurs, readers should append an extra
second to the local minute containing the second just before the leap
second. If this occurs when the UTC offset is not a multiple of 60
seconds, the leap second occurs earlier than the last second of the
local minute and the minute's remaining local seconds are numbered
through 60 instead of the usual 59; the UTC offset is unaffected.
Common interoperability issues
This section documents common problems in reading or writing TZif
files. Most of these are problems in generating TZif files for use by
@@ -200,7 +246,7 @@ DESCRIPTION
has been that a reader can successfully use a TZif file even if the
file is of a later TZif version than what the reader was designed for.
When complete compatibility was not achieved, an attempt was made to
limit glitches to rarely-used timestamps, and to allow simple partial
limit glitches to rarely used timestamps and allow simple partial
workarounds in writers designed to generate new-version data useful
even for older-version readers. This section attempts to document
these compatibility issues and workarounds, as well as to document
@@ -214,16 +260,24 @@ DESCRIPTION
even if the reader's native timestamps have only 32 bits.
* Some readers designed for version 2 might mishandle timestamps after
a version 3 file's last transition, because they cannot parse
extensions to POSIX in the TZ-like string. As a partial workaround,
a writer can output more transitions than necessary, so that only
far-future timestamps are mishandled by version 2 readers.
a version 3 or higher file's last transition, because they cannot
parse extensions to POSIX in the TZ-like string. As a partial
workaround, a writer can output more transitions than necessary, so
that only far-future timestamps are mishandled by version 2 readers.
* Some readers designed for version 2 do not support permanent daylight
saving time, e.g., a TZ string "EST5EDT,0/0,J365/25" denoting
permanent Eastern Daylight Time (-04). As a partial workaround, a
writer can substitute standard time for the next time zone east,
e.g., "AST4" for permanent Atlantic Standard Time (-04).
saving time with transitions after 24:00 - e.g., a TZ string
"EST5EDT,0/0,J365/25" denoting permanent Eastern Daylight Time (-04).
As a workaround, a writer can substitute standard time for two time
zones east, e.g., "XXX3EDT4,0/0,J365/23" for a time zone with a
never-used standard time (XXX, -03) and negative daylight saving time
(EDT, -04) all year. Alternatively, as a partial workaround a writer
can substitute standard time for the next time zone east - e.g.,
"AST4" for permanent Atlantic Standard Time (-04).
* Some readers designed for version 2 or 3, and that require strict
conformance to RFC 8536, reject version 4 files whose leap second
tables are truncated at the start or that end in expiration times.
* Some readers ignore the footer, and instead predict future timestamps
from the time type of the last transition. As a partial workaround,
@@ -269,6 +323,16 @@ DESCRIPTION
part of the year uses daylight saving time, it records UT offsets and
time zone abbreviations correctly.
* Some readers generate ambiguous timestamps for positive leap seconds
that occur when the UTC offset is not a multiple of 60 seconds. For
example, in a timezone with UTC offset +01:23:45 and with a positive
leap second 78796801 (1972-06-30 23:59:60 UTC), some readers will map
both 78796800 and 78796801 to 01:23:45 local time the next day
instead of mapping the latter to 01:23:46, and they will map 78796815
to 01:23:59 instead of to 01:23:60. This has not yet been a
practical problem, since no civil authority has observed such UTC
offsets since leap seconds were introduced in 1972.
Some interoperability problems are reader bugs that are listed here
mostly as warnings to developers of readers.
+1 -1
View File
@@ -44,7 +44,7 @@
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_version[1]; /* '\0' or '2'-'4' as of 2021 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
+1 -1
View File
@@ -3,7 +3,7 @@
tzselect \- select a timezone
.SH SYNOPSIS
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
.B tzselect
[
.B \*-c
+8 -13
View File
@@ -18,11 +18,13 @@ REPORT_BUGS_TO=tz@iana.org
#
# Bash <https://www.gnu.org/software/bash/>
# Korn Shell <http://www.kornshell.com/>
# MirBSD Korn Shell <https://www.mirbsd.org/mksh.htm>
# MirBSD Korn Shell <http://www.mirbsd.org/mksh.htm>
#
# For portability to Solaris 9 /bin/sh this script avoids some POSIX
# features and common extensions, such as $(...) (which works sometimes
# but not others), $((...)), and $10.
# For portability to Solaris 10 /bin/sh (supported by Oracle through
# January 2024) this script avoids some POSIX features and common
# extensions, such as $(...) (which works sometimes but not others),
# $((...)), ! CMD, ${#ID}, ${ID##PAT}, ${ID%%PAT}, and $10.
#
# This script also uses several features of modern awk programs.
# If your host lacks awk, or has an old awk that does not conform to Posix,
@@ -101,14 +103,6 @@ then
esac
done || exit
}
# Work around a bug in bash 1.14.7 and earlier, where $PS3 is sent to stdout.
case $BASH_VERSION in
[01].*)
case `echo 1 | (select x in x; do break; done) 2>/dev/null` in
?*) PS3=
esac
esac
'
else
doselect() {
@@ -185,7 +179,7 @@ done
# If the current locale does not support UTF-8, convert data to current
# locale's format if possible, as the shell aligns columns better that way.
# Check the UTF-8 of U+12345 CUNEIFORM SIGN URU TIMES KI.
! $AWK 'BEGIN { u12345 = "\360\222\215\205"; exit length(u12345) != 1 }' &&
$AWK 'BEGIN { u12345 = "\360\222\215\205"; exit length(u12345) != 1 }' || {
{ tmp=`(mktemp -d) 2>/dev/null` || {
tmp=${TMPDIR-/tmp}/tzselect.$$ &&
(umask 77 && mkdir -- "$tmp")
@@ -196,6 +190,7 @@ done
TZ_COUNTRY_TABLE=$tmp/iso3166.tab &&
iconv -f UTF-8 -t //TRANSLIT <"$TZ_ZONE_TABLE" >$tmp/$zonetabtype.tab &&
TZ_ZONE_TABLE=$tmp/$zonetabtype.tab
}
newline='
'
+1 -1
View File
@@ -1 +1 @@
2021a
2022a
+15 -12
View File
@@ -17,7 +17,7 @@ zdump \- timezone dumper
\\$3\*(lq\\$1\*(rq\\$2
..
.ie \n(.g .ds - \f(CW-\fP
.el ds - \-
.el .ds - \-
The
.B zdump
program prints the current time in each
@@ -44,12 +44,14 @@ Output a verbose description of time intervals.
For each
.I timezone
on the command line,
print the time at the lowest possible time value,
the time one day after the lowest possible time value,
print the times at the two extreme time values,
the times (if present) at and just beyond the boundaries of years that
.BR localtime (3)
and
.BR gmtime (3)
can represent, and
the times both one second before and exactly at
each detected time discontinuity,
the time at one day less than the highest possible time value,
and the time at the highest possible time value.
each detected time discontinuity.
Each line is followed by
.BI isdst= D
where
@@ -66,7 +68,7 @@ seconds east of Greenwich.
.B \*-V
Like
.BR \*-v ,
except omit the times relative to the extreme time values.
except omit output concerning extreme time and year values.
This generates output that is easier to compare to that of
implementations with different time representations.
.TP
@@ -75,10 +77,10 @@ Cut off interval output at the given year(s).
Cutoff times are computed using the proleptic Gregorian calendar with year 0
and with Universal Time (UT) ignoring leap seconds.
Cutoffs are at the start of each year, where the lower-bound
timestamp is exclusive and the upper is inclusive; for example,
timestamp is inclusive and the upper is exclusive; for example,
.B "\*-c 1970,2070"
selects transitions after 1970-01-01 00:00:00 UTC
and on or before 2070-01-01 00:00:00 UTC.
selects transitions on or after 1970-01-01 00:00:00 UTC
and before 2070-01-01 00:00:00 UTC.
The default cutoff is
.BR \*-500,2500 .
.TP
@@ -91,7 +93,7 @@ The
determines whether the count includes leap seconds.
As with
.BR \*-c ,
the cutoff's lower bound is exclusive and its upper bound is inclusive.
the cutoff's lower bound is inclusive and its upper bound is exclusive.
.SH "INTERVAL FORMAT"
The interval format is a compact text representation that is intended
to be both human- and machine-readable. It consists of an empty line,
@@ -200,7 +202,8 @@ This time zone is east of UT, so its UT offsets are positive. Also,
many of its time zone abbreviations are omitted since they duplicate
the text of the UT offset.
.SH LIMITATIONS
Time discontinuities are found by sampling the results returned by localtime
Time discontinuities are found by sampling the results returned by
.BR localtime (3)
at twelve-hour intervals.
This works in all real-world cases;
one can construct artificial time zones for which this fails.
+16 -16
View File
@@ -21,18 +21,18 @@ OPTIONS
timezone. See "INTERVAL FORMAT" below.
-v Output a verbose description of time intervals. For each
timezone on the command line, print the time at the lowest
possible time value, the time one day after the lowest possible
time value, the times both one second before and exactly at each
detected time discontinuity, the time at one day less than the
highest possible time value, and the time at the highest
possible time value. Each line is followed by isdst=D where D
is positive, zero, or negative depending on whether the given
time is daylight saving time, standard time, or an unknown time
type, respectively. Each line is also followed by gmtoff=N if
the given local time is known to be N seconds east of Greenwich.
timezone on the command line, print the times at the two extreme
time values, the times (if present) at and just beyond the
boundaries of years that localtime(3) and gmtime(3) can
represent, and the times both one second before and exactly at
each detected time discontinuity. Each line is followed by
isdst=D where D is positive, zero, or negative depending on
whether the given time is daylight saving time, standard time,
or an unknown time type, respectively. Each line is also
followed by gmtoff=N if the given local time is known to be N
seconds east of Greenwich.
-V Like -v, except omit the times relative to the extreme time
-V Like -v, except omit output concerning extreme time and year
values. This generates output that is easier to compare to that
of implementations with different time representations.
@@ -41,8 +41,8 @@ OPTIONS
computed using the proleptic Gregorian calendar with year 0 and
with Universal Time (UT) ignoring leap seconds. Cutoffs are at
the start of each year, where the lower-bound timestamp is
exclusive and the upper is inclusive; for example, -c 1970,2070
selects transitions after 1970-01-01 00:00:00 UTC and on or
inclusive and the upper is exclusive; for example, -c 1970,2070
selects transitions on or after 1970-01-01 00:00:00 UTC and
before 2070-01-01 00:00:00 UTC. The default cutoff is
-500,2500.
@@ -50,8 +50,8 @@ OPTIONS
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 timezone determines whether the count includes leap
seconds. As with -c, the cutoff's lower bound is exclusive and
its upper bound is inclusive.
seconds. As with -c, the cutoff's lower bound is inclusive and
its upper bound is exclusive.
INTERVAL FORMAT
The interval format is a compact text representation that is intended
@@ -128,7 +128,7 @@ INTERVAL FORMAT
LIMITATIONS
Time discontinuities are found by sampling the results returned by
localtime at twelve-hour intervals. This works in all real-world
localtime(3) at twelve-hour intervals. This works in all real-world
cases; one can construct artificial time zones for which this fails.
In the -v and -V output, "UT" denotes the value returned by gmtime(3),
+192 -86
View File
@@ -42,10 +42,6 @@
#define ZDUMP_HI_YEAR 2500
#endif /* !defined ZDUMP_HI_YEAR */
#ifndef MAX_STRING_LENGTH
#define MAX_STRING_LENGTH 1024
#endif /* !defined MAX_STRING_LENGTH */
#define SECSPERNYEAR (SECSPERDAY * DAYSPERNYEAR)
#define SECSPERLYEAR (SECSPERNYEAR + SECSPERDAY)
#define SECSPER400YEARS (SECSPERNYEAR * (intmax_t) (300 + 3) \
@@ -60,6 +56,21 @@
*/
enum { SECSPER400YEARS_FITS = SECSPERLYEAR <= INTMAX_MAX / 400 };
#if !defined HAVE_GENERIC && defined __has_extension
# if __has_extension(c_generic_selections)
# define HAVE_GENERIC 1
# else
# define HAVE_GENERIC 0
# endif
#endif
/* _Generic is buggy in pre-4.9 GCC. */
#if !defined HAVE_GENERIC && defined __GNUC__
# define HAVE_GENERIC (4 < __GNUC__ + (9 <= __GNUC_MINOR__))
#endif
#ifndef HAVE_GENERIC
# define HAVE_GENERIC (201112 <= __STDC_VERSION__)
#endif
#if HAVE_GETTEXT
#include <locale.h> /* for setlocale */
#endif /* HAVE_GETTEXT */
@@ -77,7 +88,7 @@ extern int optind;
#endif
/* The minimum and maximum finite time values. */
enum { atime_shift = CHAR_BIT * sizeof (time_t) - 2 };
enum { atime_shift = CHAR_BIT * sizeof(time_t) - 2 };
static time_t const absolute_min_time =
((time_t) -1 < 0
? (- ((time_t) ~ (time_t) 0 < 0)
@@ -95,15 +106,20 @@ static bool errout;
static char const *abbr(struct tm const *);
static intmax_t delta(struct tm *, struct tm *) ATTRIBUTE_PURE;
static void dumptime(struct tm const *);
static time_t hunt(timezone_t, char *, time_t, time_t);
static time_t hunt(timezone_t, char *, time_t, time_t, bool);
static void show(timezone_t, char *, time_t, bool);
static void showextrema(timezone_t, char *, time_t, struct tm *, time_t);
static void showtrans(char const *, struct tm const *, time_t, char const *,
char const *);
static const char *tformat(void);
static time_t yeartot(intmax_t) ATTRIBUTE_PURE;
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/* Is C an ASCII digit? */
static bool
is_digit(char c)
{
return '0' <= c && c <= '9';
}
/* Is A an alphabetic character in the C locale? */
static bool
@@ -130,7 +146,7 @@ sumsize(size_t a, size_t b)
{
size_t sum = a + b;
if (sum < a) {
fprintf(stderr, "%s: size overflow\n", progname);
fprintf(stderr, _("%s: size overflow\n"), progname);
exit(EXIT_FAILURE);
}
return sum;
@@ -143,7 +159,7 @@ xmalloc(size_t size)
{
void *p = malloc(size);
if (!p) {
perror(progname);
fprintf(stderr, _("%s: Memory exhausted\n"), progname);
exit(EXIT_FAILURE);
}
return p;
@@ -263,11 +279,23 @@ static void
gmtzinit(void)
{
if (USE_LOCALTIME_RZ) {
static char const utc[] = "UTC0";
gmtz = tzalloc(utc);
/* Try "GMT" first to find out whether this is one of the rare
platforms where time_t counts leap seconds; this works due to
the "Link Etc/GMT GMT" line in the "etcetera" file. If "GMT"
fails, fall back on "GMT0" which might be similar due to the
"Link Etc/GMT GMT0" line in the "backward" file, and which
should work on all POSIX platforms. The rest of zdump does not
use the "GMT" abbreviation that comes from this setting, so it
is OK to use "GMT" here rather than the more-modern "UTC" which
would not work on platforms that omit the "backward" file. */
gmtz = tzalloc("GMT");
if (!gmtz) {
perror(utc);
exit(EXIT_FAILURE);
static char const gmt0[] = "GMT0";
gmtz = tzalloc(gmt0);
if (!gmtz) {
perror(gmt0);
exit(EXIT_FAILURE);
}
}
}
}
@@ -484,8 +512,8 @@ main(int argc, char *argv[])
if (cuttimes != loend && !*loend) {
hi = lo;
if (hi < cuthitime) {
if (hi < absolute_min_time)
hi = absolute_min_time;
if (hi < absolute_min_time + 1)
hi = absolute_min_time + 1;
cuthitime = hi;
}
} else if (cuttimes != loend && *loend == ','
@@ -497,8 +525,8 @@ main(int argc, char *argv[])
cutlotime = lo;
}
if (hi < cuthitime) {
if (hi < absolute_min_time)
hi = absolute_min_time;
if (hi < absolute_min_time + 1)
hi = absolute_min_time + 1;
cuthitime = hi;
}
} else {
@@ -510,9 +538,12 @@ main(int argc, char *argv[])
}
}
gmtzinit();
INITIALIZE (now);
if (! (iflag | vflag | Vflag))
if (iflag | vflag | Vflag)
now = 0;
else {
now = time(NULL);
now |= !now;
}
longest = 0;
for (i = optind; i < argc; i++) {
size_t arglen = strlen(argv[i]);
@@ -530,7 +561,7 @@ main(int argc, char *argv[])
perror(argv[i]);
return EXIT_FAILURE;
}
if (! (iflag | vflag | Vflag)) {
if (now) {
show(tz, argv[i], now, false);
tzfree(tz);
continue;
@@ -539,12 +570,15 @@ main(int argc, char *argv[])
t = absolute_min_time;
if (! (iflag | Vflag)) {
show(tz, argv[i], t, true);
t += SECSPERDAY;
show(tz, argv[i], t, true);
if (my_localtime_rz(tz, &t, &tm) == NULL
&& t < cutlotime) {
time_t newt = cutlotime;
if (my_localtime_rz(tz, &newt, &newtm) != NULL)
showextrema(tz, argv[i], t, NULL, newt);
}
}
if (t < cutlotime)
t = cutlotime;
INITIALIZE (ab);
if (t + 1 < cutlotime)
t = cutlotime - 1;
tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
if (tm_ok) {
ab = saveabbr(&abbrev, &abbrevsize, &tm);
@@ -552,19 +586,20 @@ main(int argc, char *argv[])
showtrans("\nTZ=%f", &tm, t, ab, argv[i]);
showtrans("-\t-\t%Q", &tm, t, ab, argv[i]);
}
}
while (t < cuthitime) {
} else
ab = NULL;
while (t < cuthitime - 1) {
time_t newt = ((t < absolute_max_time - SECSPERDAY / 2
&& t + SECSPERDAY / 2 < cuthitime)
&& t + SECSPERDAY / 2 < cuthitime - 1)
? t + SECSPERDAY / 2
: cuthitime);
: cuthitime - 1);
struct tm *newtmp = localtime_rz(tz, &newt, &newtm);
bool newtm_ok = newtmp != NULL;
if (tm_ok != newtm_ok
|| (tm_ok && (delta(&newtm, &tm) != newt - t
|| newtm.tm_isdst != tm.tm_isdst
|| strcmp(abbr(&newtm), ab) != 0))) {
newt = hunt(tz, argv[i], t, newt);
|| (ab && (delta(&newtm, &tm) != newt - t
|| newtm.tm_isdst != tm.tm_isdst
|| strcmp(abbr(&newtm), ab) != 0))) {
newt = hunt(tz, argv[i], t, newt, false);
newtmp = localtime_rz(tz, &newt, &newtm);
newtm_ok = newtmp != NULL;
if (iflag)
@@ -583,11 +618,15 @@ main(int argc, char *argv[])
}
}
if (! (iflag | Vflag)) {
t = absolute_max_time;
t -= SECSPERDAY;
show(tz, argv[i], t, true);
t += SECSPERDAY;
show(tz, argv[i], t, true);
time_t newt = absolute_max_time;
t = cuthitime;
if (t < newt) {
struct tm *tmp = my_localtime_rz(tz, &t, &tm);
if (tmp != NULL
&& my_localtime_rz(tz, &newt, &newtm) == NULL)
showextrema(tz, argv[i], t, tmp, newt);
}
show(tz, argv[i], absolute_max_time, true);
}
tzfree(tz);
}
@@ -640,36 +679,46 @@ yeartot(intmax_t y)
return t;
}
/* Search for a discontinuity in timezone TZ with name NAME, in the
timestamps ranging from LOT through HIT. LOT and HIT disagree
about some aspect of timezone. If ONLY_OK, search only for
definedness changes, i.e., localtime succeeds on one side of the
transition but fails on the other side. Return the timestamp just
before the transition from LOT's settings. */
static time_t
hunt(timezone_t tz, char *name, time_t lot, time_t hit)
hunt(timezone_t tz, char *name, time_t lot, time_t hit, bool only_ok)
{
static char * loab;
static size_t loabsize;
char const * ab;
time_t t;
struct tm lotm;
struct tm tm;
/* Convert LOT into a broken-down time here, even though our
caller already did that. On platforms without TM_ZONE,
tzname may have been altered since our caller broke down
LOT, and tzname needs to be changed back. */
bool lotm_ok = my_localtime_rz(tz, &lot, &lotm) != NULL;
bool tm_ok;
char const *ab = lotm_ok ? saveabbr(&loab, &loabsize, &lotm) : NULL;
if (lotm_ok)
ab = saveabbr(&loab, &loabsize, &lotm);
for ( ; ; ) {
time_t diff = hit - lot;
if (diff < 2)
/* T = average of LOT and HIT, rounding down.
Avoid overflow, even on oddball C89 platforms
where / rounds down and TIME_T_MIN == -TIME_T_MAX
so lot / 2 + hit / 2 might overflow. */
time_t t = (lot / 2
- ((lot % 2 + hit % 2) < 0)
+ ((lot % 2 + hit % 2) == 2)
+ hit / 2);
if (t == lot)
break;
t = lot;
t += diff / 2;
if (t <= lot)
++t;
else if (t >= hit)
--t;
tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
if (lotm_ok & tm_ok
? (delta(&tm, &lotm) == t - lot
&& tm.tm_isdst == lotm.tm_isdst
&& strcmp(abbr(&tm), ab) == 0)
: lotm_ok == tm_ok) {
if (lotm_ok == tm_ok
&& (only_ok
|| (ab && tm.tm_isdst == lotm.tm_isdst
&& delta(&tm, &lotm) == t - lot
&& strcmp(abbr(&tm), ab) == 0))) {
lot = t;
if (tm_ok)
lotm = tm;
@@ -685,11 +734,11 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit)
static intmax_t
delta_nonneg(struct tm *newp, struct tm *oldp)
{
register intmax_t result;
register int tmy;
result = 0;
for (tmy = oldp->tm_year; tmy < newp->tm_year; ++tmy)
intmax_t oldy = oldp->tm_year;
int cycles = (newp->tm_year - oldy) / YEARSPERREPEAT;
intmax_t sec = SECSPERREPEAT, result = cycles * sec;
int tmy = oldp->tm_year + cycles * YEARSPERREPEAT;
for ( ; tmy < newp->tm_year; ++tmy)
result += DAYSPERNYEAR + isleap_sum(tmy, TM_YEAR_BASE);
result += newp->tm_yday - oldp->tm_yday;
result *= HOURSPERDAY;
@@ -764,6 +813,7 @@ show(timezone_t tz, char *zone, time_t t, bool v)
gmtmp = my_gmtime_r(&t, &gmtm);
if (gmtmp == NULL) {
printf(tformat(), t);
printf(_(" (gmtime failed)"));
} else {
dumptime(gmtmp);
printf(" UT");
@@ -771,8 +821,11 @@ show(timezone_t tz, char *zone, time_t t, bool v)
printf(" = ");
}
tmp = my_localtime_rz(tz, &t, &tm);
dumptime(tmp);
if (tmp != NULL) {
if (tmp == NULL) {
printf(tformat(), t);
printf(_(" (localtime failed)"));
} else {
dumptime(tmp);
if (*abbr(tmp) != '\0')
printf(" %s", abbr(tmp));
if (v) {
@@ -787,6 +840,51 @@ show(timezone_t tz, char *zone, time_t t, bool v)
abbrok(abbr(tmp), zone);
}
/* Show timestamps just before and just after a transition between
defined and undefined (or vice versa) in either localtime or
gmtime. These transitions are for timezone TZ with name ZONE, in
the range from LO (with broken-down time LOTMP if that is nonnull)
through HI. LO and HI disagree on definedness. */
static void
showextrema(timezone_t tz, char *zone, time_t lo, struct tm *lotmp, time_t hi)
{
struct tm localtm[2], gmtm[2];
time_t t, boundary = hunt(tz, zone, lo, hi, true);
bool old = false;
hi = (SECSPERDAY < hi - boundary
? boundary + SECSPERDAY
: hi + (hi < TIME_T_MAX));
if (SECSPERDAY < boundary - lo) {
lo = boundary - SECSPERDAY;
lotmp = my_localtime_rz(tz, &lo, &localtm[old]);
}
if (lotmp)
localtm[old] = *lotmp;
else
localtm[old].tm_sec = -1;
if (! my_gmtime_r(&lo, &gmtm[old]))
gmtm[old].tm_sec = -1;
/* Search sequentially for definedness transitions. Although this
could be sped up by refining 'hunt' to search for either
localtime or gmtime definedness transitions, it hardly seems
worth the trouble. */
for (t = lo + 1; t < hi; t++) {
bool new = !old;
if (! my_localtime_rz(tz, &t, &localtm[new]))
localtm[new].tm_sec = -1;
if (! my_gmtime_r(&t, &gmtm[new]))
gmtm[new].tm_sec = -1;
if (((localtm[old].tm_sec < 0) != (localtm[new].tm_sec < 0))
| ((gmtm[old].tm_sec < 0) != (gmtm[new].tm_sec < 0))) {
show(tz, zone, t - 1, true);
show(tz, zone, t, true);
}
old = new;
}
}
#if HAVE_SNPRINTF
# define my_snprintf snprintf
#else
@@ -1040,28 +1138,45 @@ abbr(struct tm const *tmp)
/*
** The code below can fail on certain theoretical systems;
** it works on all known real-world systems as of 2004-12-30.
** it works on all known real-world systems as of 2022-01-25.
*/
static const char *
tformat(void)
{
#if HAVE_GENERIC
/* C11-style _Generic is more likely to return the correct
format when distinct types have the same size. */
char const *fmt =
_Generic(+ (time_t) 0,
int: "%d", long: "%ld", long long: "%lld",
unsigned: "%u", unsigned long: "%lu",
unsigned long long: "%llu",
default: NULL);
if (fmt)
return fmt;
fmt = _Generic((time_t) 0,
intmax_t: "%"PRIdMAX, uintmax_t: "%"PRIuMAX,
default: NULL);
if (fmt)
return fmt;
#endif
if (0 > (time_t) -1) { /* signed */
if (sizeof (time_t) == sizeof (intmax_t))
if (sizeof(time_t) == sizeof(intmax_t))
return "%"PRIdMAX;
if (sizeof (time_t) > sizeof (long))
if (sizeof(time_t) > sizeof(long))
return "%lld";
if (sizeof (time_t) > sizeof (int))
if (sizeof(time_t) > sizeof(int))
return "%ld";
return "%d";
}
#ifdef PRIuMAX
if (sizeof (time_t) == sizeof (uintmax_t))
if (sizeof(time_t) == sizeof(uintmax_t))
return "%"PRIuMAX;
#endif
if (sizeof (time_t) > sizeof (unsigned long))
if (sizeof(time_t) > sizeof(unsigned long))
return "%llu";
if (sizeof (time_t) > sizeof (unsigned int))
if (sizeof(time_t) > sizeof(unsigned int))
return "%lu";
return "%u";
}
@@ -1076,30 +1191,21 @@ dumptime(register const struct tm *timeptr)
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
register const char * wn;
register const char * mn;
register int lead;
register int trail;
if (timeptr == NULL) {
printf("NULL");
return;
}
/*
** The packaged localtime_rz and gmtime_r never put out-of-range
** values in tm_wday or tm_mon, but since this code might be compiled
** with other (perhaps experimental) versions, paranoia is in order.
*/
if (timeptr->tm_wday < 0 || timeptr->tm_wday >=
(int) (sizeof wday_name / sizeof wday_name[0]))
wn = "???";
else wn = wday_name[timeptr->tm_wday];
if (timeptr->tm_mon < 0 || timeptr->tm_mon >=
(int) (sizeof mon_name / sizeof mon_name[0]))
mn = "???";
else mn = mon_name[timeptr->tm_mon];
printf("%s %s%3d %.2d:%.2d:%.2d ",
wn, mn,
((0 <= timeptr->tm_wday
&& timeptr->tm_wday < sizeof wday_name / sizeof wday_name[0])
? wday_name[timeptr->tm_wday] : "???"),
((0 <= timeptr->tm_mon
&& timeptr->tm_mon < sizeof mon_name / sizeof mon_name[0])
? mon_name[timeptr->tm_mon] : "???"),
timeptr->tm_mday, timeptr->tm_hour,
timeptr->tm_min, timeptr->tm_sec);
#define DIVISOR 10
+36 -22
View File
@@ -31,7 +31,8 @@ zic \- timezone compiler
The
.B zic
program reads text from the file(s) named on the command line
and creates the time conversion information files specified in this input.
and creates the timezone information format (TZif) files
specified in this input.
If a
.I filename
is
@@ -121,7 +122,7 @@ is
any already-existing link is removed.
.TP
.BR "\*-r " "[\fB@\fP\fIlo\fP][\fB/@\fP\fIhi\fP]"
Reduce the size of output files by limiting their applicability
Limit the applicability of output files
to timestamps in the range from
.I lo
(inclusive) to
@@ -133,6 +134,10 @@ and
are possibly-signed decimal counts of seconds since the Epoch
(1970-01-01 00:00:00 UTC).
Omitted counts default to extreme values.
The output files use UT offset 0 and abbreviation
.q "\*-00"
in place of the omitted timestamp data;
this typically reduces the files' sizes.
For example,
.q "zic \*-r @0"
omits data intended for negative timestamps (i.e., before the Epoch), and
@@ -213,6 +218,15 @@ code designed for older
output formats. These compatibility issues affect only timestamps
before 1970 or after the start of 2038.
.PP
The output contains a truncated leap second table,
which can cause some older TZif readers to misbehave.
This can occur if the
.B "\*-L"
option is used, and either an Expires line is present or
the
.B "\*-r"
option is also used.
.PP
The output file contains more than 1200 transitions,
which may be mishandled by some clients.
The current reference client supports at most 2000 transitions;
@@ -242,7 +256,7 @@ zero or more lines, each ending in a newline byte and containing at
most 511 bytes, and without any NUL bytes. The input text's encoding
is typically UTF-8 or ASCII; it should have a unibyte representation
for the POSIX Portable Character Set (PPCS)
\*<http://pubs\*:.opengroup\*:.org/\*:onlinepubs/\*:9699919799/\*:basedefs/\*:V1_chap06\*:.html\*>
\*<https://pubs\*:.opengroup\*:.org/\*:onlinepubs/\*:9699919799/\*:basedefs/\*:V1_chap06\*:.html\*>
and the encoding's non-unibyte characters should consist entirely of
non-PPCS bytes. Non-PPCS characters typically occur only in comments:
although output file names and time zone abbreviations can contain
@@ -513,8 +527,8 @@ begin the field with a minus sign if time must be subtracted from UT.
.B RULES
The name of the rules that apply in the timezone or,
alternatively, a field in the same format as a rule-line SAVE column,
giving of the amount of time to be added to local standard time
effect, and whether the resulting time is standard or daylight saving.
giving the amount of time to be added to local standard time
and whether the resulting time is standard or daylight saving.
If this field is
.B \*-
then standard time always applies.
@@ -540,7 +554,7 @@ using the shortest form that does not lose information, where
.IR mm ,
and
.I ss
are the hours, minutes, and seconds east (+) or west (\(mi) of UT.
are the hours, minutes, and seconds east (+) or west (\-) of UT.
Alternatively,
a slash (/)
separates standard and daylight abbreviations.
@@ -549,6 +563,9 @@ alphanumeric ASCII characters,
.q "+"
and
.q "\*-".
By convention, the time zone abbreviation
.q "\*-00"
is a placeholder that means local time is unspecified.
.TP
.B UNTIL
The time at which the UT offset or the rule(s) change for a location.
@@ -700,6 +717,19 @@ or
if the leap second time given by the other fields should be interpreted as
local (wall clock) time.
.PP
Rolling leap seconds were implemented back when it was not
clear whether common practice was rolling or stationary,
with concerns that one would see
Times Square ball drops where there'd be a
.q "3... 2... 1... leap... Happy New Year"
countdown, placing the leap second at
midnight New York time rather than midnight UTC.
However, this countdown style does not seem to have caught on,
which means rolling leap seconds are not used in practice;
also, they are not supported if the
.B \*-r
option is used.
.PP
The expiration line, if present, has the form:
.nf
.ti +.5i
@@ -720,22 +750,6 @@ The
and
.B HH:MM:SS
fields give the expiration timestamp in UTC for the leap second table;
.B zic
outputs this expiration timestamp by truncating the end of the output
file to the timestamp.
If there is no expiration line,
.B zic
also accepts a comment
.q "#expires \fIE\fP ...\&"
where
.I E
is the expiration timestamp as a decimal integer count of seconds
since the Epoch, not counting leap seconds.
However, the
.q "#expires"
comment is an obsolescent feature,
and the leap second file should use an expiration line
instead of relying on a comment.
.SH "EXTENDED EXAMPLE"
Here is an extended example of
.B zic
+45 -33
View File
@@ -8,8 +8,8 @@ SYNOPSIS
DESCRIPTION
The zic program reads text from the file(s) named on the command line
and creates the time conversion information files specified in this
input. If a filename is "-", standard input is read.
and creates the timezone information format (TZif) files specified in
this input. If a filename is "-", standard input is read.
OPTIONS
--version
@@ -61,17 +61,19 @@ OPTIONS
If timezone is -, any already-existing link is removed.
-r [@lo][/@hi]
Reduce the size of output files by limiting their applicability
to timestamps in the range from lo (inclusive) to hi
(exclusive), where lo and hi are possibly-signed decimal counts
of seconds since the Epoch (1970-01-01 00:00:00 UTC). Omitted
counts default to extreme values. For example, "zic -r @0"
omits data intended for negative timestamps (i.e., before the
Epoch), and "zic -r @0/@2147483648" outputs data intended only
for nonnegative timestamps that fit into 31-bit signed integers.
On platforms with GNU date, "zic -r @$(date +%s)" omits data
intended for past timestamps. Also see the -b slim option for
another way to shrink output size.
Limit the applicability of output files to timestamps in the
range from lo (inclusive) to hi (exclusive), where lo and hi are
possibly-signed decimal counts of seconds since the Epoch
(1970-01-01 00:00:00 UTC). Omitted counts default to extreme
values. The output files use UT offset 0 and abbreviation "-00"
in place of the omitted timestamp data; this typically reduces
the files' sizes. For example, "zic -r @0" omits data intended
for negative timestamps (i.e., before the Epoch), and "zic -r
@0/@2147483648" outputs data intended only for nonnegative
timestamps that fit into 31-bit signed integers. On platforms
with GNU date, "zic -r @$(date +%s)" omits data intended for
past timestamps. Also see the -b slim option for another way to
shrink output size.
-t file
When creating local time information, put the configuration link
@@ -114,6 +116,11 @@ OPTIONS
compatibility issues affect only timestamps before 1970 or after
the start of 2038.
The output contains a truncated leap second table, which can
cause some older TZif readers to misbehave. This can occur if
the -L option is used, and either an Expires line is present or
the -r option is also used.
The output file contains more than 1200 transitions, which may
be mishandled by some clients. The current reference client
supports at most 2000 transitions; pre-2014 versions of the
@@ -135,13 +142,13 @@ FILES
zero or more lines, each ending in a newline byte and containing at
most 511 bytes, and without any NUL bytes. The input text's encoding
is typically UTF-8 or ASCII; it should have a unibyte representation
for the POSIX Portable Character Set (PPCS) <http://pubs.opengroup.org/
onlinepubs/9699919799/basedefs/V1_chap06.html> and the encoding's non-
unibyte characters should consist entirely of non-PPCS bytes. Non-PPCS
characters typically occur only in comments: although output file names
and time zone abbreviations can contain nearly any character, other
software will work better if these are limited to the restricted syntax
described under the -v option.
for the POSIX Portable Character Set (PPCS) <https://pubs.opengroup
.org/onlinepubs/9699919799/basedefs/V1_chap06.html> and the encoding's
non-unibyte characters should consist entirely of non-PPCS bytes. Non-
PPCS characters typically occur only in comments: although output file
names and time zone abbreviations can contain nearly any character,
other software will work better if these are limited to the restricted
syntax described under the -v option.
Input lines are made up of fields. Fields are separated from one
another by one or more white space characters. The white space
@@ -289,11 +296,11 @@ FILES
RULES The name of the rules that apply in the timezone or,
alternatively, a field in the same format as a rule-line SAVE
column, giving of the amount of time to be added to local
standard time effect, and whether the resulting time is standard
or daylight saving. If this field is - then standard time always
applies. When an amount of time is given, only the sum of
standard time and this amount matters.
column, giving the amount of time to be added to local standard
time and whether the resulting time is standard or daylight
saving. If this field is - then standard time always applies.
When an amount of time is given, only the sum of standard time
and this amount matters.
FORMAT
The format for time zone abbreviations. The pair of characters
@@ -305,7 +312,9 @@ FILES
seconds east (+) or west (-) of UT. Alternatively, a slash (/)
separates standard and daylight abbreviations. To conform to
POSIX, a time zone abbreviation should contain only alphanumeric
ASCII characters, "+" and "-".
ASCII characters, "+" and "-". By convention, the time zone
abbreviation "-00" is a placeholder that means local time is
unspecified.
UNTIL The time at which the UT offset or the rule(s) change for a
location. It takes the form of one to four fields YEAR [MONTH
@@ -390,6 +399,15 @@ FILES
second time given by the other fields should be interpreted as local
(wall clock) time.
Rolling leap seconds were implemented back when it was not clear
whether common practice was rolling or stationary, with concerns that
one would see Times Square ball drops where there'd be a "3... 2...
1... leap... Happy New Year" countdown, placing the leap second at
midnight New York time rather than midnight UTC. However, this
countdown style does not seem to have caught on, which means rolling
leap seconds are not used in practice; also, they are not supported if
the -r option is used.
The expiration line, if present, has the form:
Expires YEAR MONTH DAY HH:MM:SS
@@ -399,13 +417,7 @@ FILES
Expires 2020 Dec 28 00:00:00
The YEAR, MONTH, DAY, and HH:MM:SS fields give the expiration timestamp
in UTC for the leap second table; zic outputs this expiration timestamp
by truncating the end of the output file to the timestamp. If there is
no expiration line, zic also accepts a comment "#expires E ..." where E
is the expiration timestamp as a decimal integer count of seconds since
the Epoch, not counting leap seconds. However, the "#expires" comment
is an obsolescent feature, and the leap second file should use an
expiration line instead of relying on a comment.
in UTC for the leap second table;
EXTENDED EXAMPLE
Here is an extended example of zic input, intended to illustrate many
+491 -343
View File
File diff suppressed because it is too large Load Diff
+13 -6
View File
@@ -104,25 +104,32 @@ DATAFORM != "main" {
}
if (!vanguard && $1 == "Rule" && $2 == "Morocco" && 2019 <= $3) {
if ($9 == "0") {
last_std_date = $3 " " $6 " " $7 " " $8
sub(/\t0\t/, "\t1:00\t")
} else {
sub(/\t-1:00\t/, "\t0\t")
}
}
if (!vanguard && $1 == "1:00" && $2 == "Morocco" && $3 == "+01/+00") {
sub(/1:00\tMorocco\t\+01\/\+00$/, "0:00\tMorocco\t+00/+01")
# This introduces a transition from 01:59:59 +00 to 03:00:00 +01
# with both times being standard (i.e., a change to standard UT offset).
# This is rearguard's way to approximate the actual prediction,
# which is that of an ordinary transition from DST to standard time.
sub(/1:00\tMorocco\t\+01\/\+00$/,
"0:00\tMorocco\t+00/+01\t" last_std_date "\n\t\t\t 1:00\t-\t+01")
}
}
# If a Link line is followed by a Zone line for the same data, comment
# If a Link line is followed by a Link or Zone line for the same data, comment
# out the Link line. This can happen if backzone overrides a Link
# with a Zone.
/^Link/ {
linkline[$3] = NR
}
# with a Zone or a different Link.
/^Zone/ {
sub(/^Link/, "#Link", line[linkline[$2]])
}
/^Link/ {
sub(/^Link/, "#Link", line[linkline[$3]])
linkline[$3] = NR
}
{ line[NR] = $0 }
+6 -3
View File
@@ -3,7 +3,7 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
# From Paul Eggert (2018-06-27):
# From Paul Eggert (2021-09-20):
# This file is intended as a backward-compatibility aid for older programs.
# New programs should use zone1970.tab. This file is like zone1970.tab (see
# zone1970.tab's comments), but with the following additional restrictions:
@@ -16,6 +16,9 @@
# clocks have agreed since 1970; this is a narrower definition than
# that of zone1970.tab.
#
# Unlike zone1970.tab, a row's third column can be a Link from
# 'backward' instead of a Zone.
#
# This table is intended as an aid for users, to help them select timezones
# appropriate for their practical needs. It is not intended to take or
# endorse any position on legal or territorial claims.
@@ -228,7 +231,7 @@ KE -0117+03649 Africa/Nairobi
KG +4254+07436 Asia/Bishkek
KH +1133+10455 Asia/Phnom_Penh
KI +0125+17300 Pacific/Tarawa Gilbert Islands
KI -0308-17105 Pacific/Enderbury Phoenix Islands
KI -0247-17143 Pacific/Kanton Phoenix Islands
KI +0152-15720 Pacific/Kiritimati Line Islands
KM -1141+04316 Indian/Comoro
KN +1718-06243 America/St_Kitts
@@ -391,7 +394,7 @@ TK -0922-17114 Pacific/Fakaofo
TL -0833+12535 Asia/Dili
TM +3757+05823 Asia/Ashgabat
TN +3648+01011 Africa/Tunis
TO -2110-17510 Pacific/Tongatapu
TO -210800-1751200 Pacific/Tongatapu
TR +4101+02858 Europe/Istanbul
TT +1039-06131 America/Port_of_Spain
TV -0831+17913 Pacific/Funafuti
+10 -19
View File
@@ -40,11 +40,9 @@ AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AQ -6617+11031 Antarctica/Casey Casey
AQ -6835+07758 Antarctica/Davis Davis
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville
AQ -6736+06253 Antarctica/Mawson Mawson
AQ -6448-06406 Antarctica/Palmer Palmer
AQ -6734-06808 Antarctica/Rothera Rothera
AQ -690022+0393524 Antarctica/Syowa Syowa
AQ -720041+0023206 Antarctica/Troll Troll
AQ -7824+10654 Antarctica/Vostok Vostok
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
@@ -97,7 +95,6 @@ BR +0249-06040 America/Boa_Vista Roraima
BR -0308-06001 America/Manaus Amazonas (east)
BR -0640-06952 America/Eirunepe Amazonas (west)
BR -0958-06748 America/Rio_Branco Acre
BS +2505-07721 America/Nassau
BT +2728+08939 Asia/Thimphu
BY +5354+02734 Europe/Minsk
BZ +1730-08812 America/Belize
@@ -106,13 +103,11 @@ CA +4439-06336 America/Halifax Atlantic - NS (most areas); PE
CA +4612-05957 America/Glace_Bay Atlantic - NS (Cape Breton)
CA +4606-06447 America/Moncton Atlantic - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas)
CA +5125-05707 America/Blanc-Sablon AST - QC (Lower North Shore)
CA +4339-07923 America/Toronto Eastern - ON, QC (most areas)
CA,BS +4339-07923 America/Toronto Eastern - ON, QC (most areas), Bahamas
CA +4901-08816 America/Nipigon Eastern - ON, QC (no DST 1967-73)
CA +4823-08915 America/Thunder_Bay Eastern - ON (Thunder Bay)
CA +6344-06828 America/Iqaluit Eastern - NU (most east areas)
CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung)
CA +484531-0913718 America/Atikokan EST - ON (Atikokan); NU (Coral H)
CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba
CA +4843-09434 America/Rainy_River Central - ON (Rainy R, Ft Frances)
CA +744144-0944945 America/Resolute Central - NU (Resolute)
@@ -123,7 +118,6 @@ CA +5333-11328 America/Edmonton Mountain - AB; BC (E); SK (W)
CA +690650-1050310 America/Cambridge_Bay Mountain - NU (west)
CA +6227-11421 America/Yellowknife Mountain - NT (central)
CA +682059-1334300 America/Inuvik Mountain - NT (west)
CA +4906-11631 America/Creston MST - BC (Creston)
CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John)
CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson)
CA +6043-13503 America/Whitehorse MST - Yukon (east)
@@ -131,7 +125,7 @@ CA +6404-13925 America/Dawson MST - Yukon (west)
CA +4916-12307 America/Vancouver Pacific - BC (most areas)
CC -1210+09655 Indian/Cocos
CH,DE,LI +4723+00832 Europe/Zurich Swiss time
CI,BF,GM,GN,ML,MR,SH,SL,SN,TG +0519-00402 Africa/Abidjan
CI,BF,GH,GM,GN,ML,MR,SH,SL,SN,TG +0519-00402 Africa/Abidjan
CK -2114-15946 Pacific/Rarotonga
CL -3327-07040 America/Santiago Chile (most areas)
CL -5309-07055 America/Punta_Arenas Region of Magallanes
@@ -142,7 +136,6 @@ CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
CU +2308-08222 America/Havana
CV +1455-02331 Atlantic/Cape_Verde
CW,AW,BQ,SX +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia Cyprus (most areas)
CY +3507+03357 Asia/Famagusta Northern Cyprus
@@ -170,7 +163,6 @@ FR +4852+00220 Europe/Paris
GB,GG,IM,JE +513030-0000731 Europe/London
GE +4143+04449 Asia/Tbilisi
GF +0456-05220 America/Cayenne
GH +0533-00013 Africa/Accra
GI +3608-00521 Europe/Gibraltar
GL +6411-05144 America/Nuuk Greenland (most areas)
GL +7646-01840 America/Danmarkshavn National Park (east coast)
@@ -204,7 +196,7 @@ JP +353916+1394441 Asia/Tokyo
KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi
KG +4254+07436 Asia/Bishkek
KI +0125+17300 Pacific/Tarawa Gilbert Islands
KI -0308-17105 Pacific/Enderbury Phoenix Islands
KI -0247-17143 Pacific/Kanton Phoenix Islands
KI +0152-15720 Pacific/Kiritimati Line Islands
KP +3901+12545 Asia/Pyongyang
KR +3733+12658 Asia/Seoul
@@ -262,19 +254,19 @@ NR -0031+16655 Pacific/Nauru
NU -1901-16955 Pacific/Niue
NZ,AQ -3652+17446 Pacific/Auckland New Zealand time
NZ -4357-17633 Pacific/Chatham Chatham Islands
PA,KY +0858-07932 America/Panama
PA,CA,KY +0858-07932 America/Panama EST - Panama, Cayman, ON (Atikokan), NU (Coral H)
PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands
PF -2308-13457 Pacific/Gambier Gambier Islands
PG -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas)
PG,AQ -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas), Dumont d'Urville
PG -0613+15534 Pacific/Bougainville Bougainville
PH +1435+12100 Asia/Manila
PK +2452+06703 Asia/Karachi
PL +5215+02100 Europe/Warsaw
PM +4703-05620 America/Miquelon
PN -2504-13005 Pacific/Pitcairn
PR +182806-0660622 America/Puerto_Rico
PR,AG,CA,AI,AW,BL,BQ,CW,DM,GD,GP,KN,LC,MF,MS,SX,TT,VC,VG,VI +182806-0660622 America/Puerto_Rico AST
PS +3130+03428 Asia/Gaza Gaza Strip
PS +313200+0350542 Asia/Hebron West Bank
PT +3843-00908 Europe/Lisbon Portugal (mainland)
@@ -314,12 +306,12 @@ RU +4658+14242 Asia/Sakhalin MSK+08 - Sakhalin Island
RU +6728+15343 Asia/Srednekolymsk MSK+08 - Sakha (E); North Kuril Is
RU +5301+15839 Asia/Kamchatka MSK+09 - Kamchatka
RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea
SA,KW,YE +2438+04643 Asia/Riyadh
SA,AQ,KW,YE +2438+04643 Asia/Riyadh Arabia, Syowa
SB -0932+16012 Pacific/Guadalcanal
SC -0440+05528 Indian/Mahe
SD +1536+03232 Africa/Khartoum
SE +5920+01803 Europe/Stockholm
SG +0117+10351 Asia/Singapore
SG,MY +0117+10351 Asia/Singapore Singapore, peninsular Malaysia
SR +0550-05510 America/Paramaribo
SS +0451+03137 Africa/Juba
ST +0020+00644 Africa/Sao_Tome
@@ -334,9 +326,8 @@ TK -0922-17114 Pacific/Fakaofo
TL -0833+12535 Asia/Dili
TM +3757+05823 Asia/Ashgabat
TN +3648+01011 Africa/Tunis
TO -2110-17510 Pacific/Tongatapu
TO -210800-1751200 Pacific/Tongatapu
TR +4101+02858 Europe/Istanbul
TT,AG,AI,BL,DM,GD,GP,KN,LC,MF,MS,VC,VG,VI +1039-06131 America/Port_of_Spain
TV -0831+17913 Pacific/Funafuti
TW +2503+12130 Asia/Taipei
UA +5026+03031 Europe/Kiev Ukraine (most areas)
@@ -362,7 +353,7 @@ US +465042-1012439 America/North_Dakota/New_Salem Central - ND (Morton rural)
US +471551-1014640 America/North_Dakota/Beulah Central - ND (Mercer)
US +394421-1045903 America/Denver Mountain (most areas)
US +433649-1161209 America/Boise Mountain - ID (south); OR (east)
US +332654-1120424 America/Phoenix MST - Arizona (except Navajo)
US,CA +332654-1120424 America/Phoenix MST - Arizona (except Navajo), Creston BC
US +340308-1181434 America/Los_Angeles Pacific
US +611305-1495401 America/Anchorage Alaska (most areas)
US +581807-1342511 America/Juneau Alaska - Juneau area