summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart@stuartbishop.net>2015-09-21 17:40:37 +0700
committerStuart Bishop <stuart@stuartbishop.net>2015-09-21 17:40:37 +0700
commit5ea50a7ba6592c1a0f156075231b1593e060200f (patch)
tree9baf601bd067b270a47adc055b16c35ab528f89f
parent575921a11b85d215d27072f96bb70410929969ad (diff)
downloadpytz-5ea50a7ba6592c1a0f156075231b1593e060200f.tar.gz
Import IANA 2015f
-rw-r--r--elsie.nci.nih.gov/src/Makefile62
-rw-r--r--elsie.nci.nih.gov/src/NEWS95
-rw-r--r--elsie.nci.nih.gov/src/Theory715
-rw-r--r--elsie.nci.nih.gov/src/africa92
-rw-r--r--elsie.nci.nih.gov/src/asia25
-rw-r--r--elsie.nci.nih.gov/src/backzone5
-rw-r--r--elsie.nci.nih.gov/src/date.139
-rw-r--r--elsie.nci.nih.gov/src/date.1.txt25
-rw-r--r--elsie.nci.nih.gov/src/date.c732
-rw-r--r--elsie.nci.nih.gov/src/difftime.c56
-rw-r--r--elsie.nci.nih.gov/src/europe71
-rw-r--r--elsie.nci.nih.gov/src/iso3166.tab11
-rw-r--r--[-rwxr-xr-x]elsie.nci.nih.gov/src/leap-seconds.list8
-rw-r--r--elsie.nci.nih.gov/src/localtime.c121
-rw-r--r--elsie.nci.nih.gov/src/northamerica32
-rw-r--r--elsie.nci.nih.gov/src/private.h49
-rw-r--r--elsie.nci.nih.gov/src/southamerica45
-rw-r--r--elsie.nci.nih.gov/src/strftime.c14
-rw-r--r--elsie.nci.nih.gov/src/tz-art.htm52
-rw-r--r--elsie.nci.nih.gov/src/tz-link.htm103
-rw-r--r--elsie.nci.nih.gov/src/tzselect.ksh62
-rw-r--r--elsie.nci.nih.gov/src/zdump.c36
-rw-r--r--elsie.nci.nih.gov/src/zic.860
-rw-r--r--elsie.nci.nih.gov/src/zic.8.txt45
-rw-r--r--elsie.nci.nih.gov/src/zic.c233
-rw-r--r--elsie.nci.nih.gov/src/zone.tab4
-rw-r--r--elsie.nci.nih.gov/src/zone1970.tab7
27 files changed, 1159 insertions, 1640 deletions
diff --git a/elsie.nci.nih.gov/src/Makefile b/elsie.nci.nih.gov/src/Makefile
index b398727..d2f64c8 100644
--- a/elsie.nci.nih.gov/src/Makefile
+++ b/elsie.nci.nih.gov/src/Makefile
@@ -5,7 +5,7 @@
PACKAGE= tzcode
# Version numbers of the code and data distributions.
-VERSION= 2015d
+VERSION= 2015f
# Email address for bug reports.
BUGEMAIL= tz@iana.org
@@ -102,7 +102,6 @@ LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed.
# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
-# -DHAVE_ADJTIME=0 if 'adjtime' does not exist (SVR0?)
# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
# -DHAVE_GETTEXT=1 if 'gettext' works (GNU, Linux, Solaris); also see LDLIBS
# -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
@@ -113,10 +112,6 @@ LDLIBS=
# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
# This defaults to 1 if a working localtime_rz seems to be available.
# localtime_rz can make zdump significantly faster, but is nonstandard.
-# -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
-# -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
-# -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
-# -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
# -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
# -DHAVE_STRFTIME_L=1 if <time.h> declares locale_t and strftime_l
# This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
@@ -126,7 +121,6 @@ LDLIBS=
# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
# -DHAVE_TZSET=0 if your system lacks a tzset function
# -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
-# -DHAVE_UTMPX_H=1 if your compiler has a "utmpx.h"
# -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
# if you do not want run time warnings about formats that may cause
# year 2000 grief
@@ -147,7 +141,7 @@ LDLIBS=
# -DZIC_MAX_ABBR_LEN_WO_WARN=3
# (or some other number) to set the maximum time zone abbreviation length
# that zic will accept without a warning (the default is 6)
-# $(GCC_DEBUG_FLAGS) if you are using GCC and want lots of checking
+# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
-Wall -Wextra \
-Wbad-function-cast -Wcast-align -Wdate-time \
@@ -292,23 +286,24 @@ TAB_CHAR= ' '
SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
-SAFE_CHARSET= ]$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)-
-SAFE_CHAR= '['$(SAFE_CHARSET)']'
-# NONSYM_CHAR is a regular expression that matches any character
-# except for a small number of symbols, where we prefer to stick with
+SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
+SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]'
+
+# OK_CHAR matches any character allowed in the distributed files.
+# This is the same as SAFE_CHAR, except that multibyte letters are
+# also allowed so that commentary can contain people's names and quote
+# non-English sources. For non-letters the sources are limited to
# ASCII renderings for the convenience of maintainers whose text editors
# mishandle UTF-8 by default (e.g., XEmacs 21.4.22).
-NONSYM_CHAR= '[^–—°′″≈≠≤≥±−×÷∞←→↔·•§¶«»‘’‚‛“”„‟‹›「」『』〝〞〟]'
+OK_CHAR= '[][:alpha:]'$(SAFE_CHARSET)'-]'
# SAFE_LINE matches a line of safe characters.
-# SAFE_SHARP_LINE is similar, except any character can follow '#';
+# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
# this is so that comments can contain non-ASCII characters.
-# NONSYM_LINE matches a line of non-symbols.
-# VALID_LINE matches a line of any validly-encoded characters.
+# OK_LINE matches a line of OK characters.
SAFE_LINE= '^'$(SAFE_CHAR)'*$$'
-SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(NONSYM_CHAR)'*)?$$'
-NONSYM_LINE= '^'$(NONSYM_CHAR)'*$$'
-VALID_LINE= '^.*$$'
+SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
+OK_LINE= '^'$(OK_CHAR)'*$$'
# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
@@ -323,6 +318,8 @@ GZIPFLAGS= -9n
###############################################################################
+#MAKE= make
+
cc= cc
CC= $(cc) -DTZDIR=\"$(TZDIR)\"
@@ -371,7 +368,7 @@ SHELL= /bin/sh
all: tzselect zic zdump libtz.a $(TABDATA)
-ALL: all date
+ALL: all date $(ENCHILADA)
install: all $(DATA) $(REDO) $(MANS)
mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
@@ -475,14 +472,11 @@ check: check_character_set check_white_space check_links check_sorted \
check_character_set: $(ENCHILADA)
LC_ALL=en_US.utf8 && export LC_ALL && \
sharp='#' && \
- ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
+ ! grep -Env $(SAFE_LINE) Makefile $(MANS) date.1 $(MANTXTS) \
$(MISC) $(SOURCES) $(WEB_PAGES) && \
! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \
- iso3166.tab leapseconds yearistype.sh zone.tab && \
- test $$(grep -Ecv $(SAFE_SHARP_LINE) Makefile) -eq 1 && \
- ! grep -Env $(NONSYM_LINE) CONTRIBUTING NEWS README Theory \
- $(MANS) date.1 zone1970.tab && \
- ! grep -Env $(VALID_LINE) $(ENCHILADA)
+ leapseconds yearistype.sh zone.tab && \
+ ! grep -Env $(OK_LINE) $(ENCHILADA)
check_white_space: $(ENCHILADA)
! grep -En ' '$(TAB_CHAR)"|$$(printf '[\f\r\v]')" $(ENCHILADA)
@@ -573,9 +567,9 @@ set-timestamps.out: $(ENCHILADA)
# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.
-check_public: $(ENCHILADA)
- make maintainer-clean
- make "CFLAGS=$(GCC_DEBUG_FLAGS)" $(ENCHILADA) all
+check_public:
+ $(MAKE) maintainer-clean
+ $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
mkdir tzpublic
for i in $(TDATA) ; do \
$(zic) -v -d tzpublic $$i 2>&1 || exit; \
@@ -594,8 +588,8 @@ check_time_t_alternatives:
zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
for type in $(TIME_T_ALTERNATIVES); do \
mkdir -p tzpublic/$$type && \
- make clean_misc && \
- make TOPDIR=`pwd`/tzpublic/$$type \
+ $(MAKE) clean_misc && \
+ $(MAKE) TOPDIR=`pwd`/tzpublic/$$type \
CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
REDO='$(REDO)' \
install && \
@@ -641,12 +635,12 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
gpg --armor --detach-sign $?
typecheck:
- make clean
+ $(MAKE) clean
for i in "long long" unsigned; \
do \
- make CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
+ $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
./zdump -v Europe/Rome ; \
- make clean ; \
+ $(MAKE) clean ; \
done
zonenames: $(TDATA)
diff --git a/elsie.nci.nih.gov/src/NEWS b/elsie.nci.nih.gov/src/NEWS
index c14df78..b477250 100644
--- a/elsie.nci.nih.gov/src/NEWS
+++ b/elsie.nci.nih.gov/src/NEWS
@@ -1,5 +1,100 @@
News for the tz database
+Release 2015f - 2015-08-10 18:06:56 -0700
+
+ Changes affecting future time stamps
+
+ North Korea switches to +0830 on 2015-08-15. (Thanks to Steffen Thorsen.)
+ The abbreviation remains "KST". (Thanks to Robert Elz.)
+
+ Uruguay no longer observes DST. (Thanks to Steffen Thorsen
+ and Pablo Camargo.)
+
+ Changes affecting past and future time stamps
+
+ Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC.
+ (Thanks to Roman Tudos.)
+
+ Changes affecting data format and code
+
+ zic's '-y YEARISTYPE' option is no longer documented. The TYPE
+ field of a Rule line should now be '-'; the old values 'even',
+ 'odd', 'uspres', 'nonpres', 'nonuspres' were already undocumented.
+ Although the implementation has not changed, these features do not
+ work in the default installation, they are not used in the data,
+ and they are now considered obsolescent.
+
+ zic now checks that two rules don't take effect at the same time.
+ (Thanks to Jon Skeet and Arthur David Olson.) Constraints on
+ simultaneity are now documented.
+
+ The two characters '%z' in a zone format now stand for the UTC
+ offset, e.g., '-07' for seven hours behind UTC and '+0530' for
+ five hours and thirty minutes ahead. This better supports time
+ zone abbreviations conforming to POSIX.1-2001 and later.
+
+ Changes affecting installed data files
+
+ Comments for America/Halifax and America/Glace_Bay have been improved.
+ (Thanks to Brian Inglis.)
+
+ Data entries have been simplified for Atlantic/Canary, Europe/Simferopol,
+ Europe/Sofia, and Europe/Tallinn. This yields slightly smaller
+ installed data files for Europe/Simferopol and Europe/Tallinn.
+ It does not affect timestamps. (Thanks to Howard Hinnant.)
+
+ Changes affecting code
+
+ zdump and zic no longer warn about valid time zone abbreviations
+ like '-05'.
+
+ Some Visual Studio 2013 warnings have been suppressed.
+ (Thanks to Kees Dekker.)
+
+ 'date' no longer sets the time of day and its -a, -d, -n and -t
+ options have been removed. Long obsolescent, the implementation
+ of these features had porting problems. Builders no longer need
+ to configure HAVE_ADJTIME, HAVE_SETTIMEOFDAY, or HAVE_UTMPX_H.
+ (Thanks to Kees Dekker for pointing out the problem.)
+
+ Changes affecting documentation
+
+ The Theory file mentions naming issues earlier, as these seem to be
+ poorly publicized (thanks to Gilmore Davidson for reporting the problem).
+
+ tz-link.htm mentions Time Zone Database Parser (thanks to Howard Hinnant).
+
+ Mention that Herbert Samuel introduced the term "Summer Time".
+
+
+Release 2015e - 2015-06-13 10:56:02 -0700
+
+ Changes affecting future time stamps
+
+ Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
+ not 06-13 and 07-18 as we had guessed. (Thanks to Milamber.)
+
+ Assume Cayman Islands will observe DST starting next year, using US rules.
+ Although it isn't guaranteed, it is the most likely.
+
+ Changes affecting data format
+
+ The file 'iso3166.tab' now uses UTF-8, so that its entries can better
+ spell the names of Åland Islands, Côte d'Ivoire, and Réunion.
+
+ Changes affecting code
+
+ When displaying data, tzselect converts it to the current locale's
+ encoding if the iconv command works. (Problem reported by random832.)
+
+ tzselect no longer mishandles Dominica, fixing a bug introduced
+ in Release 2014f. (Problem reported by Owen Leibman.)
+
+ zic -l no longer fails when compiled with -DTZDEFAULT=\"/etc/localtime\".
+ This fixes a bug introduced in Release 2014f.
+ (Problem reported by Leonardo Chiquitto.)
+
+
Release 2015d - 2015-04-24 08:09:46 -0700
Changes affecting future time stamps
diff --git a/elsie.nci.nih.gov/src/Theory b/elsie.nci.nih.gov/src/Theory
index 9861a4f..96cba51 100644
--- a/elsie.nci.nih.gov/src/Theory
+++ b/elsie.nci.nih.gov/src/Theory
@@ -1,233 +1,244 @@
-This file is in the public domain, so clarified as of
-2009-05-17 by Arthur David Olson.
+Theory and pragmatics of the tz code and data
+
----- Outline -----
- Time and date functions
Scope of the tz database
- Names of time zone rule files
+ Names of time zone rules
Time zone abbreviations
+ Accuracy of the tz database
+ Time and date functions
Calendrical issues
Time and time zones on Mars
------ Time and date functions -----
-These time and date functions are upwards compatible with those of POSIX,
-an international standard for UNIX-like systems.
-As of this writing, the current edition of POSIX is:
+----- Scope of the tz database -----
+
+The tz database attempts to record the history and predicted future of
+all computer-based clocks that track civil time. To represent this
+data, the world is partitioned into regions whose clocks all agree
+about time stamps that occur after the somewhat-arbitrary cutoff point
+of the POSIX Epoch (1970-01-01 00:00:00 UTC). For each such region,
+the database records all known clock transitions, and labels the region
+with a notable location. Although 1970 is a somewhat-arbitrary
+cutoff, there are significant challenges to moving the cutoff earlier
+even by a decade or two, due to the wide variety of local practices
+before computer timekeeping became prevalent.
+
+Clock transitions before 1970 are recorded for each such location,
+because most systems support time stamps before 1970 and could
+misbehave if data entries were omitted for pre-1970 transitions.
+However, the database is not designed for and does not suffice for
+applications requiring accurate handling of all past times everywhere,
+as it would take far too much effort and guesswork to record all
+details of pre-1970 civil timekeeping.
+
+As described below, reference source code for using the tz database is
+also available. The tz code is upwards compatible with POSIX, an
+international standard for UNIX-like systems. As of this writing, the
+current edition of POSIX is:
The Open Group Base Specifications Issue 7
IEEE Std 1003.1, 2013 Edition
<http://pubs.opengroup.org/onlinepubs/9699919799/>
-POSIX has the following properties and limitations.
-
-* In POSIX, time display in a process is controlled by the
- environment variable TZ. Unfortunately, the POSIX TZ string takes
- a form that is hard to describe and is error-prone in practice.
- Also, POSIX TZ strings can't deal with other (for example, Israeli)
- daylight saving time rules, or situations where more than two
- time zone abbreviations are used in an area.
- The POSIX TZ string takes the following form:
- stdoffset[dst[offset][,date[/time],date[/time]]]
+----- Names of time zone rules -----
- where:
+Each of the database's time zone rules has a unique name.
+Inexperienced users are not expected to select these names unaided.
+Distributors should provide documentation and/or a simple selection
+interface that explains the names; for one example, see the 'tzselect'
+program in the tz code. The Unicode Common Locale Data Repository
+<http://cldr.unicode.org/> contains data that may be useful for other
+selection interfaces.
- std and dst
- are 3 or more characters specifying the standard
- and daylight saving time (DST) zone names.
- Starting with POSIX.1-2001, std and dst may also be
- in a quoted form like "<UTC+10>"; this allows
- "+" and "-" in the names.
- offset
- is of the form '[+-]hh:[mm[:ss]]' and specifies the
- offset west of UT. 'hh' may be a single digit; 0<=hh<=24.
- The default DST offset is one hour ahead of standard time.
- date[/time],date[/time]
- specifies the beginning and end of DST. If this is absent,
- the system supplies its own rules for DST, and these can
- differ from year to year; typically US DST rules are used.
- time
- takes the form 'hh:[mm[:ss]]' and defaults to 02:00.
- This is the same format as the offset, except that a
- leading '+' or '-' is not allowed.
- date
- takes one of the following forms:
- Jn (1<=n<=365)
- origin-1 day number not counting February 29
- n (0<=n<=365)
- origin-0 day number counting February 29 if present
- Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
- for the dth day of week n of month m of the year,
- where week 1 is the first week in which day d appears,
- and '5' stands for the last week in which day d appears
- (which may be either the 4th or 5th week).
- Typically, this is the only useful form;
- the n and Jn forms are rarely used.
-
- Here is an example POSIX TZ string, for US Pacific time using rules
- appropriate from 1987 through 2006:
-
- TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'
+The time zone rule naming conventions attempt to strike a balance
+among the following goals:
- This POSIX TZ string is hard to remember, and mishandles time stamps
- before 1987 and after 2006. With this package you can use this
- instead:
+ * Uniquely identify every region where clocks have agreed since 1970.
+ This is essential for the intended use: static clocks keeping local
+ civil time.
- TZ='America/Los_Angeles'
+ * Indicate to experts where that region is.
-* POSIX does not define the exact meaning of TZ values like "EST5EDT".
- Typically the current US DST rules are used to interpret such values,
- but this means that the US DST rules are compiled into each program
- that does time conversion. This means that when US time conversion
- rules change (as in the United States in 1987), all programs that
- do time conversion must be recompiled to ensure proper results.
+ * Be robust in the presence of political changes. For example, names
+ of countries are ordinarily not used, to avoid incompatibilities
+ when countries change their name (e.g. Zaire->Congo) or when
+ locations change countries (e.g. Hong Kong from UK colony to
+ China).
-* In POSIX, there's no tamper-proof way for a process to learn the
- system's best idea of local wall clock. (This is important for
- applications that an administrator wants used only at certain times -
- without regard to whether the user has fiddled the "TZ" environment
- variable. While an administrator can "do everything in UTC" to get
- around the problem, doing so is inconvenient and precludes handling
- daylight saving time shifts - as might be required to limit phone
- calls to off-peak hours.)
+ * Be portable to a wide variety of implementations.
-* POSIX requires that systems ignore leap seconds.
+ * Use a consistent naming conventions over the entire world.
-* The tz code attempts to support all the time_t implementations
- allowed by POSIX. The time_t type represents a nonnegative count of
- seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds.
- In practice, time_t is usually a signed 64- or 32-bit integer; 32-bit
- signed time_t values stop working after 2038-01-19 03:14:07 UTC, so
- new implementations these days typically use a signed 64-bit integer.
- Unsigned 32-bit integers are used on one or two platforms,
- and 36-bit and 40-bit integers are also used occasionally.
- Although earlier POSIX versions allowed time_t to be a
- floating-point type, this was not supported by any practical
- systems, and POSIX.1-2013 and the tz code both require time_t
- to be an integer type.
+Names normally have the form AREA/LOCATION, where AREA is the name
+of a continent or ocean, and LOCATION is the name of a specific
+location within that region. North and South America share the same
+area, 'America'. Typical names are 'Africa/Cairo', 'America/New_York',
+and 'Pacific/Honolulu'.
-These are the extensions that have been made to the POSIX functions:
+Here are the general rules used for choosing location names,
+in decreasing order of importance:
-* The "TZ" environment variable is used in generating the name of a file
- from which time zone information is read (or is interpreted a la
- POSIX); "TZ" is no longer constrained to be a three-letter time zone
- name followed by a number of hours and an optional three-letter
- daylight time zone name. The daylight saving time rules to be used
- for a particular time zone are encoded in the time zone file;
- the format of the file allows U.S., Australian, and other rules to be
- encoded, and allows for situations where more than two time zone
- abbreviations are used.
+ Use only valid POSIX file name components (i.e., the parts of
+ names other than '/'). Do not use the file name
+ components '.' and '..'. Within a file name component,
+ use only ASCII letters, '.', '-' and '_'. Do not use
+ digits, as that might create an ambiguity with POSIX
+ TZ strings. A file name component must not exceed 14
+ characters or start with '-'. E.g., prefer 'Brunei'
+ to 'Bandar_Seri_Begawan'. Exceptions: see the discussion
+ of legacy names below.
+ A name must not be empty, or contain '//', or start or end with '/'.
+ Do not use names that differ only in case. Although the reference
+ implementation is case-sensitive, some other implementations
+ are not, and they would mishandle names differing only in case.
+ If one name A is an initial prefix of another name AB (ignoring case),
+ then B must not start with '/', as a regular file cannot have
+ the same name as a directory in POSIX. For example,
+ 'America/New_York' precludes 'America/New_York/Bronx'.
+ Uninhabited regions like the North Pole and Bouvet Island
+ do not need locations, since local time is not defined there.
+ There should typically be at least one name for each ISO 3166-1
+ officially assigned two-letter code for an inhabited country
+ or territory.
+ If all the clocks in a region have agreed since 1970,
+ don't bother to include more than one location
+ even if subregions' clocks disagreed before 1970.
+ Otherwise these tables would become annoyingly large.
+ If a name is ambiguous, use a less ambiguous alternative;
+ e.g. many cities are named San José and Georgetown, so
+ prefer 'Costa_Rica' to 'San_Jose' and 'Guyana' to 'Georgetown'.
+ Keep locations compact. Use cities or small islands, not countries
+ or regions, so that any future time zone changes do not split
+ locations into different time zones. E.g. prefer 'Paris'
+ to 'France', since France has had multiple time zones.
+ Use mainstream English spelling, e.g. prefer 'Rome' to 'Roma', and
+ prefer 'Athens' to the Greek 'Αθήνα' or the Romanized 'Athína'.
+ The POSIX file name restrictions encourage this rule.
+ Use the most populous among locations in a zone,
+ e.g. prefer 'Shanghai' to 'Beijing'. Among locations with
+ similar populations, pick the best-known location,
+ e.g. prefer 'Rome' to 'Milan'.
+ Use the singular form, e.g. prefer 'Canary' to 'Canaries'.
+ Omit common suffixes like '_Islands' and '_City', unless that
+ would lead to ambiguity. E.g. prefer 'Cayman' to
+ 'Cayman_Islands' and 'Guatemala' to 'Guatemala_City',
+ but prefer 'Mexico_City' to 'Mexico' because the country
+ of Mexico has several time zones.
+ Use '_' to represent a space.
+ Omit '.' from abbreviations in names, e.g. prefer 'St_Helena'
+ to 'St._Helena'.
+ Do not change established names if they only marginally
+ violate the above rules. For example, don't change
+ the existing name 'Rome' to 'Milan' merely because
+ Milan's population has grown to be somewhat greater
+ than Rome's.
+ If a name is changed, put its old spelling in the 'backward' file.
+ This means old spellings will continue to work.
- It was recognized that allowing the "TZ" environment variable to
- take on values such as "America/New_York" might cause "old" programs
- (that expect "TZ" to have a certain form) to operate incorrectly;
- consideration was given to using some other environment variable
- (for example, "TIMEZONE") to hold the string used to generate the
- time zone information file name. In the end, however, it was decided
- to continue using "TZ": it is widely used for time zone purposes;
- separately maintaining both "TZ" and "TIMEZONE" seemed a nuisance;
- and systems where "new" forms of "TZ" might cause problems can simply
- use TZ values such as "EST5EDT" which can be used both by
- "new" programs (a la POSIX) and "old" programs (as zone names and
- offsets).
+The file 'zone1970.tab' lists geographical locations used to name time
+zone rules. It is intended to be an exhaustive list of names for
+geographic regions as described above; this is a subset of the names
+in the data. Although a 'zone1970.tab' location's longitude
+corresponds to its LMT offset with one hour for every 15 degrees east
+longitude, this relationship is not exact.
-* To handle places where more than two time zone abbreviations are used,
- the functions "localtime" and "gmtime" set tzname[tmp->tm_isdst]
- (where "tmp" is the value the function returns) to the time zone
- abbreviation to be used. This differs from POSIX, where the elements
- of tzname are only changed as a result of calls to tzset.
+Older versions of this package used a different naming scheme,
+and these older names are still supported.
+See the file 'backward' for most of these older names
+(e.g., 'US/Eastern' instead of 'America/New_York').
+The other old-fashioned names still supported are
+'WET', 'CET', 'MET', and 'EET' (see the file 'europe').
-* Since the "TZ" environment variable can now be used to control time
- conversion, the "daylight" and "timezone" variables are no longer
- needed. (These variables are defined and set by "tzset"; however, their
- values will not be used by "localtime.")
+Older versions of this package defined legacy names that are
+incompatible with the first rule of location names, but which are
+still supported. These legacy names are mostly defined in the file
+'etcetera'. Also, the file 'backward' defines the legacy names
+'GMT0', 'GMT-0', 'GMT+0' and 'Canada/East-Saskatchewan', and the file
+'northamerica' defines the legacy names 'EST5EDT', 'CST6CDT',
+'MST7MDT', and 'PST8PDT'.
-* The "localtime" function has been set up to deliver correct results
- for near-minimum or near-maximum time_t values. (A comment in the
- source code tells how to get compatibly wrong results).
+Excluding 'backward' should not affect the other data. If
+'backward' is excluded, excluding 'etcetera' should not affect the
+remaining data.
-* A function "tzsetwall" has been added to arrange for the system's
- best approximation to local wall clock time to be delivered by
- subsequent calls to "localtime." Source code for portable
- applications that "must" run on local wall clock time should call
- "tzsetwall();" if such code is moved to "old" systems that don't
- provide tzsetwall, you won't be able to generate an executable program.
- (These time zone functions also arrange for local wall clock time to be
- used if tzset is called - directly or indirectly - and there's no "TZ"
- environment variable; portable applications should not, however, rely
- on this behavior since it's not the way SVR2 systems behave.)
-* Negative time_t values are supported, on systems where time_t is signed.
+----- Time zone abbreviations -----
-* These functions can account for leap seconds, thanks to Bradley White.
+When this package is installed, it generates time zone abbreviations
+like 'EST' to be compatible with human tradition and POSIX.
+Here are the general rules used for choosing time zone abbreviations,
+in decreasing order of importance:
-Points of interest to folks with other systems:
+ Use abbreviations that consist of three or more ASCII letters.
+ Previous editions of this database also used characters like
+ ' ' and '?', but these characters have a special meaning to
+ the shell and cause commands like
+ set `date`
+ to have unexpected effects.
+ Previous editions of this rule required upper-case letters,
+ but the Congressman who introduced Chamorro Standard Time
+ preferred "ChST", so the rule has been relaxed.
-* This package is already part of many POSIX-compliant hosts,
- including BSD, HP, Linux, Network Appliance, SCO, SGI, and Sun.
- On such hosts, the primary use of this package
- is to update obsolete time zone rule tables.
- To do this, you may need to compile the time zone compiler
- 'zic' supplied with this package instead of using the system 'zic',
- since the format of zic's input changed slightly in late 1994,
- and many vendors still do not support the new input format.
+ This rule guarantees that all abbreviations could have
+ been specified by a POSIX TZ string. POSIX
+ requires at least three characters for an
+ abbreviation. POSIX through 2000 says that an abbreviation
+ cannot start with ':', and cannot contain ',', '-',
+ '+', NUL, or a digit. POSIX from 2001 on changes this
+ rule to say that an abbreviation can contain only '-', '+',
+ and alphanumeric characters from the portable character set
+ in the current locale. To be portable to both sets of
+ rules, an abbreviation must therefore use only ASCII
+ letters.
-* The UNIX Version 7 "timezone" function is not present in this package;
- it's impossible to reliably map timezone's arguments (a "minutes west
- of GMT" value and a "daylight saving time in effect" flag) to a
- time zone abbreviation, and we refuse to guess.
- Programs that in the past used the timezone function may now examine
- tzname[localtime(&clock)->tm_isdst] to learn the correct time
- zone abbreviation to use. Alternatively, use
- localtime(&clock)->tm_zone if this has been enabled.
+ Use abbreviations that are in common use among English-speakers,
+ e.g. 'EST' for Eastern Standard Time in North America.
+ We assume that applications translate them to other languages
+ as part of the normal localization process; for example,
+ a French application might translate 'EST' to 'HNE'.
-* The 4.2BSD gettimeofday function is not used in this package.
- This formerly let users obtain the current UTC offset and DST flag,
- but this functionality was removed in later versions of BSD.
+ For zones whose times are taken from a city's longitude, use the
+ traditional xMT notation, e.g. 'PMT' for Paris Mean Time.
+ The only name like this in current use is 'GMT'.
-* In SVR2, time conversion fails for near-minimum or near-maximum
- time_t values when doing conversions for places that don't use UT.
- This package takes care to do these conversions correctly.
+ Use 'LMT' for local mean time of locations before the introduction
+ of standard time; see "Scope of the tz database".
-The functions that are conditionally compiled if STD_INSPIRED is defined
-should, at this point, be looked on primarily as food for thought. They are
-not in any sense "standard compatible" - some are not, in fact, specified in
-*any* standard. They do, however, represent responses of various authors to
-standardization proposals.
+ If there is no common English abbreviation, use numeric offsets like
+ -05 and +0830 that are generated by zic's %z notation.
-Other time conversion proposals, in particular the one developed by folks at
-Hewlett Packard, offer a wider selection of functions that provide capabilities
-beyond those provided here. The absence of such functions from this package
-is not meant to discourage the development, standardization, or use of such
-functions. Rather, their absence reflects the decision to make this package
-contain valid extensions to POSIX, to ensure its broad acceptability. If
-more powerful time conversion functions can be standardized, so much the
-better.
+ [The remaining guidelines predate the introduction of %z.
+ They are problematic as they mean tz data entries invent
+ notation rather than record it. These guidelines are now
+ deprecated and the plan is to gradually move to %z for
+ inhabited locations and to "-00" for uninhabited locations.]
+ If there is no common English abbreviation, abbreviate the English
+ translation of the usual phrase used by native speakers.
+ If this is not available or is a phrase mentioning the country
+ (e.g. "Cape Verde Time"), then:
------ Scope of the tz database -----
+ When a country is identified with a single or principal zone,
+ append 'T' to the country's ISO code, e.g. 'CVT' for
+ Cape Verde Time. For summer time append 'ST';
+ for double summer time append 'DST'; etc.
+ Otherwise, take the first three letters of an English place
+ name identifying each zone and append 'T', 'ST', etc.
+ as before; e.g. 'VLAST' for VLAdivostok Summer Time.
-The tz database attempts to record the history and predicted future of
-all computer-based clocks that track civil time. To represent this
-data, the world is partitioned into regions whose clocks all agree
-about time stamps that occur after the somewhat-arbitrary cutoff point
-of the POSIX Epoch (1970-01-01 00:00:00 UTC). For each such region,
-the database records all known clock transitions, and labels the region
-with a notable location. Although 1970 is a somewhat-arbitrary
-cutoff, there are significant challenges to moving the cutoff earlier
-even by a decade or two, due to the wide variety of local practices
-before computer timekeeping became prevalent.
+ Use UT (with time zone abbreviation 'zzz') for locations while
+ uninhabited. The 'zzz' mnemonic is that these locations are,
+ in some sense, asleep.
-Clock transitions before 1970 are recorded for each such location,
-because most POSIX-compatible systems support negative time stamps and
-could misbehave if data entries were omitted for pre-1970 transitions.
-However, the database is not designed for and does not suffice for
-applications requiring accurate handling of all past times everywhere,
-as it would take far too much effort and guesswork to record all
-details of pre-1970 civil timekeeping.
+Application writers should note that these abbreviations are ambiguous
+in practice: e.g. 'CST' has a different meaning in China than
+it does in the United States. In new applications, it's often better
+to use numeric UT offsets like '-0600' instead of time zone
+abbreviations like 'CST'; this avoids the ambiguity.
----- Accuracy of the tz database -----
@@ -358,194 +369,197 @@ creation of zones merely because two locations differ in LMT or
transitioned to standard time at different dates.
------ Names of time zone rule files -----
+----- Time and date functions -----
-The time zone rule file naming conventions attempt to strike a balance
-among the following goals:
+The tz code contains time and date functions that are upwards
+compatible with those of POSIX.
- * Uniquely identify every national region where clocks have all
- agreed since 1970. This is essential for the intended use: static
- clocks keeping local civil time.
+POSIX has the following properties and limitations.
- * Indicate to humans as to where that region is. This simplifies use.
+* In POSIX, time display in a process is controlled by the
+ environment variable TZ. Unfortunately, the POSIX TZ string takes
+ a form that is hard to describe and is error-prone in practice.
+ Also, POSIX TZ strings can't deal with other (for example, Israeli)
+ daylight saving time rules, or situations where more than two
+ time zone abbreviations are used in an area.
- * Be robust in the presence of political changes. This reduces the
- number of updates and backward-compatibility hacks. For example,
- names of countries are ordinarily not used, to avoid
- incompatibilities when countries change their name
- (e.g. Zaire->Congo) or when locations change countries
- (e.g. Hong Kong from UK colony to China).
+ The POSIX TZ string takes the following form:
- * Be portable to a wide variety of implementations.
- This promotes use of the technology.
+ stdoffset[dst[offset][,date[/time],date[/time]]]
- * Use a consistent naming convention over the entire world.
- This simplifies both use and maintenance.
+ where:
-This naming convention is not intended for use by inexperienced users
-to select TZ values by themselves (though they can of course examine
-and reuse existing settings). Distributors should provide
-documentation and/or a simple selection interface that explains the
-names; see the 'tzselect' program supplied with this distribution for
-one example.
+ std and dst
+ are 3 or more characters specifying the standard
+ and daylight saving time (DST) zone names.
+ Starting with POSIX.1-2001, std and dst may also be
+ in a quoted form like "<UTC+10>"; this allows
+ "+" and "-" in the names.
+ offset
+ is of the form '[+-]hh:[mm[:ss]]' and specifies the
+ offset west of UT. 'hh' may be a single digit; 0<=hh<=24.
+ The default DST offset is one hour ahead of standard time.
+ date[/time],date[/time]
+ specifies the beginning and end of DST. If this is absent,
+ the system supplies its own rules for DST, and these can
+ differ from year to year; typically US DST rules are used.
+ time
+ takes the form 'hh:[mm[:ss]]' and defaults to 02:00.
+ This is the same format as the offset, except that a
+ leading '+' or '-' is not allowed.
+ date
+ takes one of the following forms:
+ Jn (1<=n<=365)
+ origin-1 day number not counting February 29
+ n (0<=n<=365)
+ origin-0 day number counting February 29 if present
+ Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
+ for the dth day of week n of month m of the year,
+ where week 1 is the first week in which day d appears,
+ and '5' stands for the last week in which day d appears
+ (which may be either the 4th or 5th week).
+ Typically, this is the only useful form;
+ the n and Jn forms are rarely used.
-Names normally have the form AREA/LOCATION, where AREA is the name
-of a continent or ocean, and LOCATION is the name of a specific
-location within that region. North and South America share the same
-area, 'America'. Typical names are 'Africa/Cairo', 'America/New_York',
-and 'Pacific/Honolulu'.
+ Here is an example POSIX TZ string, for US Pacific time using rules
+ appropriate from 1987 through 2006:
-Here are the general rules used for choosing location names,
-in decreasing order of importance:
+ TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'
- Use only valid POSIX file name components (i.e., the parts of
- names other than '/'). Do not use the file name
- components '.' and '..'. Within a file name component,
- use only ASCII letters, '.', '-' and '_'. Do not use
- digits, as that might create an ambiguity with POSIX
- TZ strings. A file name component must not exceed 14
- characters or start with '-'. E.g., prefer 'Brunei'
- to 'Bandar_Seri_Begawan'. Exceptions: see the discussion
- of legacy names below.
- A name must not be empty, or contain '//', or start or end with '/'.
- Do not use names that differ only in case. Although the reference
- implementation is case-sensitive, some other implementations
- are not, and they would mishandle names differing only in case.
- If one name A is an initial prefix of another name AB (ignoring case),
- then B must not start with '/', as a regular file cannot have
- the same name as a directory in POSIX. For example,
- 'America/New_York' precludes 'America/New_York/Bronx'.
- Uninhabited regions like the North Pole and Bouvet Island
- do not need locations, since local time is not defined there.
- There should typically be at least one name for each ISO 3166-1
- officially assigned two-letter code for an inhabited country
- or territory.
- If all the clocks in a region have agreed since 1970,
- don't bother to include more than one location
- even if subregions' clocks disagreed before 1970.
- Otherwise these tables would become annoyingly large.
- If a name is ambiguous, use a less ambiguous alternative;
- e.g. many cities are named San José and Georgetown, so
- prefer 'Costa_Rica' to 'San_Jose' and 'Guyana' to 'Georgetown'.
- Keep locations compact. Use cities or small islands, not countries
- or regions, so that any future time zone changes do not split
- locations into different time zones. E.g. prefer 'Paris'
- to 'France', since France has had multiple time zones.
- Use mainstream English spelling, e.g. prefer 'Rome' to 'Roma', and
- prefer 'Athens' to the Greek 'Αθήνα' or the Romanized 'Athína'.
- The POSIX file name restrictions encourage this rule.
- Use the most populous among locations in a zone,
- e.g. prefer 'Shanghai' to 'Beijing'. Among locations with
- similar populations, pick the best-known location,
- e.g. prefer 'Rome' to 'Milan'.
- Use the singular form, e.g. prefer 'Canary' to 'Canaries'.
- Omit common suffixes like '_Islands' and '_City', unless that
- would lead to ambiguity. E.g. prefer 'Cayman' to
- 'Cayman_Islands' and 'Guatemala' to 'Guatemala_City',
- but prefer 'Mexico_City' to 'Mexico' because the country
- of Mexico has several time zones.
- Use '_' to represent a space.
- Omit '.' from abbreviations in names, e.g. prefer 'St_Helena'
- to 'St._Helena'.
- Do not change established names if they only marginally
- violate the above rules. For example, don't change
- the existing name 'Rome' to 'Milan' merely because
- Milan's population has grown to be somewhat greater
- than Rome's.
- If a name is changed, put its old spelling in the 'backward' file.
- This means old spellings will continue to work.
+ This POSIX TZ string is hard to remember, and mishandles time stamps
+ before 1987 and after 2006. With this package you can use this
+ instead:
-The file 'zone1970.tab' lists geographical locations used to name time
-zone rule files. It is intended to be an exhaustive list of names
-for geographic regions as described above; this is a subset of the
-names in the data. Although a 'zone1970.tab' location's longitude
-corresponds to its LMT offset with one hour for every 15 degrees east
-longitude, this relationship is not exact.
+ TZ='America/Los_Angeles'
-Older versions of this package used a different naming scheme,
-and these older names are still supported.
-See the file 'backward' for most of these older names
-(e.g., 'US/Eastern' instead of 'America/New_York').
-The other old-fashioned names still supported are
-'WET', 'CET', 'MET', and 'EET' (see the file 'europe').
+* POSIX does not define the exact meaning of TZ values like "EST5EDT".
+ Typically the current US DST rules are used to interpret such values,
+ but this means that the US DST rules are compiled into each program
+ that does time conversion. This means that when US time conversion
+ rules change (as in the United States in 1987), all programs that
+ do time conversion must be recompiled to ensure proper results.
-Older versions of this package defined legacy names that are
-incompatible with the first rule of location names, but which are
-still supported. These legacy names are mostly defined in the file
-'etcetera'. Also, the file 'backward' defines the legacy names
-'GMT0', 'GMT-0', 'GMT+0' and 'Canada/East-Saskatchewan', and the file
-'northamerica' defines the legacy names 'EST5EDT', 'CST6CDT',
-'MST7MDT', and 'PST8PDT'.
+* In POSIX, there's no tamper-proof way for a process to learn the
+ system's best idea of local wall clock. (This is important for
+ applications that an administrator wants used only at certain times -
+ without regard to whether the user has fiddled the "TZ" environment
+ variable. While an administrator can "do everything in UTC" to get
+ around the problem, doing so is inconvenient and precludes handling
+ daylight saving time shifts - as might be required to limit phone
+ calls to off-peak hours.)
-Excluding 'backward' should not affect the other data. If
-'backward' is excluded, excluding 'etcetera' should not affect the
-remaining data.
+* POSIX requires that systems ignore leap seconds.
+* The tz code attempts to support all the time_t implementations
+ allowed by POSIX. The time_t type represents a nonnegative count of
+ seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds.
+ In practice, time_t is usually a signed 64- or 32-bit integer; 32-bit
+ signed time_t values stop working after 2038-01-19 03:14:07 UTC, so
+ new implementations these days typically use a signed 64-bit integer.
+ Unsigned 32-bit integers are used on one or two platforms,
+ and 36-bit and 40-bit integers are also used occasionally.
+ Although earlier POSIX versions allowed time_t to be a
+ floating-point type, this was not supported by any practical
+ systems, and POSIX.1-2013 and the tz code both require time_t
+ to be an integer type.
------ Time zone abbreviations -----
+These are the extensions that have been made to the POSIX functions:
-When this package is installed, it generates time zone abbreviations
-like 'EST' to be compatible with human tradition and POSIX.
-Here are the general rules used for choosing time zone abbreviations,
-in decreasing order of importance:
+* The "TZ" environment variable is used in generating the name of a file
+ from which time zone information is read (or is interpreted a la
+ POSIX); "TZ" is no longer constrained to be a three-letter time zone
+ name followed by a number of hours and an optional three-letter
+ daylight time zone name. The daylight saving time rules to be used
+ for a particular time zone are encoded in the time zone file;
+ the format of the file allows U.S., Australian, and other rules to be
+ encoded, and allows for situations where more than two time zone
+ abbreviations are used.
- Use abbreviations that consist of three or more ASCII letters.
- Previous editions of this database also used characters like
- ' ' and '?', but these characters have a special meaning to
- the shell and cause commands like
- set `date`
- to have unexpected effects.
- Previous editions of this rule required upper-case letters,
- but the Congressman who introduced Chamorro Standard Time
- preferred "ChST", so the rule has been relaxed.
+ It was recognized that allowing the "TZ" environment variable to
+ take on values such as "America/New_York" might cause "old" programs
+ (that expect "TZ" to have a certain form) to operate incorrectly;
+ consideration was given to using some other environment variable
+ (for example, "TIMEZONE") to hold the string used to generate the
+ time zone information file name. In the end, however, it was decided
+ to continue using "TZ": it is widely used for time zone purposes;
+ separately maintaining both "TZ" and "TIMEZONE" seemed a nuisance;
+ and systems where "new" forms of "TZ" might cause problems can simply
+ use TZ values such as "EST5EDT" which can be used both by
+ "new" programs (a la POSIX) and "old" programs (as zone names and
+ offsets).
- This rule guarantees that all abbreviations could have
- been specified by a POSIX TZ string. POSIX
- requires at least three characters for an
- abbreviation. POSIX through 2000 says that an abbreviation
- cannot start with ':', and cannot contain ',', '-',
- '+', NUL, or a digit. POSIX from 2001 on changes this
- rule to say that an abbreviation can contain only '-', '+',
- and alphanumeric characters from the portable character set
- in the current locale. To be portable to both sets of
- rules, an abbreviation must therefore use only ASCII
- letters.
+* To handle places where more than two time zone abbreviations are used,
+ the functions "localtime" and "gmtime" set tzname[tmp->tm_isdst]
+ (where "tmp" is the value the function returns) to the time zone
+ abbreviation to be used. This differs from POSIX, where the elements
+ of tzname are only changed as a result of calls to tzset.
- Use abbreviations that are in common use among English-speakers,
- e.g. 'EST' for Eastern Standard Time in North America.
- We assume that applications translate them to other languages
- as part of the normal localization process; for example,
- a French application might translate 'EST' to 'HNE'.
+* Since the "TZ" environment variable can now be used to control time
+ conversion, the "daylight" and "timezone" variables are no longer
+ needed. (These variables are defined and set by "tzset"; however, their
+ values will not be used by "localtime.")
- For zones whose times are taken from a city's longitude, use the
- traditional xMT notation, e.g. 'PMT' for Paris Mean Time.
- The only name like this in current use is 'GMT'.
+* The "localtime" function has been set up to deliver correct results
+ for near-minimum or near-maximum time_t values. (A comment in the
+ source code tells how to get compatibly wrong results).
- If there is no common English abbreviation, abbreviate the English
- translation of the usual phrase used by native speakers.
- If this is not available or is a phrase mentioning the country
- (e.g. "Cape Verde Time"), then:
+* A function "tzsetwall" has been added to arrange for the system's
+ best approximation to local wall clock time to be delivered by
+ subsequent calls to "localtime." Source code for portable
+ applications that "must" run on local wall clock time should call
+ "tzsetwall();" if such code is moved to "old" systems that don't
+ provide tzsetwall, you won't be able to generate an executable program.
+ (These time zone functions also arrange for local wall clock time to be
+ used if tzset is called - directly or indirectly - and there's no "TZ"
+ environment variable; portable applications should not, however, rely
+ on this behavior since it's not the way SVR2 systems behave.)
- When a country is identified with a single or principal zone,
- append 'T' to the country's ISO code, e.g. 'CVT' for
- Cape Verde Time. For summer time append 'ST';
- for double summer time append 'DST'; etc.
- Otherwise, take the first three letters of an English place
- name identifying each zone and append 'T', 'ST', etc.
- as before; e.g. 'VLAST' for VLAdivostok Summer Time.
+* Negative time_t values are supported, on systems where time_t is signed.
- Use 'LMT' for local mean time of locations before the introduction
- of standard time; see "Scope of the tz database".
+* These functions can account for leap seconds, thanks to Bradley White.
- Use UT (with time zone abbreviation 'zzz') for locations while
- uninhabited. The 'zzz' mnemonic is that these locations are,
- in some sense, asleep.
+Points of interest to folks with other systems:
-Application writers should note that these abbreviations are ambiguous
-in practice: e.g. 'CST' has a different meaning in China than
-it does in the United States. In new applications, it's often better
-to use numeric UT offsets like '-0600' instead of time zone
-abbreviations like 'CST'; this avoids the ambiguity.
+* This package is already part of many POSIX-compliant hosts,
+ including BSD, HP, Linux, Network Appliance, SCO, SGI, and Sun.
+ On such hosts, the primary use of this package
+ is to update obsolete time zone rule tables.
+ To do this, you may need to compile the time zone compiler
+ 'zic' supplied with this package instead of using the system 'zic',
+ since the format of zic's input changed slightly in late 1994,
+ and many vendors still do not support the new input format.
+
+* The UNIX Version 7 "timezone" function is not present in this package;
+ it's impossible to reliably map timezone's arguments (a "minutes west
+ of GMT" value and a "daylight saving time in effect" flag) to a
+ time zone abbreviation, and we refuse to guess.
+ Programs that in the past used the timezone function may now examine
+ tzname[localtime(&clock)->tm_isdst] to learn the correct time
+ zone abbreviation to use. Alternatively, use
+ localtime(&clock)->tm_zone if this has been enabled.
+
+* The 4.2BSD gettimeofday function is not used in this package.
+ This formerly let users obtain the current UTC offset and DST flag,
+ but this functionality was removed in later versions of BSD.
+
+* In SVR2, time conversion fails for near-minimum or near-maximum
+ time_t values when doing conversions for places that don't use UT.
+ This package takes care to do these conversions correctly.
+
+The functions that are conditionally compiled if STD_INSPIRED is defined
+should, at this point, be looked on primarily as food for thought. They are
+not in any sense "standard compatible" - some are not, in fact, specified in
+*any* standard. They do, however, represent responses of various authors to
+standardization proposals.
+
+Other time conversion proposals, in particular the one developed by folks at
+Hewlett Packard, offer a wider selection of functions that provide capabilities
+beyond those provided here. The absence of such functions from this package
+is not meant to discourage the development, standardization, or use of such
+functions. Rather, their absence reflects the decision to make this package
+contain valid extensions to POSIX, to ensure its broad acceptability. If
+more powerful time conversion functions can be standardized, so much the
+better.
----- Calendrical issues -----
@@ -766,6 +780,11 @@ Tom Chmielewski, "Jet Lag Is Worse on Mars", The Atlantic (2015-02-26)
<http://www.theatlantic.com/technology/archive/2015/02/jet-lag-is-worse-on-mars/386033/>
-----
+
+This file is in the public domain, so clarified as of 2009-05-17 by
+Arthur David Olson.
+
+-----
Local Variables:
coding: utf-8
End:
diff --git a/elsie.nci.nih.gov/src/africa b/elsie.nci.nih.gov/src/africa
index ea0171a..f20d216 100644
--- a/elsie.nci.nih.gov/src/africa
+++ b/elsie.nci.nih.gov/src/africa
@@ -338,9 +338,10 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# time this summer, and carry out studies on the possibility of canceling the
# practice altogether in future years."
#
-# From Paul Eggert (2015-04-20):
-# For now, assume DST will be canceled. Any resumption would likely
-# use different rules anyway.
+# From Paul Eggert (2015-04-24):
+# Yesterday the office of Egyptian President El-Sisi announced his
+# decision to abandon DST permanently. See Ahram Online 2015-04-24.
+# http://english.ahram.org.eg/NewsContent/1/64/128509/Egypt/Politics-/Sisi-cancels-daylight-saving-time-in-Egypt.aspx
Rule Egypt 2008 only - Aug lastThu 24:00 0 -
Rule Egypt 2009 only - Aug 20 24:00 0 -
@@ -537,7 +538,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# From Alex Krivenyshev (2008-07-11):
# Seems that English language article "The revival of daylight saving
-# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally
+# time: Energy conservation?"- No. 16578 (07/11/2008) was originally
# published on Monday, June 30, 2008...
#
# I guess that article in French "Le gouvernement avance l'introduction
@@ -669,7 +670,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# Here is a link to official document from Royaume du Maroc Premier Ministre,
# Ministère de la Modernisation des Secteurs Publics
#
-# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
+# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 June 1967)
# concerning the amendment of the legal time, the Ministry of Modernization of
# Public Sectors announced that the official time in the Kingdom will be
# advanced 60 minutes from Sunday 31 May 2009 at midnight.
@@ -787,20 +788,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# will resume again at 02:00 on Saturday, August 2, 2014....
# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
-# From Paul Eggert (2014-06-05):
-# For now, guess that later spring and fall transitions will use 2014's rules,
+# From Milamber (2015-06-08):
+# (Google Translation) The hour will thus be delayed 60 minutes
+# Sunday, June 14 at 3:00, the ministry said in a statement, adding
+# that the time will be advanced again 60 minutes Sunday, July 19,
+# 2015 at 2:00. The move comes under 2.12.126 Decree of 26 Jumada I
+# 1433 (18 April 2012) and the decision of the Head of Government of
+# 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
+# Source (french):
+# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
+#
+# From Milamber (2015-06-09):
+# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
+#
+# From Michael Deckers (2015-06-09):
+# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
+# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
+# I think the patch is correct and the quoted text is wrong; the text in
+# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
+# with the patch.
+
+# From Paul Eggert (2015-06-08):
+# For now, guess that later spring and fall transitions will use 2015's rules,
# and guess that Morocco will switch to standard time at 03:00 the last
-# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
-# Ramadan. To implement this, transition dates for 2015 through 2037 were
+# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after
+# Ramadan. To implement this, transition dates for 2016 through 2037 were
# determined by running the following program under GNU Emacs 24.3, with the
# results integrated by hand into the table below.
-# (let ((islamic-year 1436))
+# (let ((islamic-year 1437))
+# (require 'cal-islam)
# (while (< islamic-year 1460)
# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
# (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-# (saturday 6))
-# (while (/= saturday (mod (setq a (1- a)) 7)))
-# (while (/= saturday (mod b 7))
+# (sunday 0))
+# (while (/= sunday (mod (setq a (1- a)) 7)))
+# (while (/= sunday (mod b 7))
# (setq b (1+ b)))
# (setq a (calendar-gregorian-from-absolute a))
# (setq b (calendar-gregorian-from-absolute b))
@@ -844,32 +866,30 @@ Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 7 3:00 0 -
Rule Morocco 2013 only - Aug 10 2:00 1:00 S
Rule Morocco 2013 max - Oct lastSun 3:00 0 -
-Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S
+Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S
Rule Morocco 2014 only - Jun 28 3:00 0 -
Rule Morocco 2014 only - Aug 2 2:00 1:00 S
-Rule Morocco 2015 only - Jun 13 3:00 0 -
-Rule Morocco 2015 only - Jul 18 2:00 1:00 S
-Rule Morocco 2016 only - Jun 4 3:00 0 -
-Rule Morocco 2016 only - Jul 9 2:00 1:00 S
-Rule Morocco 2017 only - May 20 3:00 0 -
-Rule Morocco 2017 only - Jul 1 2:00 1:00 S
-Rule Morocco 2018 only - May 12 3:00 0 -
-Rule Morocco 2018 only - Jun 16 2:00 1:00 S
-Rule Morocco 2019 only - May 4 3:00 0 -
-Rule Morocco 2019 only - Jun 8 2:00 1:00 S
-Rule Morocco 2020 only - Apr 18 3:00 0 -
-Rule Morocco 2020 only - May 30 2:00 1:00 S
-Rule Morocco 2021 only - Apr 10 3:00 0 -
-Rule Morocco 2021 only - May 15 2:00 1:00 S
-Rule Morocco 2022 only - Apr 2 3:00 0 -
-Rule Morocco 2022 only - May 7 2:00 1:00 S
-Rule Morocco 2023 only - Apr 22 2:00 1:00 S
-Rule Morocco 2024 only - Apr 13 2:00 1:00 S
-Rule Morocco 2025 only - Apr 5 2:00 1:00 S
+Rule Morocco 2015 only - Jun 14 3:00 0 -
+Rule Morocco 2015 only - Jul 19 2:00 1:00 S
+Rule Morocco 2016 only - Jun 5 3:00 0 -
+Rule Morocco 2016 only - Jul 10 2:00 1:00 S
+Rule Morocco 2017 only - May 21 3:00 0 -
+Rule Morocco 2017 only - Jul 2 2:00 1:00 S
+Rule Morocco 2018 only - May 13 3:00 0 -
+Rule Morocco 2018 only - Jun 17 2:00 1:00 S
+Rule Morocco 2019 only - May 5 3:00 0 -
+Rule Morocco 2019 only - Jun 9 2:00 1:00 S
+Rule Morocco 2020 only - Apr 19 3:00 0 -
+Rule Morocco 2020 only - May 24 2:00 1:00 S
+Rule Morocco 2021 only - Apr 11 3:00 0 -
+Rule Morocco 2021 only - May 16 2:00 1:00 S
+Rule Morocco 2022 only - May 8 2:00 1:00 S
+Rule Morocco 2023 only - Apr 23 2:00 1:00 S
+Rule Morocco 2024 only - Apr 14 2:00 1:00 S
+Rule Morocco 2025 only - Apr 6 2:00 1:00 S
Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
-Rule Morocco 2035 only - Oct 27 3:00 0 -
-Rule Morocco 2036 only - Oct 18 3:00 0 -
-Rule Morocco 2037 only - Oct 10 3:00 0 -
+Rule Morocco 2036 only - Oct 19 3:00 0 -
+Rule Morocco 2037 only - Oct 4 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
diff --git a/elsie.nci.nih.gov/src/asia b/elsie.nci.nih.gov/src/asia
index 756e3d0..4f8756b 100644
--- a/elsie.nci.nih.gov/src/asia
+++ b/elsie.nci.nih.gov/src/asia
@@ -6,7 +6,7 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2015-08-08):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -43,7 +43,7 @@
# 2:00 EET EEST Eastern European Time
# 2:00 IST IDT Israel
# 3:00 AST ADT Arabia*
-# 3:30 IRST IRDT Iran
+# 3:30 IRST IRDT Iran*
# 4:00 GST Gulf*
# 5:30 IST India
# 7:00 ICT Indochina, most times and locations*
@@ -52,10 +52,11 @@
# 8:00 CST China
# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
# 8:00 JWST Western Standard Time (Japan, 1896/1937)*
+# 8:30 KST KDT Korea when at +0830*
# 9:00 JCST Central Standard Time (Japan, 1896/1937)
# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
# 9:00 JST JDT Japan
-# 9:00 KST KDT Korea
+# 9:00 KST KDT Korea when at +09
# 9:30 ACST Australian Central Standard Time
#
# See the 'europe' file for Russia and Turkey in Asia.
@@ -1027,7 +1028,7 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
#
# From Roozbeh Pournader (2007-11-05):
# This is quoted from Official Gazette of the Islamic Republic of
-# Iran, Volume 63, Number 18242, dated Tuesday 1386/6/24
+# Iran, Volume 63, No. 18242, dated Tuesday 1386/6/24
# [2007-10-16]. I am doing the best translation I can:...
# The official time of the country will be moved forward for one hour
# on the 24 hours of the first day of the month of Farvardin and will
@@ -1557,7 +1558,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# - Qyzylorda switched from +5:00 to +6:00 on 1992-01-19 02:00.
# - Oral switched from +5:00 to +4:00 in spring 1989.
-# From Kazakhstan Embassy's News Bulletin #11
+# From Kazakhstan Embassy's News Bulletin No. 11
# <http://www.kazsociety.org.uk/news/2005/03/30.htm> (2005-03-21):
# The Government of Kazakhstan passed a resolution March 15 abolishing
# daylight saving time citing lack of economic benefits and health
@@ -1711,6 +1712,17 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
#
# For Pyongyang we have no information; guess no changes since World War II.
+# From Steffen Thorsen (2015-08-07):
+# According to many news sources, North Korea is going to change to
+# the 8:30 time zone on August 15, one example:
+# http://www.bbc.com/news/world-asia-33815049
+#
+# From Paul Eggert (2015-08-07):
+# No transition time is specified; assume 00:00.
+# There is no common English-language abbreviation for this time zone.
+# Use %z rather than invent one. We can't assume %z works everywhere yet,
+# so for now substitute its output manually.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
@@ -1723,7 +1735,8 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Aug 24
- 9:00 - KST
+ 9:00 - KST 2015 Aug 15
+ 8:30 - KST
###############################################################################
diff --git a/elsie.nci.nih.gov/src/backzone b/elsie.nci.nih.gov/src/backzone
index 6b392bd..0316708 100644
--- a/elsie.nci.nih.gov/src/backzone
+++ b/elsie.nci.nih.gov/src/backzone
@@ -279,11 +279,6 @@ Zone America/Aruba -4:40:24 - LMT 1912 Feb 12 # Oranjestad
-4:30 - ANT 1965 # Netherlands Antilles Time
-4:00 - AST
-# Cayman Is
-Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
- -5:07:11 - KMT 1912 Feb # Kingston Mean Time
- -5:00 - EST
-
# Canada
Zone America/Coral_Harbour -5:32:40 - LMT 1884
-5:00 NT_YK E%sT 1946
diff --git a/elsie.nci.nih.gov/src/date.1 b/elsie.nci.nih.gov/src/date.1
index cbdf3b4..7fd4848 100644
--- a/elsie.nci.nih.gov/src/date.1
+++ b/elsie.nci.nih.gov/src/date.1
@@ -15,16 +15,6 @@ date \- show and set date and time
.B \*-r
.I seconds
] [
-.B \*-n
-] [
-.B \*-d
-.I dsttype
-] [
-.B \*-t
-.I minutes-west
-] [
-\fB\*-a \fR[\fB+\fR|\fB\*-]\fIsss\fB.\fIfff\fR
-] [
.BI + format
] [
\fR[\fIyyyy\fR]\fImmddhhmm\fR[\fIyy\fR][\fB.\fIss\fR]
@@ -153,35 +143,6 @@ past the epoch of 1970-01-01 00:00:00 UTC, where
.I seconds
should be an integer, either decimal, octal (leading 0), or
hexadecimal (leading 0x), preceded by an optional sign.
-.TP
-.B \*-n
-Do not notify other networked systems of the time change.
-.TP
-.BI "\*-d " dsttype
-Set the kernel-stored Daylight Saving Time type to the given value.
-(The kernel-stored DST type is used mostly by
-.q "old"
-binaries.)
-.TP
-.BI "\*-t " minutes-west
-Set the kernel-stored
-.q "minutes west of UTC"
-value to the one given on the
-command line.
-(The kernel-stored DST type is used mostly by
-.q "old"
-binaries.)
-.TP
-.BI "\*-a " adjustment
-Change the time forward (or backward) by the number of seconds
-(and fractions thereof) specified in the
-.I adjustment
-argument.
-Either the seconds part or the fractions part of the argument (but not both)
-may be omitted.
-On BSD-based systems,
-the adjustment is made by changing the rate at which time advances;
-on System-V-based systems, the adjustment is made by changing the time.
.SH FILES
.ta \w'/usr/local/etc/zoneinfo/posixrules\0\0'u
/usr/lib/locale/\f2L\fP/LC_TIME description of time locale \f2L\fP
diff --git a/elsie.nci.nih.gov/src/date.1.txt b/elsie.nci.nih.gov/src/date.1.txt
index f17f4bc..99ac0b7 100644
--- a/elsie.nci.nih.gov/src/date.1.txt
+++ b/elsie.nci.nih.gov/src/date.1.txt
@@ -4,8 +4,8 @@ NAME
date - show and set date and time
SYNOPSIS
- date [ -u ] [ -c ] [ -r seconds ] [ -n ] [ -d dsttype ] [ -t minutes-
- west ] [ -a [+|-]sss.fff ] [ +format ] [ [yyyy]mmddhhmm[yy][.ss] ]
+ date [ -u ] [ -c ] [ -r seconds ] [ +format ] [ [yyyy]mmddhhmm[yy][.ss]
+ ]
DESCRIPTION
Date without arguments writes the date and time to the standard output
@@ -93,27 +93,6 @@ DESCRIPTION
either decimal, octal (leading 0), or hexadecimal (leading 0x),
preceded by an optional sign.
- -n Do not notify other networked systems of the time change.
-
- -d dsttype
- Set the kernel-stored Daylight Saving Time type to the given
- value. (The kernel-stored DST type is used mostly by "old"
- binaries.)
-
- -t minutes-west
- Set the kernel-stored "minutes west of UTC" value to the one
- given on the command line. (The kernel-stored DST type is used
- mostly by "old" binaries.)
-
- -a adjustment
- Change the time forward (or backward) by the number of seconds
- (and fractions thereof) specified in the adjustment argument.
- Either the seconds part or the fractions part of the argument
- (but not both) may be omitted. On BSD-based systems, the
- adjustment is made by changing the rate at which time advances;
- on System-V-based systems, the adjustment is made by changing
- the time.
-
FILES
/usr/lib/locale/L/LC_TIME description of time locale L
/usr/local/etc/zoneinfo time zone information directory
diff --git a/elsie.nci.nih.gov/src/date.c b/elsie.nci.nih.gov/src/date.c
index b77de79..4eecc50 100644
--- a/elsie.nci.nih.gov/src/date.c
+++ b/elsie.nci.nih.gov/src/date.c
@@ -16,24 +16,7 @@
*/
#include "private.h"
-#if HAVE_ADJTIME || HAVE_SETTIMEOFDAY
-#include "sys/time.h" /* for struct timeval, struct timezone */
-#endif /* HAVE_ADJTIME || HAVE_SETTIMEOFDAY */
#include "locale.h"
-#include "utmp.h" /* for OLD_TIME (or its absence) */
-#if HAVE_UTMPX_H
-#include "utmpx.h"
-#endif
-
-#ifndef OTIME_MSG
-#define OTIME_MSG "old time"
-#endif
-#ifndef NTIME_MSG
-#define NTIME_MSG "new time"
-#endif
-#if !defined WTMPX_FILE && defined _PATH_WTMPX
-# define WTMPX_FILE _PATH_WTMPX
-#endif
/*
** The two things date knows about time are. . .
@@ -54,42 +37,23 @@ extern char * tzname[2];
static int retval = EXIT_SUCCESS;
-static void checkfinal(char const *, bool, time_t, time_t);
-static time_t convert(const char *, bool, time_t);
static void display(const char *, time_t);
static void dogmt(void);
static void errensure(void);
-static void iffy(time_t, time_t, const char *, const char *);
-static const char * nondigit(const char *);
-static void oops(const char *);
-static void reset(time_t, bool);
static void timeout(FILE *, const char *, const struct tm *);
static void usage(void);
-static void wildinput(const char *, const char *,
- const char *);
int
main(const int argc, char *argv[])
{
register const char * format;
- register const char * value;
register const char * cp;
register int ch;
- register bool dousg;
- register bool aflag = false;
- register bool dflag = false;
- register bool nflag = false;
- register bool tflag = false;
register bool rflag = false;
- register int minuteswest;
- register int dsttime;
- register double adjust;
- time_t now;
time_t t;
intmax_t secs;
char * endarg;
- INITIALIZE(dousg);
#ifdef LC_ALL
setlocale(LC_ALL, "");
#endif /* defined(LC_ALL) */
@@ -99,9 +63,9 @@ main(const int argc, char *argv[])
#endif /* defined(TEXTDOMAINDIR) */
textdomain(TZ_DOMAIN);
#endif /* HAVE_GETTEXT */
- t = now = time(NULL);
- format = value = NULL;
- while ((ch = getopt(argc, argv, "ucr:nd:t:a:")) != EOF && ch != -1) {
+ t = time(NULL);
+ format = NULL;
+ while ((ch = getopt(argc, argv, "ucr:")) != EOF && ch != -1) {
switch (ch) {
default:
usage();
@@ -129,58 +93,6 @@ main(const int argc, char *argv[])
}
t = secs;
break;
- case 'n': /* don't set network */
- nflag = true;
- break;
- case 'd': /* daylight saving time */
- if (dflag) {
- fprintf(stderr,
- _("date: error: multiple -d's used"));
- usage();
- }
- dflag = true;
- cp = optarg;
- dsttime = atoi(cp);
- if (*cp == '\0' || *nondigit(cp) != '\0')
- wildinput(_("-t value"), optarg,
- _("must be a non-negative number"));
- break;
- case 't': /* minutes west of UTC */
- if (tflag) {
- fprintf(stderr,
- _("date: error: multiple -t's used"));
- usage();
- }
- tflag = true;
- cp = optarg;
- minuteswest = atoi(cp);
- if (*cp == '+' || *cp == '-')
- ++cp;
- if (*cp == '\0' || *nondigit(cp) != '\0')
- wildinput(_("-d value"), optarg,
- _("must be a number"));
- break;
- case 'a': /* adjustment */
- if (aflag) {
- fprintf(stderr,
- _("date: error: multiple -a's used"));
- usage();
- }
- aflag = true;
- cp = optarg;
- adjust = atof(cp);
- if (*cp == '+' || *cp == '-')
- ++cp;
- if (*cp == '\0' || strcmp(cp, ".") == 0)
- wildinput(_("-a value"), optarg,
- _("must be a number"));
- cp = nondigit(cp);
- if (*cp == '.')
- ++cp;
- if (*nondigit(cp) != '\0')
- wildinput(_("-a value"), optarg,
- _("must be a number"));
- break;
}
}
while (optind < argc) {
@@ -193,100 +105,11 @@ main(const int argc, char *argv[])
_("date: error: multiple formats in command line\n"));
usage();
}
- else if (value == NULL && !rflag)
- value = cp;
- else {
- fprintf(stderr,
-_("date: error: multiple values in command line\n"));
- usage();
- }
- }
- if (value != NULL) {
- /*
- ** This order ensures that "reasonable" twelve-digit inputs
- ** (such as 120203042006) won't be misinterpreted
- ** even if time_t's range all the way back to the thirteenth
- ** century. Do not change the order.
- */
- t = convert(value, (dousg = true), now);
- if (t == -1)
- t = convert(value, (dousg = false), now);
- if (t == -1) {
- /*
- ** Out of range values,
- ** or time that falls in a DST transition hole?
- */
- if ((cp = strchr(value, '.')) != NULL) {
- /*
- ** Ensure that the failure of
- ** TZ=America/New_York date 8712312359.60
- ** doesn't get misdiagnosed. (It was
- ** TZ=America/New_York date 8712311859.60
- ** when the leap second was inserted.)
- ** The normal check won't work since
- ** the given time is valid in UTC.
- */
- if (atoi(cp + 1) >= SECSPERMIN)
- wildinput(_("time"), value,
- _("out of range seconds given"));
- }
- dogmt();
- t = convert(value, false, now);
- if (t == -1)
- t = convert(value, true, now);
- wildinput(_("time"), value,
- (t == -1) ?
- _("out of range value given") :
- _("time skipped when clock springs forward"));
+ else {
+ fprintf(stderr, _("date: unknown operand: %s\n"), cp);
+ usage();
}
}
- /*
- ** Entire command line has now been checked.
- */
- if (aflag) {
-#if HAVE_ADJTIME
- struct timeval tv;
-
- tv.tv_sec = (int) adjust;
- tv.tv_usec = (int) ((adjust - tv.tv_sec) * 1000000L);
- if (adjtime(&tv, NULL) != 0)
- oops("adjtime");
-#endif /* HAVE_ADJTIME */
-#if !HAVE_ADJTIME
- reset(now + adjust, nflag);
-#endif /* !HAVE_ADJTIME */
- /*
- ** Sun silently ignores everything else; we follow suit.
- */
- exit(retval);
- }
- if (dflag || tflag) {
-#if HAVE_SETTIMEOFDAY == 2
- struct timezone tz;
-
- if (!dflag || !tflag)
- if (gettimeofday(NULL, &tz) != 0)
- oops("gettimeofday");
- if (dflag)
- tz.tz_dsttime = dsttime;
- if (tflag)
- tz.tz_minuteswest = minuteswest;
- if (settimeofday(NULL, &tz) != 0)
- oops("settimeofday");
-#endif /* HAVE_SETTIMEOFDAY == 2 */
-#if HAVE_SETTIMEOFDAY != 2
- (void) dsttime;
- (void) minuteswest;
- fprintf(stderr,
-_("date: warning: kernel doesn't keep -d/-t information, option ignored\n"));
-#endif /* HAVE_SETTIMEOFDAY != 2 */
- }
-
- if (value) {
- reset(t, nflag);
- checkfinal(value, dousg, t, now);
- t = time(NULL);
- }
display(format, t);
return retval;
@@ -321,162 +144,6 @@ dogmt(void)
}
}
-#ifdef OLD_TIME
-
-/*
-** We assume we're on a System-V-based system,
-** should use stime,
-** should write System-V-format utmp entries,
-** and don't have network notification to worry about.
-*/
-
-#include "fcntl.h" /* for O_WRONLY, O_APPEND */
-
-/*ARGSUSED*/
-static void
-reset(time_t newt, bool nflag)
-{
- register int fid;
- time_t oldt;
- static struct {
- struct utmp before;
- struct utmp after;
- } s;
-#if HAVE_UTMPX_H
- static struct {
- struct utmpx before;
- struct utmpx after;
- } sx;
-#endif
-
- /*
- ** Wouldn't it be great if stime returned the old time?
- */
- oldt = time(NULL);
- if (stime(&newt) != 0)
- oops("stime");
- s.before.ut_type = OLD_TIME;
- s.before.ut_time = oldt;
- strcpy(s.before.ut_line, OTIME_MSG);
- s.after.ut_type = NEW_TIME;
- s.after.ut_time = newt;
- strcpy(s.after.ut_line, NTIME_MSG);
- fid = open(WTMP_FILE, O_WRONLY | O_APPEND);
- if (fid < 0)
- oops(_("log file open"));
- if (write(fid, (char *) &s, sizeof s) != sizeof s)
- oops(_("log file write"));
- if (close(fid) != 0)
- oops(_("log file close"));
-#if !HAVE_UTMPX_H
- pututline(&s.before);
- pututline(&s.after);
-#endif /* !HAVE_UTMPX_H */
-#if HAVE_UTMPX_H
- sx.before.ut_type = OLD_TIME;
- sx.before.ut_tv.tv_sec = oldt;
- strcpy(sx.before.ut_line, OTIME_MSG);
- sx.after.ut_type = NEW_TIME;
- sx.after.ut_tv.tv_sec = newt;
- strcpy(sx.after.ut_line, NTIME_MSG);
-#if defined WTMPX_FILE && !SUPPRESS_WTMPX_FILE_UPDATE
- /* In Solaris 2.5 (and presumably other systems),
- 'date' does not update /var/adm/wtmpx.
- This must be a bug. If you'd like to reproduce the bug,
- define SUPPRESS_WTMPX_FILE_UPDATE to be nonzero. */
- fid = open(WTMPX_FILE, O_WRONLY | O_APPEND);
- if (fid < 0)
- oops(_("log file open"));
- if (write(fid, (char *) &sx, sizeof sx) != sizeof sx)
- oops(_("log file write"));
- if (close(fid) != 0)
- oops(_("log file close"));
-# endif
- pututxline(&sx.before);
- pututxline(&sx.after);
-#endif /* HAVE_UTMPX_H */
-}
-
-#endif /* defined OLD_TIME */
-#ifndef OLD_TIME
-
-/*
-** We assume we're on a BSD-based system,
-** should use settimeofday,
-** should write BSD-format utmp entries (using logwtmp),
-** and may get to worry about network notification.
-** The "time name" changes between 4.3-tahoe and 4.4;
-** we include sys/param.h to determine which we should use.
-*/
-
-#ifndef TIME_NAME
-#include "sys/param.h"
-#ifdef BSD4_4
-#define TIME_NAME "date"
-#endif /* defined BSD4_4 */
-#ifndef BSD4_4
-#define TIME_NAME ""
-#endif /* !defined BSD4_4 */
-#endif /* !defined TIME_NAME */
-
-#include "syslog.h"
-#include "sys/socket.h"
-#include "netinet/in.h"
-#include "netdb.h"
-#define TSPTYPES
-#include "protocols/timed.h"
-
-extern int logwtmp();
-
-#if HAVE_SETTIMEOFDAY == 1
-#define settimeofday(t, tz) (settimeofday)(t)
-#endif /* HAVE_SETTIMEOFDAY == 1 */
-
-#ifdef TSP_SETDATE
-static bool netsettime(struct timeval);
-#endif
-
-#ifndef TSP_SETDATE
-/*ARGSUSED*/
-#endif /* !defined TSP_SETDATE */
-static void
-reset(time_t newt, bool nflag)
-{
- register const char * username;
- static struct timeval tv; /* static so tv_usec is 0 */
-
- username = getlogin();
- if (username == NULL || *username == '\0') /* single-user or no tty */
- username = "root";
- tv.tv_sec = newt;
-#ifdef TSP_SETDATE
- if (nflag || !netsettime(tv))
-#endif /* defined TSP_SETDATE */
- {
- /*
- ** "old" entry is always written, for compatibility.
- */
- logwtmp("|", TIME_NAME, "");
- if (settimeofday(&tv, NULL) == 0) {
- logwtmp("{", TIME_NAME, ""); /* } */
- syslog(LOG_AUTH | LOG_NOTICE, _("date set by %s"),
- username);
- } else oops("settimeofday");
- }
-}
-
-#endif /* !defined OLD_TIME */
-
-static void
-wildinput(const char *const item, const char *const value,
- const char *const reason)
-{
- fprintf(stderr,
- _("date: error: bad command line %s \"%s\", %s\n"),
- item, value, reason);
- usage();
-}
-
static void
errensure(void)
{
@@ -484,40 +151,18 @@ errensure(void)
retval = EXIT_FAILURE;
}
-static const char * ATTRIBUTE_PURE
-nondigit(register const char *cp)
-{
- while (is_digit(*cp))
- ++cp;
- return cp;
-}
-
static void
usage(void)
{
fprintf(stderr,
- _("date: usage: date [-u] [-c] [-r seconds] [-n]"
- " [-d dst] [-t min-west] [-a sss.fff]"
- " [[yyyy]mmddhhmm[yyyy][.ss]] [+format]\n"));
- errensure();
- exit(retval);
-}
-
-static void
-oops(const char *const string)
-{
- int e = errno;
-
- fprintf(stderr, _("date: error: "));
- errno = e;
- perror(string);
+ _("date: usage: date [-u] [-c] [-r seconds]"
+ " [+format]\n"));
errensure();
- display(NULL, time(NULL));
exit(retval);
}
static void
-display(const char *const format, time_t const now)
+display(char const *format, time_t now)
{
struct tm *tmp;
@@ -542,7 +187,7 @@ display(const char *const format, time_t const now)
#define INCR 1024
static void
-timeout(FILE *const fp, const char *const format, const struct tm *tmp)
+timeout(FILE *fp, char const *format, struct tm const *tmp)
{
char * cp;
size_t result;
@@ -577,360 +222,3 @@ timeout(FILE *const fp, const char *const format, const struct tm *tmp)
fwrite(cp, 1, result, fp);
free(cp);
}
-
-static bool
-sametm(register const struct tm *const atmp,
- register const struct tm *const btmp)
-{
- return atmp->tm_year == btmp->tm_year &&
- atmp->tm_mon == btmp->tm_mon &&
- atmp->tm_mday == btmp->tm_mday &&
- atmp->tm_hour == btmp->tm_hour &&
- atmp->tm_min == btmp->tm_min &&
- atmp->tm_sec == btmp->tm_sec;
-}
-
-/*
-** convert --
-** convert user's input into a time_t.
-*/
-
-#define ATOI2(ar) (ar[0] - '0') * 10 + (ar[1] - '0'); ar += 2;
-
-static time_t
-convert(char const *value, bool dousg, time_t t)
-{
- register const char * cp;
- register const char * dotp;
- register int cent, year_in_cent, month, hour, day, mins, secs;
- struct tm tm, outtm, *tmp;
- time_t outt;
-
- tmp = localtime(&t);
- if (!tmp)
- return -1;
- tm = *tmp;
-#define DIVISOR 100
- year_in_cent = tm.tm_year % DIVISOR + TM_YEAR_BASE % DIVISOR;
- cent = tm.tm_year / DIVISOR + TM_YEAR_BASE / DIVISOR +
- year_in_cent / DIVISOR;
- year_in_cent %= DIVISOR;
- if (year_in_cent < 0) {
- year_in_cent += DIVISOR;
- --cent;
- }
- month = tm.tm_mon + 1;
- day = tm.tm_mday;
- hour = tm.tm_hour;
- mins = tm.tm_min;
- secs = 0;
-
- dotp = strchr(value, '.');
- for (cp = value; *cp != '\0'; ++cp)
- if (!is_digit(*cp) && cp != dotp)
- wildinput(_("time"), value, _("contains a nondigit"));
-
- if (dotp == NULL)
- dotp = strchr(value, '\0');
- else {
- cp = dotp + 1;
- if (strlen(cp) != 2)
- wildinput(_("time"), value,
- _("seconds part is not two digits"));
- secs = ATOI2(cp);
- }
-
- cp = value;
- switch (dotp - cp) {
- default:
- wildinput(_("time"), value,
- _("main part is wrong length"));
- case 12:
- if (!dousg) {
- cent = ATOI2(cp);
- year_in_cent = ATOI2(cp);
- }
- month = ATOI2(cp);
- day = ATOI2(cp);
- hour = ATOI2(cp);
- mins = ATOI2(cp);
- if (dousg) {
- cent = ATOI2(cp);
- year_in_cent = ATOI2(cp);
- }
- break;
- case 8: /* mmddhhmm */
- month = ATOI2(cp);
- /* fall through to. . . */
- case 6: /* ddhhmm */
- day = ATOI2(cp);
- /* fall through to. . . */
- case 4: /* hhmm */
- hour = ATOI2(cp);
- mins = ATOI2(cp);
- break;
- case 10:
- if (!dousg) {
- year_in_cent = ATOI2(cp);
- }
- month = ATOI2(cp);
- day = ATOI2(cp);
- hour = ATOI2(cp);
- mins = ATOI2(cp);
- if (dousg) {
- year_in_cent = ATOI2(cp);
- }
- break;
- }
-
- tm.tm_year = cent * 100 + year_in_cent - TM_YEAR_BASE;
- tm.tm_mon = month - 1;
- tm.tm_mday = day;
- tm.tm_hour = hour;
- tm.tm_min = mins;
- tm.tm_sec = secs;
- tm.tm_isdst = -1;
- outtm = tm;
- outt = mktime(&outtm);
- return sametm(&tm, &outtm) ? outt : -1;
-}
-
-/*
-** Code from here on out is either based on code provided by UCB
-** or is only called just before the program exits.
-*/
-
-/*
-** Check for iffy input.
-*/
-
-static void
-checkfinal(char const *value, bool didusg, time_t t, time_t oldnow)
-{
- time_t othert;
- struct tm tm, *tmp;
- struct tm othertm;
- register int pass, offset;
-
- /*
- ** See if there's both a USG and a BSD interpretation.
- */
- othert = convert(value, !didusg, oldnow);
- if (othert != -1 && othert != t)
- iffy(t, othert, value, _("year could be at start or end"));
- /*
- ** See if there's both a DST and a STD version.
- */
- tmp = localtime(&t);
- if (!tmp)
- iffy(t, othert, value, _("time out of range"));
- othertm = tm = *tmp;
- othertm.tm_isdst = !tm.tm_isdst;
- othert = mktime(&othertm);
- if (othert != -1 && othertm.tm_isdst != tm.tm_isdst &&
- sametm(&tm, &othertm))
- iffy(t, othert, value,
- _("both standard and summer time versions exist"));
-/*
-** Final check.
-**
-** If a jurisdiction shifts time *without* shifting whether time is
-** summer or standard (as Hawaii, the United Kingdom, and Saudi Arabia
-** have done), routine checks for iffy times may not work.
-** So we perform this final check, deferring it until after the time has
-** been set; it may take a while, and we don't want to introduce an unnecessary
-** lag between the time the user enters their command and the time that
-** stime/settimeofday is called.
-**
-** We just check nearby times to see if any have the same representation
-** as the time that convert returned. We work our way out from the center
-** for quick response in solar time situations. We only handle common cases:
-** offsets of at most a minute, and offsets of exact numbers of minutes
-** and at most an hour.
-*/
- for (offset = 1; offset <= 60; ++offset)
- for (pass = 1; pass <= 4; ++pass) {
- if (pass == 1)
- othert = t + offset;
- else if (pass == 2)
- othert = t - offset;
- else if (pass == 3)
- othert = t + 60 * offset;
- else othert = t - 60 * offset;
- tmp = localtime(&othert);
- if (!tmp)
- iffy(t, othert, value,
- _("time out of range"));
- othertm = *tmp;
- if (sametm(&tm, &othertm))
- iffy(t, othert, value,
- _("multiple matching times exist"));
- }
-}
-
-static void
-iffy(const time_t thist, const time_t thatt,
- const char * const value, const char * const reason)
-{
- struct tm *tmp;
- bool dst;
-
- fprintf(stderr, _("date: warning: ambiguous time \"%s\", %s.\n"),
- value, reason);
- tmp = gmtime(&thist);
- /*
- ** Avoid running afoul of SCCS!
- */
- timeout(stderr, _("Time was set as if you used\n\tdate -u %m%d%H\
-%M\
-%Y.%S\n"), tmp);
- tmp = localtime(&thist);
- dst = tmp && tmp->tm_isdst;
- timeout(stderr, _("to get %c"), tmp);
- fprintf(stderr, _(" (%s). Use\n"),
- dst ? _("summer time") : _("standard time"));
- tmp = gmtime(&thatt);
- timeout(stderr, _("\tdate -u %m%d%H\
-%M\
-%Y.%S\n"), tmp);
- tmp = localtime(&thatt);
- dst = tmp && tmp->tm_isdst;
- timeout(stderr, _("to get %c"), tmp);
- fprintf(stderr, _(" (%s).\n"),
- dst ? _("summer time") : _("standard time"));
- errensure();
- exit(retval);
-}
-
-#ifdef TSP_SETDATE
-#define WAITACK 2 /* seconds */
-#define WAITDATEACK 5 /* seconds */
-
-/*
- * Set the date in the machines controlled by timedaemons
- * by communicating the new date to the local timedaemon.
- * If the timedaemon is in the master state, it performs the
- * correction on all slaves. If it is in the slave state, it
- * notifies the master that a correction is needed.
- * Return true on success.
- */
-static bool
-netsettime(struct timeval ntv)
-{
- int s, length, port, timed_ack, found, err, waittime;
- fd_set ready;
- struct timeval tout;
- struct servent *sp;
- struct tsp msg;
- struct sockaddr_in sin, dest, from;
-
- sp = getservbyname("timed", "udp");
- if (! sp) {
- fputs(_("udp/timed: unknown service\n"), stderr);
- retval = 2;
- return false;
- }
- dest.sin_port = sp->s_port;
- dest.sin_family = AF_INET;
- dest.sin_addr.s_addr = htonl(INADDR_ANY);
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
- if (errno != EPROTONOSUPPORT)
- perror("date: socket");
- goto bad;
- }
- bzero((char *)&sin, sizeof (sin));
- sin.sin_family = AF_INET;
- for (port = IPPORT_RESERVED - 1; port > IPPORT_RESERVED / 2; port--) {
- sin.sin_port = htons(port);
- if (bind(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0)
- break;
- if (errno != EADDRINUSE) {
- if (errno != EADDRNOTAVAIL)
- perror("date: bind");
- goto bad;
- }
- }
- if (port == IPPORT_RESERVED / 2) {
- fputs(_("date: All ports in use\n"), stderr);
- goto bad;
- }
- msg.tsp_type = TSP_SETDATE;
- msg.tsp_vers = TSPVERSION;
- msg.tsp_name[sizeof msg.tsp_name - 1] = '\0';
- if (gethostname(msg.tsp_name, sizeof msg.tsp_name) != 0) {
- perror("gethostname");
- goto bad;
- }
- if (msg.tsp_name[sizeof msg.tsp_name - 1]) {
- fprintf(stderr, "hostname too long\n");
- goto bad;
- }
- msg.tsp_seq = htons(0);
- msg.tsp_time.tv_sec = htonl(ntv.tv_sec);
- msg.tsp_time.tv_usec = htonl(ntv.tv_usec);
- length = sizeof (struct sockaddr_in);
- if (connect(s, &dest, length) < 0) {
- perror("date: connect");
- goto bad;
- }
- if (send(s, (char *)&msg, sizeof (struct tsp), 0) < 0) {
- if (errno != ECONNREFUSED)
- perror("date: send");
- goto bad;
- }
- timed_ack = -1;
- waittime = WAITACK;
-loop:
- tout.tv_sec = waittime;
- tout.tv_usec = 0;
- FD_ZERO(&ready);
- FD_SET(s, &ready);
- found = select(FD_SETSIZE, &ready, NULL, NULL, &tout);
- length = sizeof err;
- if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char *)&err, &length) == 0
- && err) {
- errno = err;
- if (errno != ECONNREFUSED)
- perror(_("date: send (delayed error)"));
- goto bad;
- }
- if (found > 0 && FD_ISSET(s, &ready)) {
- length = sizeof (struct sockaddr_in);
- if (recvfrom(s, (char *)&msg, sizeof (struct tsp), 0, &from,
- &length) < 0) {
- if (errno != ECONNREFUSED)
- perror("date: recvfrom");
- goto bad;
- }
- msg.tsp_seq = ntohs(msg.tsp_seq);
- msg.tsp_time.tv_sec = ntohl(msg.tsp_time.tv_sec);
- msg.tsp_time.tv_usec = ntohl(msg.tsp_time.tv_usec);
- switch (msg.tsp_type) {
-
- case TSP_ACK:
- timed_ack = TSP_ACK;
- waittime = WAITDATEACK;
- goto loop;
-
- case TSP_DATEACK:
- lose(s);
- return true;
-
- default:
- fprintf(stderr,
- _("date: Wrong ack received from timed: %s\n"),
- tsptype[msg.tsp_type]);
- timed_ack = -1;
- break;
- }
- }
- if (timed_ack == -1)
- fputs(_("date: Can't reach time daemon, time set locally.\n"),
- stderr);
-bad:
- lose(s);
- retval = 2;
- return false;
-}
-#endif /* defined TSP_SETDATE */
diff --git a/elsie.nci.nih.gov/src/difftime.c b/elsie.nci.nih.gov/src/difftime.c
index 449cdf0..ba2fd03 100644
--- a/elsie.nci.nih.gov/src/difftime.c
+++ b/elsie.nci.nih.gov/src/difftime.c
@@ -7,42 +7,52 @@
#include "private.h" /* for time_t and TYPE_SIGNED */
+/* Return -X as a double. Using this avoids casting to 'double'. */
+static double
+dminus(double x)
+{
+ return -x;
+}
+
double ATTRIBUTE_CONST
-difftime(const time_t time1, const time_t time0)
+difftime(time_t time1, time_t time0)
{
/*
- ** If (sizeof (double) > sizeof (time_t)) simply convert and subtract
+ ** If double is large enough, simply convert and subtract
** (assuming that the larger type has more precision).
*/
- if (sizeof (double) > sizeof (time_t))
- return (double) time1 - (double) time0;
- if (!TYPE_SIGNED(time_t)) {
- /*
- ** The difference of two unsigned values can't overflow
- ** if the minuend is greater than or equal to the subtrahend.
- */
- if (time1 >= time0)
- return time1 - time0;
- else return -(double) (time0 - time1);
+ if (sizeof (time_t) < sizeof (double)) {
+ double t1 = time1, t0 = time0;
+ return t1 - t0;
}
+
+ /*
+ ** The difference of two unsigned values can't overflow
+ ** if the minuend is greater than or equal to the subtrahend.
+ */
+ if (!TYPE_SIGNED(time_t))
+ return time0 <= time1 ? time1 - time0 : dminus(time0 - time1);
+
+ /* Use uintmax_t if wide enough. */
+ if (sizeof (time_t) <= sizeof (uintmax_t)) {
+ uintmax_t t1 = time1, t0 = time0;
+ return time0 <= time1 ? t1 - t0 : dminus(t0 - t1);
+ }
+
/*
** Handle cases where both time1 and time0 have the same sign
** (meaning that their difference cannot overflow).
*/
if ((time1 < 0) == (time0 < 0))
- return time1 - time0;
+ return time1 - time0;
+
/*
- ** time1 and time0 have opposite signs.
- ** Punt if uintmax_t is too narrow.
+ ** The values have opposite signs and uintmax_t is too narrow.
** This suffers from double rounding; attempt to lessen that
** by using long double temporaries.
*/
- if (sizeof (uintmax_t) < sizeof (time_t))
- return (long double) time1 - (long double) time0;
- /*
- ** Stay calm...decent optimizers will eliminate the complexity below.
- */
- if (time1 >= 0 /* && time0 < 0 */)
- return (uintmax_t) time1 + (uintmax_t) (-1 - time0) + 1;
- return -(double) ((uintmax_t) time0 + (uintmax_t) (-1 - time1) + 1);
+ {
+ long double t1 = time1, t0 = time0;
+ return t1 - t0;
+ }
}
diff --git a/elsie.nci.nih.gov/src/europe b/elsie.nci.nih.gov/src/europe
index c64c41b..6b89b6e 100644
--- a/elsie.nci.nih.gov/src/europe
+++ b/elsie.nci.nih.gov/src/europe
@@ -193,11 +193,14 @@
# republished in Finest Hour (Spring 2002) 1(114):26
# http://www.winstonchurchill.org/images/finesthour/Vol.01%20No.114.pdf
-# From Paul Eggert (1996-09-03):
+# From Paul Eggert (2015-08-08):
# The OED Supplement says that the English originally said "Daylight Saving"
# when they were debating the adoption of DST in 1908; but by 1916 this
# term appears only in quotes taken from DST's opponents, whereas the
# proponents (who eventually won the argument) are quoted as using "Summer".
+# The term "Summer Time" was introduced by Herbert Samuel, Home Secretary; see:
+# Viscount Samuel. Leisure in a Democracy. Cambridge University Press
+# ISBN 978-1-107-49471-8 (1949, reissued 2015), p 8.
# From Arthur David Olson (1989-01-19):
# A source at the British Information Office in New York avers that it's
@@ -343,7 +346,7 @@
# From an anonymous contributor (1996-06-02):
# The law governing time in Ireland is under Statutory Instrument SI 395/94,
-# which gives force to European Union 7th Council Directive # 94/21/EC.
+# which gives force to European Union 7th Council Directive No. 94/21/EC.
# Under this directive, the Minister for Justice in Ireland makes appropriate
# regulations. I spoke this morning with the Secretary of the Department of
# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
@@ -592,11 +595,11 @@ Rule Russia 1921 only - Feb 14 23:00 1:00 MSD
Rule Russia 1921 only - Mar 20 23:00 2:00 MSM # Midsummer
Rule Russia 1921 only - Sep 1 0:00 1:00 MSD
Rule Russia 1921 only - Oct 1 0:00 0 -
-# Act No.925 of the Council of Ministers of the USSR (1980-10-24):
+# Act No. 925 of the Council of Ministers of the USSR (1980-10-24):
Rule Russia 1981 1984 - Apr 1 0:00 1:00 S
Rule Russia 1981 1983 - Oct 1 0:00 0 -
-# Act No.967 of the Council of Ministers of the USSR (1984-09-13), repeated in
-# Act No.227 of the Council of Ministers of the USSR (1989-03-14):
+# Act No. 967 of the Council of Ministers of the USSR (1984-09-13), repeated in
+# Act No. 227 of the Council of Ministers of the USSR (1989-03-14):
Rule Russia 1984 1991 - Sep lastSun 2:00s 0 -
Rule Russia 1985 1991 - Mar lastSun 2:00s 1:00 S
#
@@ -828,7 +831,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880
# Bulgaria
#
# From Plamen Simenov via Steffen Thorsen (1999-09-09):
-# A document of Government of Bulgaria (No.94/1997) says:
+# A document of Government of Bulgaria (No. 94/1997) says:
# EET -> EETDST is in 03:00 Local time in last Sunday of March ...
# EETDST -> EET is in 04:00 Local time in last Sunday of October
#
@@ -845,7 +848,7 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
1:00 C-Eur CE%sT 1945
1:00 - CET 1945 Apr 2 3:00
2:00 - EET 1979 Mar 31 23:00
- 2:00 Bulg EE%sT 1982 Sep 26 2:00
+ 2:00 Bulg EE%sT 1982 Sep 26 3:00
2:00 C-Eur EE%sT 1991
2:00 E-Eur EE%sT 1997
2:00 EU EE%sT
@@ -1062,8 +1065,8 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base
# after that.
# From Mart Oruaas (2000-01-29):
-# Regulation no. 301 (1999-10-12) obsoletes previous regulation
-# no. 206 (1998-09-22) and thus sticks Estonia to +02:00 GMT for all
+# Regulation No. 301 (1999-10-12) obsoletes previous regulation
+# No. 206 (1998-09-22) and thus sticks Estonia to +02:00 GMT for all
# the year round. The regulation is effective 1999-11-01.
# From Toomas Soome (2002-02-21):
@@ -1084,7 +1087,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
3:00 Russia MSK/MSD 1989 Mar 26 2:00s
2:00 1:00 EEST 1989 Sep 24 2:00s
2:00 C-Eur EE%sT 1998 Sep 22
- 2:00 EU EE%sT 1999 Nov 1
+ 2:00 EU EE%sT 1999 Oct 31 4:00
2:00 - EET 2002 Feb 21
2:00 EU EE%sT
@@ -1527,21 +1530,21 @@ Link Europe/Rome Europe/San_Marino
# correct data in juridical acts and I found some juridical documents about
# changes in the counting of time in Latvia from 1981....
#
-# Act No.35 of the Council of Ministers of Latvian SSR of 1981-01-22 ...
-# according to the Act No.925 of the Council of Ministers of USSR of 1980-10-24
+# Act No. 35 of the Council of Ministers of Latvian SSR of 1981-01-22 ...
+# according to the Act No. 925 of the Council of Ministers of USSR of 1980-10-24
# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
# the hands of the clock 1 hour forward on 1 April at 00:00 (GMT 31 March 21:00)
# and 1 hour backward on the 1 October at 00:00 (GMT 30 September 20:00).
#
-# Act No.592 of the Council of Ministers of Latvian SSR of 1984-09-24 ...
-# according to the Act No.967 of the Council of Ministers of USSR of 1984-09-13
+# Act No. 592 of the Council of Ministers of Latvian SSR of 1984-09-24 ...
+# according to the Act No. 967 of the Council of Ministers of USSR of 1984-09-13
# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
# the hands of the clock 1 hour forward on the last Sunday of March at 02:00
# (GMT 23:00 on the previous day) and 1 hour backward on the last Sunday of
# September at 03:00 (GMT 23:00 on the previous day).
#
-# Act No.81 of the Council of Ministers of Latvian SSR of 1989-03-22 ...
-# according to the Act No.227 of the Council of Ministers of USSR of 1989-03-14
+# Act No. 81 of the Council of Ministers of Latvian SSR of 1989-03-22 ...
+# according to the Act No. 227 of the Council of Ministers of USSR of 1989-03-14
# ...: since the last Sunday of March 1989 in Lithuanian SSR, Latvian SSR,
# Estonian SSR and Kaliningrad region of Russian Federation all year round the
# time of 2nd time zone (Moscow time minus one hour). On the territory of Latvia
@@ -1558,7 +1561,7 @@ Link Europe/Rome Europe/San_Marino
# From Andrei Ivanov (2000-03-06):
# This year Latvia will not switch to Daylight Savings Time (as specified in
# The Regulations of the Cabinet of Ministers of the Rep. of Latvia of
-# 29-Feb-2000 (#79) <http://www.lv-laiks.lv/wwwraksti/2000/071072/vd4.htm>,
+# 29-Feb-2000 (No. 79) <http://www.lv-laiks.lv/wwwraksti/2000/071072/vd4.htm>,
# in Latvian for subscribers only).
# From RFE/RL Newsline
@@ -1763,6 +1766,18 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
# News from Moldova (in russian):
# http://ru.publika.md/link_317061.html
+# From Roman Tudos (2015-07-02):
+# http://lex.justice.md/index.php?action=view&view=doc&lang=1&id=355077
+# From Paul Eggert (2015-07-01):
+# The abovementioned official link to IGO1445-868/2014 states that
+# 2014-10-26's fallback transition occurred at 03:00 local time. Also,
+# http://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
+# says the 2014-03-30 spring-forward transition was at 02:00 local time.
+# Guess that since 1997 Moldova has switched one hour before the EU.
+
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule Moldova 1997 max - Mar lastSun 2:00 1:00 S
+Rule Moldova 1997 max - Oct lastSun 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Chisinau 1:55:20 - LMT 1880
@@ -1777,7 +1792,7 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
2:00 Russia EE%sT 1992
2:00 E-Eur EE%sT 1997
# See Romania commentary for the guessed 1997 transition to EU rules.
- 2:00 EU EE%sT
+ 2:00 Moldova EE%sT
# Monaco
# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
@@ -2123,7 +2138,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Russia
# From Alexander Krivenyshev (2011-09-15):
-# Based on last Russian Government Decree # 725 on August 31, 2011
+# Based on last Russian Government Decree No. 725 on August 31, 2011
# (Government document
# http://www.government.ru/gov/results/16355/print/
# in Russian)
@@ -2133,7 +2148,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm
# From Sanjeev Gupta (2011-09-27):
-# Scans of [Decree #23 of January 8, 1992] are available at:
+# Scans of [Decree No. 23 of January 8, 1992] are available at:
# http://government.consultant.ru/page.aspx?1223966
# They are in Cyrillic letters (presumably Russian).
@@ -2144,19 +2159,19 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# One source is
# http://government.ru/gov/results/16355/
# which, according to translate.google.com, begins "Decree of August 31,
-# 2011 No 725" and contains no other dates or "effective date" information.
+# 2011 No. 725" and contains no other dates or "effective date" information.
#
# Another source is
# http://www.rg.ru/2011/09/06/chas-zona-dok.html
# which, according to translate.google.com, begins "Resolution of the
# Government of the Russian Federation on August 31, 2011 N 725" and also
# contains "Date first official publication: September 6, 2011 Posted on:
-# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which
+# in the 'RG' - Federal Issue No. 5573 September 6, 2011" but which
# does not contain any "effective date" information.
#
# Another source is
# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
-# which, in note 8, contains "Resolution #725 of August 31, 2011...
+# which, in note 8, contains "Resolution No. 725 of August 31, 2011...
# Effective as of after 7 days following the day of the official publication"
# but which does not contain any reference to September 6, 2011.
#
@@ -2364,7 +2379,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
# changed in May.
2:00 E-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 3:00s
+ 3:00 E-Eur MSK/MSD 1996 Mar 31 0:00s
3:00 1:00 MSD 1996 Oct 27 3:00s
# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
# Assume it happened in March by not changing the clocks.
@@ -2499,7 +2514,7 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
# from current Russia Zone 6 - Krasnoyarsk Time Zone (KRA) UTC +0700
# to Russia Zone 5 - Novosibirsk Time Zone (NOV) UTC +0600
#
-# This is according to Government of Russia decree # 740, on September
+# This is according to Government of Russia decree No. 740, on September
# 14, 2009 "Application in the territory of the Kemerovo region the Fifth
# time zone." ("Russia Zone 5" or old "USSR Zone 5" is GMT +0600)
#
@@ -2922,7 +2937,7 @@ Zone Africa/Ceuta -0:21:16 - LMT 1901
Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
-1:00 - CANT 1946 Sep 30 1:00 # Canaries T
0:00 - WET 1980 Apr 6 0:00s
- 0:00 1:00 WEST 1980 Sep 28 0:00s
+ 0:00 1:00 WEST 1980 Sep 28 1:00u
0:00 EU WE%sT
# IATA SSIM (1996-09) says the Canaries switch at 2:00u, not 1:00u.
# Ignore this for now, as the Canaries are part of the EU.
@@ -3212,7 +3227,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# 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
-# regulations number 509, May 13, 1996. In my poor translation it says:
+# regulations No. 509, May 13, 1996. In my poor translation it says:
# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
# of March at 3am the time is changing to 4am and each last Sunday of
# October the time at 4am is changing to 3am"
@@ -3221,7 +3236,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# On September 20, 2011 the deputies of the Verkhovna Rada agreed to
# abolish the transfer clock to winter time.
#
-# Bill number 8330 of MP from the Party of Regions Oleg Nadoshi got
+# Bill No. 8330 of MP from the Party of Regions Oleg Nadoshi got
# approval from 266 deputies.
#
# Ukraine abolishes transfer back to the winter time (in Russian)
diff --git a/elsie.nci.nih.gov/src/iso3166.tab b/elsie.nci.nih.gov/src/iso3166.tab
index 0b0b842..0548800 100644
--- a/elsie.nci.nih.gov/src/iso3166.tab
+++ b/elsie.nci.nih.gov/src/iso3166.tab
@@ -3,11 +3,10 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
-# From Paul Eggert (2014-07-18):
+# From Paul Eggert (2015-05-02):
# This file contains a table of two-letter country codes. Columns are
# separated by a single tab. Lines beginning with '#' are comments.
-# Although all text currently uses ASCII encoding, this is planned to
-# change to UTF-8 soon. The columns of the table are as follows:
+# All text uses UTF-8 encoding. The columns of the table are as follows:
#
# 1. ISO 3166-1 alpha-2 country code, current as of
# ISO 3166-1 Newsletter VI-16 (2013-07-11). See: Updates on ISO 3166
@@ -38,7 +37,7 @@ AS Samoa (American)
AT Austria
AU Australia
AW Aruba
-AX Aaland Islands
+AX Åland Islands
AZ Azerbaijan
BA Bosnia & Herzegovina
BB Barbados
@@ -67,7 +66,7 @@ CD Congo (Dem. Rep.)
CF Central African Rep.
CG Congo (Rep.)
CH Switzerland
-CI Cote d'Ivoire
+CI Côte d'Ivoire
CK Cook Islands
CL Chile
CM Cameroon
@@ -211,7 +210,7 @@ PT Portugal
PW Palau
PY Paraguay
QA Qatar
-RE Reunion
+RE Réunion
RO Romania
RS Serbia
RU Russia
diff --git a/elsie.nci.nih.gov/src/leap-seconds.list b/elsie.nci.nih.gov/src/leap-seconds.list
index 5bac01b..0a0bacb 100755..100644
--- a/elsie.nci.nih.gov/src/leap-seconds.list
+++ b/elsie.nci.nih.gov/src/leap-seconds.list
@@ -199,10 +199,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
-# Updated through IERS Bulletin C49
-# File expires on: 28 December 2015
+# Updated through IERS Bulletin C50
+# File expires on: 28 June 2016
#
-#@ 3660249600
+#@ 3676060800
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -246,4 +246,4 @@
# the hash line is also ignored in the
# computation.
#
-#h 45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c
+#h 3d037453 3acade76 570bd8f8 be2b8bc9 55ec6fe8
diff --git a/elsie.nci.nih.gov/src/localtime.c b/elsie.nci.nih.gov/src/localtime.c
index a2d9aa8..ded8f7b 100644
--- a/elsie.nci.nih.gov/src/localtime.c
+++ b/elsie.nci.nih.gov/src/localtime.c
@@ -135,18 +135,20 @@ struct state {
int defaulttype; /* for early times or if no transitions */
};
+enum r_type {
+ JULIAN_DAY, /* Jn = Julian day */
+ DAY_OF_YEAR, /* n = day of year */
+ MONTH_NTH_DAY_OF_WEEK /* Mm.n.d = month, week, day of week */
+};
+
struct rule {
- int r_type; /* type of rule; see below */
+ enum r_type r_type; /* type of rule */
int r_day; /* day number of rule */
int r_week; /* week number of rule */
int r_mon; /* month number of rule */
int_fast32_t r_time; /* transition time of rule */
};
-#define JULIAN_DAY 0 /* Jn = Julian day */
-#define DAY_OF_YEAR 1 /* n = day of year */
-#define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d = month, week, day of week */
-
static struct tm *gmtsub(struct state const *, time_t const *, int_fast32_t,
struct tm *);
static bool increment_overflow(int *, int);
@@ -216,22 +218,44 @@ detzcode(const char *const codep)
{
register int_fast32_t result;
register int i;
+ int_fast32_t one = 1;
+ int_fast32_t halfmaxval = one << (32 - 2);
+ int_fast32_t maxval = halfmaxval - 1 + halfmaxval;
+ int_fast32_t minval = -1 - maxval;
- result = (codep[0] & 0x80) ? -1 : 0;
- for (i = 0; i < 4; ++i)
+ result = codep[0] & 0x7f;
+ for (i = 1; i < 4; ++i)
result = (result << 8) | (codep[i] & 0xff);
+
+ if (codep[0] & 0x80) {
+ /* Do two's-complement negation even on non-two's-complement machines.
+ If the result would be minval - 1, return minval. */
+ result -= !TWOS_COMPLEMENT(int_fast32_t) && result != 0;
+ result += minval;
+ }
return result;
}
static int_fast64_t
detzcode64(const char *const codep)
{
- register int_fast64_t result;
+ register uint_fast64_t result;
register int i;
+ int_fast64_t one = 1;
+ int_fast64_t halfmaxval = one << (64 - 2);
+ int_fast64_t maxval = halfmaxval - 1 + halfmaxval;
+ int_fast64_t minval = -TWOS_COMPLEMENT(int_fast64_t) - maxval;
- result = (codep[0] & 0x80) ? -1 : 0;
- for (i = 0; i < 8; ++i)
+ result = codep[0] & 0x7f;
+ for (i = 1; i < 8; ++i)
result = (result << 8) | (codep[i] & 0xff);
+
+ if (codep[0] & 0x80) {
+ /* Do two's-complement negation even on non-two's-complement machines.
+ If the result would be minval - 1, return minval. */
+ result -= !TWOS_COMPLEMENT(int_fast64_t) && result != 0;
+ result += minval;
+ }
return result;
}
@@ -646,7 +670,7 @@ tzload(char const *name, struct state *sp, bool doextend)
}
static bool
-typesequiv(const struct state *const sp, const int a, const int b)
+typesequiv(const struct state *sp, int a, int b)
{
register bool result;
@@ -956,13 +980,13 @@ transtime(const int year, register const struct rule *const rulep,
*/
static bool
-tzparse(const char *name, register struct state *const sp,
- bool lastditch)
+tzparse(const char *name, struct state *sp, bool lastditch)
{
const char * stdname;
const char * dstname;
size_t stdlen;
size_t dstlen;
+ size_t charcnt;
int_fast32_t stdoffset;
int_fast32_t dstoffset;
register char * cp;
@@ -970,10 +994,8 @@ tzparse(const char *name, register struct state *const sp,
stdname = name;
if (lastditch) {
- stdlen = strlen(name); /* length of standard zone name */
+ stdlen = sizeof gmt - 1;
name += stdlen;
- if (stdlen >= sizeof sp->chars)
- stdlen = (sizeof sp->chars) - 1;
stdoffset = 0;
} else {
if (*name == '<') {
@@ -988,12 +1010,15 @@ tzparse(const char *name, register struct state *const sp,
name = getzname(name);
stdlen = name - stdname;
}
- if (*name == '\0')
+ 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 */
@@ -1010,6 +1035,11 @@ tzparse(const char *name, register struct state *const sp,
name = getzname(name);
dstlen = name - dstname; /* length of DST zone name */
}
+ if (!dstlen)
+ return false;
+ charcnt += dstlen + 1;
+ if (sizeof sp->chars < charcnt)
+ return false;
if (*name != '\0' && *name != ',' && *name != ';') {
name = getoffset(name, &dstoffset);
if (name == NULL)
@@ -1170,11 +1200,7 @@ tzparse(const char *name, register struct state *const sp,
init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
sp->defaulttype = 0;
}
- sp->charcnt = stdlen + 1;
- if (dstlen != 0)
- sp->charcnt += dstlen + 1;
- if ((size_t) sp->charcnt > sizeof sp->chars)
- return false;
+ sp->charcnt = charcnt;
cp = sp->chars;
memcpy(cp, stdname, stdlen);
cp += stdlen;
@@ -1442,13 +1468,13 @@ localtime_tzset(time_t const *timep, struct tm *tmp, bool setname)
}
struct tm *
-localtime(const time_t *const timep)
+localtime(const time_t *timep)
{
return localtime_tzset(timep, &tm, true);
}
struct tm *
-localtime_r(const time_t *const timep, struct tm *tmp)
+localtime_r(const time_t *timep, struct tm *tmp)
{
return localtime_tzset(timep, tmp, false);
}
@@ -1476,27 +1502,27 @@ gmtsub(struct state const *sp, time_t const *timep, int_fast32_t offset,
return result;
}
-struct tm *
-gmtime(const time_t *const timep)
-{
- return gmtime_r(timep, &tm);
-}
-
/*
* Re-entrant version of gmtime.
*/
struct tm *
-gmtime_r(const time_t *const timep, struct tm *tmp)
+gmtime_r(const time_t *timep, struct tm *tmp)
{
gmtcheck();
return gmtsub(gmtptr, timep, 0, tmp);
}
+struct tm *
+gmtime(const time_t *timep)
+{
+ return gmtime_r(timep, &tm);
+}
+
#ifdef STD_INSPIRED
struct tm *
-offtime(const time_t *const timep, const long offset)
+offtime(const time_t *timep, long offset)
{
gmtcheck();
return gmtsub(gmtptr, timep, offset, &tm);
@@ -1517,9 +1543,8 @@ leaps_thru_end_of(register const int y)
}
static struct tm *
-timesub(const time_t *const timep, const int_fast32_t offset,
- register const struct state *const sp,
- register struct tm *const tmp)
+timesub(const time_t *timep, int_fast32_t offset,
+ const struct state *sp, struct tm *tmp)
{
register const struct lsinfo * lp;
register time_t tdays;
@@ -1556,7 +1581,7 @@ timesub(const time_t *const timep, const int_fast32_t offset,
}
y = EPOCH_YEAR;
tdays = *timep / SECSPERDAY;
- rem = *timep - tdays * SECSPERDAY;
+ rem = *timep % SECSPERDAY;
while (tdays < 0 || tdays >= year_lengths[isleap(y)]) {
int newy;
register time_t tdelta;
@@ -1579,13 +1604,6 @@ timesub(const time_t *const timep, const int_fast32_t offset,
tdays -= leapdays;
y = newy;
}
- {
- register int_fast32_t seconds;
-
- seconds = tdays * SECSPERDAY;
- tdays = seconds / SECSPERDAY;
- rem += seconds - tdays * SECSPERDAY;
- }
/*
** Given the range, we can now fearlessly cast...
*/
@@ -1649,7 +1667,7 @@ timesub(const time_t *const timep, const int_fast32_t offset,
}
char *
-ctime(const time_t *const timep)
+ctime(const time_t *timep)
{
/*
** Section 4.12.3.2 of X3.159-1989 requires that
@@ -1662,7 +1680,7 @@ ctime(const time_t *const timep)
}
char *
-ctime_r(const time_t *const timep, char *buf)
+ctime_r(const time_t *timep, char *buf)
{
struct tm mytm;
struct tm *tmp = localtime_r(timep, &mytm);
@@ -1687,7 +1705,7 @@ ctime_r(const time_t *const timep, char *buf)
*/
static bool
-increment_overflow(int *const ip, int j)
+increment_overflow(int *ip, int j)
{
register int const i = *ip;
@@ -1743,8 +1761,7 @@ normalize_overflow(int *const tensptr, int *const unitsptr, const int base)
}
static bool
-normalize_overflow32(int_fast32_t *const tensptr, int *const unitsptr,
- const int base)
+normalize_overflow32(int_fast32_t *tensptr, int *unitsptr, int base)
{
register int tensdelta;
@@ -2081,7 +2098,7 @@ mktime_z(struct state *sp, struct tm *tmp)
#endif
time_t
-mktime(struct tm *const tmp)
+mktime(struct tm *tmp)
{
time_t t;
int err = lock();
@@ -2098,7 +2115,7 @@ mktime(struct tm *const tmp)
#ifdef STD_INSPIRED
time_t
-timelocal(struct tm *const tmp)
+timelocal(struct tm *tmp)
{
if (tmp != NULL)
tmp->tm_isdst = -1; /* in case it wasn't initialized */
@@ -2106,13 +2123,13 @@ timelocal(struct tm *const tmp)
}
time_t
-timegm(struct tm *const tmp)
+timegm(struct tm *tmp)
{
return timeoff(tmp, 0);
}
time_t
-timeoff(struct tm *const tmp, const long offset)
+timeoff(struct tm *tmp, long offset)
{
if (tmp)
tmp->tm_isdst = 0;
diff --git a/elsie.nci.nih.gov/src/northamerica b/elsie.nci.nih.gov/src/northamerica
index c3af9eb..660a920 100644
--- a/elsie.nci.nih.gov/src/northamerica
+++ b/elsie.nci.nih.gov/src/northamerica
@@ -1235,10 +1235,19 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay
# west Labrador, Nova Scotia, Prince Edward I
-# From Paul Eggert (2006-03-22):
+# From Brian Inglis (2015-07-20):
+# From the historical weather station records available at:
+# https://weatherspark.com/history/28351/1971/Sydney-Nova-Scotia-Canada
+# Sydney shares the same time history as Glace Bay, so was
+# likely to be the same across the island....
+# Sydney, as the capital and most populous location, or Cape Breton, would
+# have been better names for the zone had we known this in 1996.
+
+# From Paul Eggert (2015-07-20):
# Shanks & Pottenger write that since 1970 most of this region has been like
# Halifax. Many locales did not observe peacetime DST until 1972;
-# Glace Bay, NS is the largest that we know of.
+# the Cape Breton area, represented by Glace Bay, is the largest we know of
+# (Glace Bay was perhaps not the best name choice but no point changing now).
# Shanks & Pottenger also write that Liverpool, NS was the only town
# in Canada to observe DST in 1971 but not 1970; for now we'll assume
# this is a typo.
@@ -1796,13 +1805,13 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep
# 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:
+# note 1:
# On Oct 27/1918 when daylight saving ended in the rest of Canada,
# Creston did not change its clocks.
-# note#2:
+# note 2:
# During WWII when the Federal Government legislated a mandatory clock change,
# Creston did not oblige.
-# note#3:
+# 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.
@@ -2661,7 +2670,17 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton
-4:00 US A%sT
# Cayman Is
-# See America/Panama.
+
+# From Paul Eggert (2015-05-15):
+# The Cayman government has decided to introduce DST in 2016, the idea being
+# to keep in sync with New York. The legislation hasn't passed but the change
+# seems quite likely. See: Meade B. Cayman 27.
+# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman
+
+Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
+ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
+ -5:00 - EST 2016
+ -5:00 US E%sT
# Costa Rica
@@ -3184,7 +3203,6 @@ 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/Cayman
# Puerto Rico
# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
diff --git a/elsie.nci.nih.gov/src/private.h b/elsie.nci.nih.gov/src/private.h
index 61cf922..184da8f 100644
--- a/elsie.nci.nih.gov/src/private.h
+++ b/elsie.nci.nih.gov/src/private.h
@@ -19,13 +19,9 @@
/*
** Defaults for preprocessor symbols.
-** You can override these in your C compiler options, e.g. '-DHAVE_ADJTIME=0'.
+** You can override these in your C compiler options, e.g. '-DHAVE_GETTEXT=1'.
*/
-#ifndef HAVE_ADJTIME
-#define HAVE_ADJTIME 1
-#endif /* !defined HAVE_ADJTIME */
-
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif /* !defined HAVE_GETTEXT */
@@ -38,10 +34,6 @@
#define HAVE_LINK 1
#endif /* !defined HAVE_LINK */
-#ifndef HAVE_SETTIMEOFDAY
-#define HAVE_SETTIMEOFDAY 3
-#endif /* !defined HAVE_SETTIMEOFDAY */
-
#ifndef HAVE_STRDUP
#define HAVE_STRDUP 1
#endif
@@ -63,7 +55,7 @@
#endif /* !defined HAVE_UNISTD_H */
#ifndef HAVE_UTMPX_H
-#define HAVE_UTMPX_H 0
+#define HAVE_UTMPX_H 1
#endif /* !defined HAVE_UTMPX_H */
#ifndef NETBSD_INSPIRED
@@ -195,7 +187,7 @@ typedef long long int_fast64_t;
# define INT_FAST64_MIN LLONG_MIN
# define INT_FAST64_MAX LLONG_MAX
# else
-# if (LONG_MAX >> 31) < 0xffffffff
+# if LONG_MAX >> 31 < 0xffffffff
Please use a compiler that supports a 64-bit integer type (or wider);
you may need to compile with "-DHAVE_STDINT_H".
# endif
@@ -247,6 +239,18 @@ typedef long intmax_t;
# endif
#endif
+#ifndef UINT_FAST64_MAX
+# if defined ULLONG_MAX || defined __LONG_LONG_MAX__
+typedef unsigned long long uint_fast64_t;
+# else
+# if ULONG_MAX >> 31 >> 1 < 0xffffffff
+Please use a compiler that supports a 64-bit integer type (or wider);
+you may need to compile with "-DHAVE_STDINT_H".
+# endif
+typedef unsigned long uint_fast64_t;
+# endif
+#endif
+
#ifndef UINTMAX_MAX
# if defined ULLONG_MAX || defined __LONG_LONG_MAX__
typedef unsigned long long uintmax_t;
@@ -472,15 +476,20 @@ time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_PURE;
#define TYPE_SIGNED(type) (((type) -1) < 0)
#endif /* !defined TYPE_SIGNED */
-/* The minimum and maximum finite time values. */
-static time_t const time_t_min =
- (TYPE_SIGNED(time_t)
- ? (time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1)
- : 0);
-static time_t const time_t_max =
- (TYPE_SIGNED(time_t)
- ? - (~ 0 < 0) - ((time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1))
- : -1);
+#define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0)
+
+/* Max and min values of the integer type T, of which only the bottom
+ B bits are used, and where the highest-order used bit is considered
+ to be a sign bit if T is signed. */
+#define MAXVAL(t, b) \
+ ((t) (((t) 1 << ((b) - 1 - TYPE_SIGNED(t))) \
+ - 1 + ((t) 1 << ((b) - 1 - TYPE_SIGNED(t)))))
+#define MINVAL(t, b) \
+ ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))
+
+/* The minimum and maximum finite time values. This assumes no padding. */
+static time_t const time_t_min = MINVAL(time_t, TYPE_BIT(time_t));
+static time_t const time_t_max = MAXVAL(time_t, TYPE_BIT(time_t));
#ifndef INT_STRLEN_MAXIMUM
/*
diff --git a/elsie.nci.nih.gov/src/southamerica b/elsie.nci.nih.gov/src/southamerica
index be63a88..50d118e 100644
--- a/elsie.nci.nih.gov/src/southamerica
+++ b/elsie.nci.nih.gov/src/southamerica
@@ -30,7 +30,7 @@
# I suggest the use of _Summer time_ instead of the more cumbersome
# _daylight-saving time_. _Summer time_ seems to be in general use
# in Europe and South America.
-# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
+# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
# H L Mencken, _The American Language: Supplement I_ (1960), p 466
#
# Earlier editions of these tables also used the North American style
@@ -131,7 +131,7 @@ Rule Arg 2000 only - Mar 3 0:00 0 -
# Timezone Law (which never was effectively applied) will (would?) be
# in effect.... The article is at
# http://ar.clarin.com/diario/2001-06-06/e-01701.htm
-# ... The Law itself is "Ley No 25155", sanctioned on 1999-08-25, enacted
+# ... The Law itself is "Ley No. 25155", sanctioned on 1999-08-25, enacted
# 1999-09-17, and published 1999-09-21. The official publication is at:
# http://www.boletin.jus.gov.ar/BON/Primera/1999/09-Septiembre/21/PDF/BO21-09-99LEG.PDF
# Regretfully, you have to subscribe (and pay) for the on-line version....
@@ -175,15 +175,11 @@ Rule Arg 2000 only - Mar 3 0:00 0 -
# http://www.worldtimezone.com/dst_news/dst_news_argentina03.html
# http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)
-# From Rodrigo Severo (2008-10-06):
-# Here is some info available at a Gentoo bug related to TZ on Argentina's DST:
-# ...
-# ------- Comment #1 from [jmdocile] 2008-10-06 16:28 0000 -------
-# Hi, there is a problem with timezone-data-2008e and maybe with
-# timezone-data-2008f
-# Argentinian law [Number] 25.155 is no longer valid.
+# From Juan Manuel Docile in https://bugs.gentoo.org/240339 (2008-10-07)
+# via Rodrigo Severo:
+# Argentinian law No. 25.155 is no longer valid.
# http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm
-# The new one is law [Number] 26.350
+# The new one is law No. 26.350
# http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm
# So there is no summer time in Argentina for now.
@@ -771,7 +767,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# [ and in a second message (same day): ]
# I found the decree.
#
-# DECRETO No- 7.584, DE 13 DE OUTUBRO DE 2011
+# DECRETO No. 7.584, DE 13 DE OUTUBRO DE 2011
# Link :
# http://www.in.gov.br/visualiza/index.jsp?data=13/10/2011&jornal=1000&pagina=6&totalArquivos=6
@@ -1125,7 +1121,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Conflicts between [1] and [2] were resolved as follows:
#
# - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
-# Boletín Nº 1, Aviso Nº 1 (1910). Go with [2].
+# Boletín No. 1, Aviso No. 1 (1910). Go with [2].
#
# - [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
@@ -1133,7 +1129,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Quinta Normal in Santiago. Go with [2], rounding it to -4:42:46.
#
# - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
-# Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23). Go with [2].
+# Boletín No. 22, Aviso No. 129/1918 (1918-08-23). Go with [2].
#
# - [1] does not give times for transitions; assume they occur
# at midnight mainland time, the current common practice. However,
@@ -1533,7 +1529,7 @@ Rule Para 1997 only - Feb lastSun 0:00 0 -
# (1999-09) reports no date; go with above sources and Gerd Knops (2001-02-27).
Rule Para 1998 2001 - Mar Sun>=1 0:00 0 -
# From Rives McDow (2002-02-28):
-# A decree was issued in Paraguay (no. 16350) on 2002-02-26 that changed the
+# A decree was issued in Paraguay (No. 16350) on 2002-02-26 that changed the
# dst method to be from the first Sunday in September to the first Sunday in
# April.
Rule Para 2002 2004 - Apr Sun>=1 0:00 0 -
@@ -1713,8 +1709,19 @@ Rule Uruguay 2005 only - Oct 9 2:00 1:00 S
Rule Uruguay 2006 only - Mar 12 2:00 0 -
# From Jesper Nørgaard Welen (2006-09-06):
# http://www.presidencia.gub.uy/_web/decretos/2006/09/CM%20210_08%2006%202006_00001.PDF
-Rule Uruguay 2006 max - Oct Sun>=1 2:00 1:00 S
-Rule Uruguay 2007 max - Mar Sun>=8 2:00 0 -
+#
+# From Steffen Thorsen (2015-06-30):
+# ... it looks like they will not be using DST the coming summer:
+# http://www.elobservador.com.uy/gobierno-resolvio-que-no-habra-cambio-horario-verano-n656787
+# http://www.republica.com.uy/este-ano-no-se-modificara-el-huso-horario-en-uruguay/523760/
+# From Paul Eggert (2015-06-30):
+# Apparently restaurateurs complained that DST caused people to go to the beach
+# instead of out to dinner.
+# From Pablo Camargo (2015-07-13):
+# http://archivo.presidencia.gub.uy/sci/decretos/2015/06/cons_min_201.pdf
+# [dated 2015-06-29; repeals Decree 311/006 dated 2006-09-04]
+Rule Uruguay 2006 2014 - Oct Sun>=1 2:00 1:00 S
+Rule Uruguay 2007 2015 - Mar Sun>=8 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
-3:44:44 - MMT 1920 May 1 # Montevideo MT
@@ -1723,6 +1730,10 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
# Venezuela
#
+# From Paul Eggert (2015-07-28):
+# For the 1965 transition see Gaceta Oficial No. 27.619 (1964-12-15), p 205.533
+# http://www.pgr.gob.ve/dmdocuments/1964/27619.pdf
+#
# From John Stainforth (2007-11-28):
# ... the change for Venezuela originally expected for 2007-12-31 has
# been brought forward to 2007-12-09. The official announcement was
@@ -1734,6 +1745,6 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Caracas -4:27:44 - LMT 1890
-4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time?
- -4:30 - VET 1965 # Venezuela Time
+ -4:30 - VET 1965 Jan 1 0:00 # Venezuela T.
-4:00 - VET 2007 Dec 9 3:00
-4:30 - VET
diff --git a/elsie.nci.nih.gov/src/strftime.c b/elsie.nci.nih.gov/src/strftime.c
index 632f395..7c5e516 100644
--- a/elsie.nci.nih.gov/src/strftime.c
+++ b/elsie.nci.nih.gov/src/strftime.c
@@ -117,8 +117,7 @@ strftime_l(char *s, size_t maxsize, char const *format, struct tm const *t,
#endif
size_t
-strftime(char * const s, const size_t maxsize, const char *const format,
- const struct tm *const t)
+strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
{
char * p;
int warn;
@@ -149,8 +148,8 @@ strftime(char * const s, const size_t maxsize, const char *const format,
}
static char *
-_fmt(const char *format, const struct tm *const t, char * pt,
- const char *const ptlim, int *warnp)
+_fmt(const char *format, const struct tm *t, char *pt,
+ const char *ptlim, int *warnp)
{
for ( ; *format; ++format) {
if (*format == '%') {
@@ -562,8 +561,7 @@ label:
}
static char *
-_conv(const int n, const char *const format, char *const pt,
- const char *const ptlim)
+_conv(int n, const char *format, char *pt, const char *ptlim)
{
char buf[INT_STRLEN_MAXIMUM(int) + 1];
@@ -572,7 +570,7 @@ _conv(const int n, const char *const format, char *const pt,
}
static char *
-_add(const char *str, char *pt, const char *const ptlim)
+_add(const char *str, char *pt, const char *ptlim)
{
while (pt < ptlim && (*pt = *str++) != '\0')
++pt;
@@ -589,7 +587,7 @@ _add(const char *str, char *pt, const char *const ptlim)
static char *
_yconv(int a, int b, bool convert_top, bool convert_yy,
- char *pt, const char *const ptlim)
+ char *pt, const char *ptlim)
{
register int lead;
register int trail;
diff --git a/elsie.nci.nih.gov/src/tz-art.htm b/elsie.nci.nih.gov/src/tz-art.htm
index d29ad0c..63b7c09 100644
--- a/elsie.nci.nih.gov/src/tz-art.htm
+++ b/elsie.nci.nih.gov/src/tz-art.htm
@@ -34,7 +34,7 @@ Todd Strait, drums</td></tr>
<tr><td>Notes</td><td>CD notes "additional lyric by Karrin Allyson;
arranged by Russ Long and Karrin Allyson"</td></tr>
<tr><td>ADO Rating</td><td>1 star</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=A1fdovw9ta92k">AMG Rating</a></td><td>4 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/i-didnt-know-about-you-mw0000618657">AMG Rating</a></td><td>4 stars</td></tr>
<tr><td>Penguin Rating</td><td>3.5 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Kevin Mahogany</td></tr>
@@ -49,7 +49,7 @@ Ray Drummond, bass;
Ralph Moore, tenor saxophone;
Lewis Nash, drums</td></tr>
<tr><td>ADO Rating</td><td>1.5 stars</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=Akikbikzjbb19">AMG Rating</a></td><td>3 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/double-rainbow-mw0000620371">AMG Rating</a></td><td>3 stars</td></tr>
<tr><td>Penguin Rating</td><td>3 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Joe Williams</td></tr>
@@ -63,7 +63,7 @@ The Robert Farnon [39 piece] Orchestra</td></tr>
<tr><td>Notes</td><td>This CD is also available as part of a 3-CD package from
Telarc, "Triple Play" (CD-83461)</td></tr>
<tr><td>ADO Rating</td><td>black dot</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=Amyyvad6kt8w1">AMG Rating</a></td><td>2 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/heres-to-life-mw0000623648">AMG Rating</a></td><td>2 stars</td></tr>
<tr><td>Penguin Rating</td><td>3 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Charles Fambrough</td></tr>
@@ -77,10 +77,8 @@ Joel Levine, tenor recorder;
Edward Simon, piano;
Lenny White, drums;
Marion Simon, percussion</td></tr>
-<tr><td>Notes</td><td>On-line information and samples available at
-<a href="http://wwmusic.com/~music/audioq/rel/1033.html">http://wwmusic.com/~music/audioq/rel/1033.html</a></td></tr>
<tr><td>ADO Rating</td><td>2 stars</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=A5rkcikcjbb89">AMG Rating</a></td><td>unrated</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/keeper-of-the-spirit-mw0000176559">AMG Rating</a></td><td>unrated</td></tr>
<tr><td>Penguin Rating</td><td>3 stars</td></tr>
</table>
<hr>
@@ -98,7 +96,7 @@ David Piltch, string bass</td></tr>
<tr><td>Notes</td><td>Lyrical reference to "Eastern Standard Time" in
Tom Waits' "Purple Avenue"</td></tr>
<tr><td>ADO Rating</td><td>2.5 stars</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=A3a9ds37ya3dg">AMG Rating</a></td><td>3 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/blame-it-on-my-youth-mw0000274303">AMG Rating</a></td><td>3 stars</td></tr>
<tr><td>Penguin Rating</td><td>unrated</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Milt Hinton</td></tr>
@@ -125,11 +123,11 @@ Sometimes I'm Happy,
A Hot Time in the Old Town Tonight,
Four or Five Times, Now's the Time,
Time on My Hands, This Time It's Us,
-and Good Time Charlie
-On-line samples available at
-<a href="http://www.chiaroscurojazz.com/albuminfo.php4?albumid=49">http://www.chiaroscurojazz.com/albuminfo.php3?albumid=49</a></td></tr>
+and Good Time Charlie.
+<a href="http://www.chiaroscurojazz.com/album.php?C=310">Album info</a>
+is available.</td></tr>
<tr><td>ADO Rating</td><td>3 stars</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=A1cbyxdab8ola">AMG Rating</a></td><td>4.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/old-man-time-mw0000269353">AMG Rating</a></td><td>4.5 stars</td></tr>
<tr><td>Penguin Rating</td><td>3 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Alan Broadbent</td></tr>
@@ -143,7 +141,7 @@ Putter Smith, Bass;
Frank Gibson, Jr., drums</td></tr>
<tr><td>Notes</td><td>The CD cover features an analemma for equation-of-time fans</td></tr>
<tr><td>ADO Rating</td><td>1 star</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=Asl8zefuk8gfo">AMG Rating</a></td><td>4 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/pacific-standard-time-mw0000645433">AMG Rating</a></td><td>4 stars</td></tr>
<tr><td>Penguin Rating</td><td>3.5 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Anthony Braxton/Richard Teitelbaum</td></tr>
@@ -158,7 +156,7 @@ Leo Smith, trumpet and miscellaneous instruments;
Leroy Jenkins, violin and miscellaneous instruments;
Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
<tr><td>ADO Rating</td><td>black dot</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=A5bkvu3xjan1k">AMG Rating</a></td><td>unrated</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/silence-time-zones-mw0000595735">AMG Rating</a></td><td>4 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Charles Gayle</td></tr>
<tr><td>CD</td><td>Time Zones</td></tr>
@@ -168,7 +166,7 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
<tr><td>Total Time</td><td>49:06</td></tr>
<tr><td>Personnel</td><td>Charles Gayle, piano</td></tr>
<tr><td>ADO Rating</td><td>1 star</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:13rc28vw054a">AMG Rating</a></td><td>4.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/time-zones-mw0000349642">AMG Rating</a></td><td>4.5 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>The Get Up Kids</td></tr>
<tr><td>CD</td><td>Eudora</td></tr>
@@ -177,7 +175,7 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
<tr><td>ID</td><td>357</td></tr>
<tr><td>Total Time</td><td>65:12</td></tr>
<tr><td>Notes</td><td>Includes the song "Central Standard Time." Thanks to Colin Bowern for this information.</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:7ddovwvla9xk">AMG Rating</a></td><td>2.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/eudora-mw0000592063">AMG Rating</a></td><td>2.5 stars</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>Artist</td><td>Coldplay</td></tr>
@@ -195,7 +193,7 @@ line is "Lights go out and I can't be saved".</td></tr>
<tr><td>Artist</td><td>Irving Kahal and Harry Richman</td></tr>
<tr><td>Song</td><td>There Ought to be a Moonlight Saving Time</td></tr>
<tr><td>Copyright Date</td><td>1931</td>
-<tr><td>Notes</td><td>This musical standard was a #1 hit for Guy Lombardo
+<tr><td>Notes</td><td>This musical standard was a No. 1 hit for Guy Lombardo
in 1931, and was also performed by Maurice Chevalier, Blossom Dearie
and many others. The phrase "Moonlight saving time" also appears in
the 1995 country song "Not Enough Hours in the Night" written by Aaron
@@ -210,7 +208,7 @@ Supernaw.</td></tr>
<tr><td>ID</td><td>272</td></tr>
<tr><td>Total Time</td><td>73:05</td></tr>
<tr><td>Notes</td><td>Includes the song "Twilight Time Zone."</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:w9fpxzykldje">AMG Rating</a></td><td>3.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/lobster-leaps-in-mw0000794929">AMG Rating</a></td><td>3.5 stars</td></tr>
<tr><td>ADO Rating</td><td>2 stars</td></tr>
<tr><td>&nbsp;</td></tr>
@@ -221,7 +219,7 @@ Supernaw.</td></tr>
<tr><td>Label</td><td>Columbia</td></tr>
<tr><td>ID</td><td>CK-8905</td></tr>
<tr><td>Total Time</td><td>45:36</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:gifqxqt5ld0e">AMG Rating</a></td><td>4.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/the-times-they-a-changin-mw0000202344">AMG Rating</a></td><td>4.5 stars</td></tr>
<tr><td>ADO Rating</td><td>1.5 stars</td></tr>
<tr><td>Notes<td>The title song is also available on "Bob Dylan's Greatest Hits" and "The Essential Bob Dylan."</td></tr>
<tr><td>&nbsp;</td></tr>
@@ -232,7 +230,7 @@ Supernaw.</td></tr>
<tr><td>Label</td><td>Universal Jazz France</td></tr>
<tr><td>ID</td><td>B0012688-02</td></tr>
<tr><td>Total Time</td><td>42:31</td></tr>
-<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:3bftxzw0ldhe">AMG Rating</a></td><td>3.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/tide-mw0000815692">AMG Rating</a></td><td>3.5 stars</td></tr>
<tr><td>ADO Rating</td><td>2.5 stars</td></tr>
<tr><td>Notes<td>Includes the song "Fire and Wood" with the lyric
"The clocks were turned back you remember/Think it's still November."
@@ -245,7 +243,7 @@ Supernaw.</td></tr>
<tr><td>ID</td><td>B0005171-02</td></tr>
<tr><td>Total Time</td><td>156:22</td></tr>
<tr><td>ADO Rating</td><td>1 star</td></tr>
-<tr><td><a href="http://www.allmusic.com/album/youre-getting-better-the-word-jazz-dot-masters+r105931">AMG Rating</a></td><td>4.5 stars</td></tr>
+<tr><td><a href="http://www.allmusic.com/album/youre-getting-better-the-word-jazz-dot-masters-mw0000736197">AMG Rating</a></td><td>4.5 stars</td></tr>
<tr><td>Notes</td><td>Includes the piece "What Time Is It"
("He knew what time it was everywhere...that counted").</td></tr>
<tr><td>&nbsp;</td></tr>
@@ -491,6 +489,13 @@ or are you just trying to dazzle me with your command of time zones?"
entitled "The Kid," originally aired 1997-11-04)
</li>
<li>
+"I put myself and my staff through this crazy, huge ordeal, all because
+I refused to go on at midnight, okay? And so I work, you know, and
+then I get this job at eleven, supposed to be a big deal. Then
+yesterday daylight [saving] time ended. Right now it's basically
+midnight." (Conan O'Brien on the 2010-11-08 premiere of <em>Conan</em>.)
+</li>
+<li>
Peppermint Patty: "What if the world comes to an end tonight, Marcie?"
<br>
Marcie: "I promise there'll be a tomorrow, sir ... in fact,
@@ -498,13 +503,6 @@ it's already tomorrow in Australia!"
<br>
(Charles M. Schulz, <em>Peanuts</em>, 1980-06-13)
</li>
-<li>
-"I put myself and my staff through this crazy, huge ordeal, all because
-I refused to go on at midnight, okay? And so I work, you know, and
-then I get this job at eleven, supposed to be a big deal. Then
-yesterday daylight [saving] time ended. Right now it's basically
-midnight." (Conan O'Brien on the 2010-11-08 premiere of <em>Conan</em>.)
-</li>
</ul>
</body>
</html>
diff --git a/elsie.nci.nih.gov/src/tz-link.htm b/elsie.nci.nih.gov/src/tz-link.htm
index 242be84..cc44768 100644
--- a/elsie.nci.nih.gov/src/tz-link.htm
+++ b/elsie.nci.nih.gov/src/tz-link.htm
@@ -8,7 +8,7 @@
<meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
<meta name="DC.Creator" content="Eggert, Paul">
<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2015-03-25">
+<meta name="DC.Date" content="2015-08-10">
<meta name="DC.Description"
content="Sources of information about time zones and daylight saving time">
<meta name="DC.Identifier"
@@ -20,14 +20,14 @@
<h1>Sources for Time Zone and Daylight Saving Time Data</h1>
<h2>The <code><abbr title="time zone">tz</abbr></code> database</h2>
<p>
-The <a href="http://en.wikipedia.org/wiki/Public_domain">public-domain</a>
+The <a href="https://en.wikipedia.org/wiki/Public_domain">public-domain</a>
time zone database contains code and data
that represent the history of local time
for many representative locations around the globe.
It is updated periodically to reflect changes made by political bodies
-to <a href="http://en.wikipedia.org/wiki/Time_zone">time zone</a>
+to <a href="https://en.wikipedia.org/wiki/Time_zone">time zone</a>
boundaries and
-<a href="http://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a>
+<a href="https://en.wikipedia.org/wiki/Daylight_saving_time">daylight-saving</a>
rules.
This database (often called <code>zoneinfo</code> or
<code><abbr>tz</abbr></code>)
@@ -36,27 +36,27 @@ including
<a href="http://www.gnu.org/software/libc/">the
<abbr title="GNU's Not Unix">GNU</abbr>
C Library</a> (used in
-<a href="http://en.wikipedia.org/wiki/Linux"><abbr>GNU</abbr>/Linux</a>),
+<a href="https://en.wikipedia.org/wiki/Linux"><abbr>GNU</abbr>/Linux</a>),
<a href="http://www.android.com">Android</a>,
<a href="https://developer.mozilla.org/en-US/Firefox_OS">Firefox
<abbr title="Operating System">OS</abbr></a>,
<a href="https://www.freebsd.org">Free<abbr
title="Berkeley Software Distribution">BSD</abbr></a>,
<a href="http://netbsd.org">Net<abbr>BSD</abbr></a>,
-<a href="http://openbsd.org">Open<abbr>BSD</abbr></a>,
+<a href="http://www.openbsd.org">Open<abbr>BSD</abbr></a>,
<a href="https://cygwin.com">Cygwin</a>,
<a href="http://www.delorie.com/djgpp/"><abbr
title="DJ's GNU Programming Platform">DJGPP</abbr></a>,
-<a href="http://en.wikipedia.org/wiki/MINIX">MINIX</a>,
-<a href="http://en.wikipedia.org/wiki/WebOS"><abbr
+<a href="https://en.wikipedia.org/wiki/MINIX">MINIX</a>,
+<a href="https://en.wikipedia.org/wiki/WebOS"><abbr
title="Web Operating System">webOS</abbr></a>,
<a href="http://ibm.com/aix"><abbr
title="Advanced Interactive eXecutive">AIX</abbr></a>,
-<a href="http://en.wikipedia.org/wiki/BlackBerry_10">BlackBerry 10</a>,
+<a href="https://en.wikipedia.org/wiki/BlackBerry_10">BlackBerry 10</a>,
<a href="http://www.apple.com/ios/"><abbr
title="iPhone OS">iOS</abbr></a>,
<a href="http://windows.microsoft.com">Microsoft Windows</a>,
-<a href="http://h71000.www7.hp.com">Open<abbr
+<a href="http://www8.hp.com/us/en/products/servers/openvms/overview.html">Open<abbr
title="Virtual Memory System">VMS</abbr></a>,
<a href="https://www.oracle.com/database/index.html">Oracle Database</a>,
<a href="http://oracle.com/solaris">Oracle Solaris</a>, and
@@ -78,19 +78,19 @@ and other entries represent smaller regions like Starke County,
Indiana, which switched from central to eastern time in 1991
and switched back in 2006.
To use the database on an extended <a
-href="http://en.wikipedia.org/wiki/POSIX"><abbr
+href="https://en.wikipedia.org/wiki/POSIX"><abbr
title="Portable Operating System Interface">POSIX</abbr></a>
implementation set the <code><abbr>TZ</abbr></code>
environment variable to the location's full name,
e.g., <code><abbr>TZ</abbr>="America/New_York"</code>.</p>
<p>
Associated with each region is a history of offsets from
-<a href="http://en.wikipedia.org/wiki/Universal_Time">Universal
+<a href="https://en.wikipedia.org/wiki/Universal_Time">Universal
Time</a> (<abbr>UT</abbr>), which is <a
-href="http://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean
+href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean
Time</a> (<abbr>GMT</abbr>) with days beginning at midnight;
for time stamps after 1960 this is more precisely <a
-href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated
+href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated
Universal Time</a> (<abbr>UTC</abbr>).
The database also records when daylight saving time was in use,
along with alphabetic time zone abbreviations such as <abbr>EST</abbr>
@@ -113,7 +113,7 @@ code</a> and
<a href="ftp://ftp.iana.org/tz/tzdata-latest.tar.gz">latest data</a> revisions
are also available.
The following <a
-href="http://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
+href="https://en.wikipedia.org/wiki/Unix_shell">shell</a> commands download
these files to a <abbr>GNU</abbr>/Linux or similar host;
see the downloaded
<code>README</code> file for what to do next.</p>
@@ -158,9 +158,9 @@ Here are some links that may be of interest.
<h2>Commentary on the <code><abbr>tz</abbr></code> database</h2>
<ul>
<li>The article
-<a href="http://en.wikipedia.org/wiki/Tz_database">tz database</a> is
+<a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a> is
an encyclopedic summary.</li>
-<li><a href="http://www.cstdbill.com/tzdb/tz-how-to.html">How to Read the
+<li><a href="https://web.archive.org/web/20140221080916/http://www.cstdbill.com/tzdb/tz-how-to.html">How to Read the
tz Database Source Files</a> explains the <code><abbr>tz</abbr></code>
database format.</li>
<li><a
@@ -186,11 +186,8 @@ Converter</a>
uses a pulldown menu.</li>
<li><a href="http://home.kpn.nl/vanadovv/time/TZworld.html">Complete
timezone information for all countries</a> displays tables of DST rules.
-<li><a href="http://timeanddate.com/worldclock/">The World Clock &ndash;
+<li><a href="http://www.timeanddate.com/worldclock/">The World Clock &ndash;
Time Zones</a> lets you sort zone names and convert times.</li>
-<li><a href="http://permatime.com">Permatime</a> generates and views
-links that refer to a particular point in time and can be displayed in
-multiple time zones.</li>
<li><a href="http://www.zeitverschiebung.net/en/">Time Difference</a>
calculates the current time difference between locations.</li>
<li><a href="http://www.wx-now.com">Weather Now</a> lists the weather too.</li>
@@ -251,7 +248,7 @@ data</a> converted from <code><abbr>tz</abbr></code>.</li>
<h2>Other <code><abbr>tz</abbr></code> compilers</h2>
<ul>
<li><a href="http://sourceforge.net/projects/vzic/">Vzic</a> is a <a
-href="http://en.wikipedia.org/wiki/C_%28programming_language%29">C</a>
+href="https://en.wikipedia.org/wiki/C_%28programming_language%29">C</a>
program that compiles
<code><abbr>tz</abbr></code> source into iCalendar-compatible VTIMEZONE files.
Vzic is freely
@@ -259,9 +256,9 @@ available under the <a
href="http://www.gnu.org/copyleft/gpl.html"><abbr>GNU</abbr>
General Public License (<abbr
title="General Public License">GPL</abbr>)</a>.</li>
-<li><a href="http://sourceforge.net/projects/tzical">tziCal &ndash; tz
+<li><a href="http://sourceforge.net/projects/tzical/">tziCal &ndash; tz
database conversion utility</a> is like Vzic, except for the <a
-href="http://msdn.microsoft.com/netframework">.NET framework</a>
+href="https://msdn.microsoft.com/netframework">.NET framework</a>
and with a <abbr>BSD</abbr>-style license.</li>
<li><a
href="http://search.cpan.org/dist/DateTime-TimeZone/">DateTime::TimeZone</a>
@@ -273,9 +270,15 @@ available under both the <abbr>GPL</abbr> and the Perl Artistic
License. DateTime::TimeZone also contains a script
<code>tests_from_zdump</code> that generates test cases for each clock
transition in the <code><abbr>tz</abbr></code> database.</li>
-<li><a href="http://icu-project.org">International Components for
+<li>The <a href="http://howardhinnant.github.io/tz.html">Time Zone
+Database Parser</a> is a
+<a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a> parser and
+runtime library. It is freely available under the
+<a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons
+Attribution 4.0 International Public License</a>.</li>
+<li><a href="http://site.icu-project.org">International Components for
Unicode (<abbr>ICU</abbr>)</a> contains C/C++ and <a
-href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>
+href="https://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>
libraries for internationalization that
has a compiler from <code><abbr>tz</abbr></code> source
and from <abbr title="Common Locale Data Repository">CLDR</abbr> data
@@ -299,7 +302,7 @@ are similar to Joda Time, but for the .NET framework instead of
Java. They are freely available under the
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a>
and a <abbr>BSD</abbr>-style license, respectively.</li>
-<li><a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>-based
+<li><a href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a>-based
compilers and libraries include:
<ul>
<li><a href="http://momentjs.com/timezone/">Moment Timezone</a> is a
@@ -321,11 +324,11 @@ It is freely available under a <abbr>BSD</abbr>-style license.</li>
<li><a href="http://tzinfo.github.io">TZInfo &ndash;
Ruby Timezone Library</a>
compiles <code><abbr>tz</abbr></code> source into
-<a href="http://www.ruby-lang.org/en/">Ruby</a>.
+<a href="https://www.ruby-lang.org/en/">Ruby</a>.
It is freely available under the <abbr>MIT</abbr> license.</li>
<li>The <a href="http://www.squeaksource.com/Chronos/">Chronos Date/Time
Library</a> is
-a <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> class
+a <a href="https://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> class
library that compiles <code><abbr>tz</abbr></code> source into a time
zone repository whose format
is either proprietary or an <abbr>XML</abbr>-encoded
@@ -348,7 +351,7 @@ This library is freely available under the
<abbr>GNU</abbr> Lesser General Public License
(<abbr title="Lesser General Public License">LGPL</abbr>)</a>,
and is widely used in <abbr>GNU</abbr>/Linux systems.</li>
-<li><a href="http://www.gnome.org">GNOME</a>'s Glib has
+<li><a href="https://www.gnome.org">GNOME</a>'s Glib has
a <code><abbr>tz</abbr></code> binary file reader written in C that
creates a <code>GTimeZone</code> object representing sets
of <abbr>UT</abbr> offsets.
@@ -382,7 +385,7 @@ available under a BSD-style license.</li>
<h2>Other <code><abbr>tz</abbr></code>-based time zone software</h2>
<ul>
<li><a href="https://foxclocks.org">FoxClocks</a>
-is an extension for <a href="http://google.com/chrome/">Google
+is an extension for <a href="http://www.google.com/chrome/">Google
Chrome</a> and for <a
href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Toolkit_API">Mozilla
Toolkit</a> applications like <a
@@ -403,15 +406,15 @@ under the <abbr>GPL</abbr>.</li>
<li>Microsoft Windows 8.1
and later has <code><abbr>tz</abbr></code> data and <abbr>CLDR</abbr>
data (mentioned below) used by
-<a href="http://en.wikipedia.org/wiki/Windows_Runtime">Windows Runtime</a>
+<a href="https://en.wikipedia.org/wiki/Windows_Runtime">Windows Runtime</a>
classes such as <a
-href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.globalization.datetimeformatting.datetimeformatter.aspx"><code>DateTimeFormatter</code></a>.
+href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.globalization.datetimeformatting.datetimeformatter.aspx"><code>DateTimeFormatter</code></a>.
<a
href="http://blogs.msdn.com/b/bclteam/archive/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free.aspx">Exploring
Windows Time Zones with <code>System.TimeZoneInfo</code></a> describes
the older, proprietary method of Microsoft Windows 2000 and later,
which stores time zone data in the
-<a href="http://en.wikipedia.org/wiki/Windows_Registry">Windows Registry</a>. The
+<a href="https://en.wikipedia.org/wiki/Windows_Registry">Windows Registry</a>. The
<a
href="http://www.unicode.org/cldr/charts/latest/supplemental/zone_tzid.html">Zone &rarr;
Tzid table</a> or <a
@@ -451,10 +454,10 @@ href="http://astrocom.com">Astro Computing Services</a>.
These atlases are extensive but unreliable, as Shanks appears to have
guessed many <abbr>UT</abbr> offsets and transitions. The atlases cite no
sources and do not indicate which entries are guesswork.</li>
-<li><a href="http://en.wikipedia.org/wiki/HP-UX">HP-UX</a> has a database in
+<li><a href="https://en.wikipedia.org/wiki/HP-UX">HP-UX</a> has a database in
its own <code>tztab</code>(4) format.</li>
<li>Microsoft Windows has proprietary data mentioned above.</li>
-<li><a href="http://worldtimeserver.com">World Time Server</a>
+<li><a href="http://www.worldtimeserver.com">World Time Server</a>
is another time zone database.</li>
<li><a href="http://tycho.usno.navy.mil/tzones.html">World Time Zones</a>
contains data from the Time Service Department of the
@@ -479,13 +482,14 @@ recent editions.
The pictorial quality is good,
but the maps do not indicate summer time,
and parts of the data are a few years out of date.</li>
-<li><a href="http://worldtimezone.com">Current time around the world
+<li><a href="http://www.worldtimezone.com">Current time around the world
and standard time zones map of the world</a>
has several fancy time zone maps; it covers Russia particularly well.
The maps' pictorial quality is not quite as good as the
<abbr>CIA</abbr>'s
but the maps are more up to date.</li>
-<li><a href="http://poisson.phc.unipi.it/~maggiolo/index.php/2014/01/how-much-is-time-wrong-around-the-world/">How
+<li><a
+href="http://blog.poormansmath.net/how-much-is-time-wrong-around-the-world/">How
much is time wrong around the world?</a> maps the difference between
mean solar and standard time, highlighting areas such as western China
where the two differ greatly. It's a bit out of date, unfortunately.</li>
@@ -494,7 +498,7 @@ where the two differ greatly. It's a bit out of date, unfortunately.</li>
<ul>
<li><a href="http://efele.net/maps/tz/"><abbr>TZ</abbr> timezones
maps</a> contains <a
-href="http://en.wikipedia.org/wiki/Shapefile">shapefiles</a> of
+href="https://en.wikipedia.org/wiki/Shapefile">shapefiles</a> of
sets of <code><abbr>tz</abbr></code> regions.</li>
<li>The <a href="https://github.com/bradfitz/latlong">latlong package</a>
maps geographical coordinates to a <code><abbr>tz</abbr></code> region.
@@ -517,7 +521,7 @@ world time zone boundaries distributed under the
href="http://spatialnews.geocomm.com/features/timezones/">International
Time Zones and Time Zone Data</a>.</li>
<li>A ship within the <a
-href="http://en.wikipedia.org/wiki/Territorial_waters">territorial
+href="https://en.wikipedia.org/wiki/Territorial_waters">territorial
waters</a> of any nation uses that nation's time. In international
waters, time zone boundaries are meridians 15&deg; apart, except that
<abbr>UTC</abbr>&minus;12 and <abbr>UTC</abbr>+12 are each 7.5&deg;
@@ -543,11 +547,6 @@ Saving Energy</a> discusses a primary justification for <abbr>DST</abbr>.</li>
<li><a href="http://seizethedaylight.com/dst/">A Brief
History of Daylight Saving Time</a> summarizes some of the contentious
history of <abbr>DST</abbr>.</li>
-<li><a href="http://toi.inrim.it/uk/toi.html">The
-Time of Internet</a>
-describes time zones and daylight saving time,
-with diagrams.
-The time zone map is out of date, however.</li>
<li><a href="http://www.staff.science.uu.nl/~gent0113/idl/idl.htm">A History of
the International Date Line</a> tells the story of the most important
time zone boundary.</li>
@@ -619,6 +618,10 @@ with perhaps the best-documented history of clock adjustments.
The National Physical Laboratory also maintains an <a
href="http://www.npl.co.uk/educate-explore/what-is-time/archive-of-summer-time-dates-1916-2006">Archive
of Summer time dates</a>.</dd>
+<dt>United States</dt>
+<dd>The Department of Transportation's <a
+href="http://www.transportation.gov/regulations/recent-time-zone-proceedings">Recent
+Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
</dl>
<h2>Precision timekeeping</h2>
<ul>
@@ -640,7 +643,7 @@ href="http://tools.ietf.org/html/rfc4833">Timezone
Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a>
(Internet <abbr>RFC</abbr> 4833)
specifies a <a
-href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol"><abbr>DHCP</abbr></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="http://gauss.gge.unb.ca/GMT.UT.and.the.RGO.html">A Few Facts
@@ -661,7 +664,7 @@ title="International Astronomical Union">IAU</abbr></a>'s <a
href="http://www.iausofa.org"><abbr
title="Standards Of Fundamental Astronomy">SOFA</abbr></a>
collection contains C and <a
-href="http://en.wikipedia.org/wiki/Fortran">Fortran</a>
+href="https://en.wikipedia.org/wiki/Fortran">Fortran</a>
code for converting among time scales like
<abbr title="International Atomic Time">TAI</abbr>,
<abbr>TDB</abbr>, <abbr>TDT</abbr> and
@@ -773,13 +776,9 @@ any future changes to the rules. One should never set
local time is nine hours ahead of <abbr>UTC</abbr> and the time zone
is called "<abbr>GMT</abbr>".</li>
</ul>
-<h2>Related indexes</h2>
+<h2>See also</h2>
<ul>
<li><a href="tz-art.htm">Time and the Arts</a></li>
-<li><a href="http://www.dmoz.org/Reference/Time/">Open Directory &ndash;
-Reference: Time</a></li>
-<li><a href="https://dir.yahoo.com/science/measurements_and_units/time">Yahoo!
-Directory &gt; Science &gt; Measurements and Units &gt; Time</a></li>
</ul>
<hr>
<address>
diff --git a/elsie.nci.nih.gov/src/tzselect.ksh b/elsie.nci.nih.gov/src/tzselect.ksh
index 3acdebd..2c3b2f4 100644
--- a/elsie.nci.nih.gov/src/tzselect.ksh
+++ b/elsie.nci.nih.gov/src/tzselect.ksh
@@ -37,10 +37,16 @@ REPORT_BUGS_TO=tz@iana.org
: ${AWK=awk}
: ${TZDIR=`pwd`}
+# Output one argument as-is to standard output.
+# Safer than 'echo', which can mishandle '\' or leading '-'.
+say() {
+ printf '%s\n' "$1"
+}
+
# Check for awk Posix compliance.
($AWK -v x=y 'BEGIN { exit 123 }') </dev/null >/dev/null 2>&1
[ $? = 123 ] || {
- echo >&2 "$0: Sorry, your '$AWK' program is not Posix compatible."
+ say >&2 "$0: Sorry, your '$AWK' program is not Posix compatible."
exit 1
}
@@ -154,16 +160,16 @@ do
-version)
exec echo "tzselect $PKGVERSION$TZVERSION" ;;
-*)
- echo >&2 "$0: -$opt$OPTARG: unknown option; try '$0 --help'"; exit 1 ;;
+ say >&2 "$0: -$opt$OPTARG: unknown option; try '$0 --help'"; exit 1 ;;
*)
- echo >&2 "$0: try '$0 --help'"; exit 1 ;;
+ say >&2 "$0: try '$0 --help'"; exit 1 ;;
esac
done
shift `expr $OPTIND - 1`
case $# in
0) ;;
-*) echo >&2 "$0: $1: unknown argument"; exit 1 ;;
+*) say >&2 "$0: $1: unknown argument"; exit 1 ;;
esac
# Make sure the tables are readable.
@@ -172,11 +178,26 @@ TZ_ZONE_TABLE=$TZDIR/$zonetabtype.tab
for f in $TZ_COUNTRY_TABLE $TZ_ZONE_TABLE
do
<"$f" || {
- echo >&2 "$0: time zone files are not set up correctly"
+ say >&2 "$0: time zone files are not set up correctly"
exit 1
}
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 }' &&
+ { tmp=`(mktemp -d) 2>/dev/null` || {
+ tmp=${TMPDIR-/tmp}/tzselect.$$ &&
+ (umask 77 && mkdir -- "$tmp")
+ };} &&
+ trap 'status=$?; rm -fr -- "$tmp"; exit $status' 0 HUP INT PIPE TERM &&
+ (iconv -f UTF-8 -t //TRANSLIT <"$TZ_COUNTRY_TABLE" >$tmp/iso3166.tab) \
+ 2>/dev/null &&
+ 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='
'
IFS=$newline
@@ -336,8 +357,7 @@ while
exit 0
}'
do
- echo >&2 "'$TZ' is not a conforming" \
- 'Posix time zone string.'
+ say >&2 "'$TZ' is not a conforming Posix time zone string."
done
TZ_for_date=$TZ;;
*)
@@ -359,7 +379,7 @@ while
sort -n |
sed "${location_limit}q"
`
- regions=`echo "$distance_table" | $AWK '
+ regions=`say "$distance_table" | $AWK '
BEGIN { FS = "\t" }
{ print $NF }
'`
@@ -369,7 +389,7 @@ while
"of distance from $coord".
doselect $regions
region=$select_result
- TZ=`echo "$distance_table" | $AWK -v region="$region" '
+ TZ=`say "$distance_table" | $AWK -v region="$region" '
BEGIN { FS="\t" }
$NF == region { print $4 }
'`
@@ -429,6 +449,7 @@ while
}
}
}
+ /^#/ { next }
$1 ~ cc { print $4 }
' <"$TZ_ZONE_TABLE"`
@@ -460,6 +481,7 @@ while
}
}
}
+ /^#/ { next }
$1 ~ cc && $4 == region { print $3 }
' <"$TZ_ZONE_TABLE"`
esac
@@ -467,7 +489,7 @@ while
# Make sure the corresponding zoneinfo file exists.
TZ_for_date=$TZDIR/$TZ
<"$TZ_for_date" || {
- echo >&2 "$0: time zone files are not set up correctly"
+ say >&2 "$0: time zone files are not set up correctly"
exit 1
}
esac
@@ -500,15 +522,15 @@ Universal Time is now: $UTdate."
echo >&2 "The following information has been given:"
echo >&2 ""
case $country%$region%$coord in
- ?*%?*%) echo >&2 " $country$newline $region";;
- ?*%%) echo >&2 " $country";;
- %?*%?*) echo >&2 " coord $coord$newline $region";;
- %%?*) echo >&2 " coord $coord";;
- *) echo >&2 " TZ='$TZ'"
+ ?*%?*%) say >&2 " $country$newline $region";;
+ ?*%%) say >&2 " $country";;
+ %?*%?*) say >&2 " coord $coord$newline $region";;
+ %%?*) say >&2 " coord $coord";;
+ *) say >&2 " TZ='$TZ'"
esac
- echo >&2 ""
- echo >&2 "Therefore TZ='$TZ' will be used.$extra_info"
- echo >&2 "Is the above information OK?"
+ say >&2 ""
+ say >&2 "Therefore TZ='$TZ' will be used.$extra_info"
+ say >&2 "Is the above information OK?"
doselect Yes No
ok=$select_result
@@ -523,7 +545,7 @@ case $SHELL in
*) file=.profile line="TZ='$TZ'; export TZ"
esac
-echo >&2 "
+say >&2 "
You can make this change permanent for yourself by appending the line
$line
to the file '$file' in your home directory; then log out and log in again.
@@ -531,4 +553,4 @@ to the file '$file' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the $0 command in shell scripts:"
-echo "$TZ"
+say "$TZ"
diff --git a/elsie.nci.nih.gov/src/zdump.c b/elsie.nci.nih.gov/src/zdump.c
index 13bbb0e..063a263 100644
--- a/elsie.nci.nih.gov/src/zdump.c
+++ b/elsie.nci.nih.gov/src/zdump.c
@@ -246,13 +246,15 @@ extern int optind;
extern char * tzname[2];
/* The minimum and maximum finite time values. */
+enum { atime_shift = CHAR_BIT * sizeof (time_t) - 2 };
static time_t const absolute_min_time =
((time_t) -1 < 0
- ? (time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1)
+ ? (- ((time_t) ~ (time_t) 0 < 0)
+ - (((time_t) 1 << atime_shift) - 1 + ((time_t) 1 << atime_shift)))
: 0);
static time_t const absolute_max_time =
((time_t) -1 < 0
- ? - (~ 0 < 0) - ((time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1))
+ ? (((time_t) 1 << atime_shift) - 1 + ((time_t) 1 << atime_shift))
: -1);
static int longest;
static char * progname;
@@ -267,6 +269,9 @@ static void show(timezone_t, char *, time_t, bool);
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 A an alphabetic character in the C locale? */
static bool
is_alpha(char a)
@@ -483,25 +488,16 @@ abbrok(const char *const abbrp, const char *const zone)
if (warned)
return;
cp = abbrp;
- wp = NULL;
- while (is_alpha(*cp))
+ while (is_alpha(*cp) || is_digit(*cp) || *cp == '-' || *cp == '+')
++cp;
- if (cp - abbrp == 0)
- wp = _("lacks alphabetic at start");
- else if (cp - abbrp < 3)
- wp = _("has fewer than 3 alphabetics");
+ if (cp - abbrp < 3)
+ wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
- wp = _("has more than 6 alphabetics");
- if (wp == NULL && (*cp == '+' || *cp == '-')) {
- ++cp;
- if ('0' <= *cp && *cp <= '9')
- if (*cp++ == '1' && '0' <= *cp && *cp <= '4')
- cp++;
- if (*cp != '\0')
- wp = _("differs from POSIX standard");
- }
- if (wp == NULL)
- return;
+ wp = _("has more than 6 characters");
+ else if (*cp)
+ wp = _("has characters other than ASCII alphanumerics, '-' or '+'");
+ else
+ return;
fflush(stdout);
fprintf(stderr,
_("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"),
@@ -744,7 +740,7 @@ main(int argc, char *argv[])
}
static time_t
-yeartot(const intmax_t y)
+yeartot(intmax_t y)
{
register intmax_t myy, seconds, years;
register time_t t;
diff --git a/elsie.nci.nih.gov/src/zic.8 b/elsie.nci.nih.gov/src/zic.8
index fac2da7..94b6753 100644
--- a/elsie.nci.nih.gov/src/zic.8
+++ b/elsie.nci.nih.gov/src/zic.8
@@ -119,13 +119,6 @@ or that starts with
Limit time values stored in output files to values that are the same
whether they're taken to be signed or unsigned.
You can use this option to generate SVVS-compatible files.
-.TP
-.BI "\*-y " command
-Use the given
-.I command
-rather than
-.B yearistype
-when checking year types (see below).
.PP
Input files should be text files, that is, they should be a series of
zero or more lines, each ending in a newline byte and containing at
@@ -203,27 +196,11 @@ may be used to repeat the value of the
field.
.TP
.B TYPE
-Gives the type of year in which the rule applies.
-If
-.B TYPE
-is
+should be
.q \*-
-then the rule applies in all years between
-.B FROM
-and
-.B TO
-inclusive.
-If
-.B TYPE
-is something else, then
+and is present for compatibility with older versions of
.I zic
-executes the command
-.ti +.5i
-\fByearistype\fP \fIyear\fP \fItype\fP
-.br
-to check the type of a year:
-an exit status of zero is taken to mean that the year is of the given type;
-an exit status of one is taken to mean that the year is not of the given type.
+in which it could contain year types.
.TP
.B IN
Names the month in which the rule takes effect.
@@ -299,6 +276,12 @@ field
and
.B s
suffixes are not used).
+Only the sum of standard time and this amount matters; for example,
+.I zic
+does not distinguish a 10:30 standard time plus an 0:30
+.B SAVE
+from a 10:00 standard time plus a 1:00
+.BR SAVE .
.TP
.B LETTER/S
Gives the
@@ -357,6 +340,8 @@ alternately, an amount of time to add to local standard time.
If this field is
.B \*-
then standard time always applies in the time zone.
+When an amount of time is given, only the sum of standard time and
+this amount matters.
.TP
.B FORMAT
The format for time zone abbreviations in this time zone.
@@ -365,16 +350,32 @@ The pair of characters
is used to show where the
.q "variable part"
of the time zone abbreviation goes.
+Alternately, a format can use the pair of characters
+.B %z
+to stand for the UTC offset in the form
+.RI \(+- hh ,
+.RI \(+- hhmm ,
+or
+.RI \(+- hhmmss ,
+using the shortest form that does not lose information, where
+.IR hh ,
+.IR mm ,
+and
+.I ss
+are the hours, minutes, and seconds east (+) or west (\(mi) of UTC.
Alternately,
a slash (/)
separates standard and daylight abbreviations.
+To conform to POSIX, a time zone abbreviation should contain only
+alphanumeric ASCII characters, "+" and "\*-".
.TP
.B UNTILYEAR [MONTH [DAY [TIME]]]
The time at which the UT offset or the rule(s) change for a location.
It is specified as a year, a month, a day, and a time of day.
If this is specified,
the time zone information is generated from the given UT offset
-and rule change until the time specified.
+and rule change until the time specified, which is interpreted using
+the rules in effect just before the transition.
The month, day, and time of day have the same format as the IN, ON, and AT
fields of a rule; trailing fields can be omitted, and default to the
earliest possible value for the missing fields.
@@ -393,6 +394,11 @@ Continuation lines may contain
information, just as zone lines do, indicating that the next line is a further
continuation.
.PP
+If a zone changes at the same instant that a rule would otherwise take
+effect in the earlier zone or continuation line, the rule is ignored.
+In a single zone it is an error if two rules take effect at the same
+instant, or if two zone changes take effect at the same instant.
+.PP
A link line has the form
.sp
.nf
diff --git a/elsie.nci.nih.gov/src/zic.8.txt b/elsie.nci.nih.gov/src/zic.8.txt
index 2417a6e..a0e185a 100644
--- a/elsie.nci.nih.gov/src/zic.8.txt
+++ b/elsie.nci.nih.gov/src/zic.8.txt
@@ -75,10 +75,6 @@ DESCRIPTION
same whether they're taken to be signed or unsigned. You can
use this option to generate SVVS-compatible files.
- -y command
- Use the given command rather than yearistype when checking year
- types (see below).
-
Input files should be text files, that is, they should be a series of
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
@@ -134,14 +130,8 @@ DESCRIPTION
abbreviation) may be used to repeat the value of the FROM
field.
- TYPE Gives the type of year in which the rule applies. If TYPE is
- "-" then the rule applies in all years between FROM and TO
- inclusive. If TYPE is something else, then zic executes the
- command
- yearistype year type
- to check the type of a year: an exit status of zero is taken to
- mean that the year is of the given type; an exit status of one
- is taken to mean that the year is not of the given type.
+ TYPE should be "-" and is present for compatibility with older
+ versions of zic in which it could contain year types.
IN Names the month in which the rule takes effect. Month names
may be abbreviated.
@@ -180,7 +170,9 @@ DESCRIPTION
SAVE Gives the amount of time to be added to local standard time
when the rule is in effect. This field has the same format as
the AT field (although, of course, the w and s suffixes are not
- used).
+ used). Only the sum of standard time and this amount matters;
+ for example, zic does not distinguish a 10:30 standard time
+ plus an 0:30 SAVE from a 10:00 standard time plus a 1:00 SAVE.
LETTER/S
Gives the "variable part" (for example, the "S" or "D" in "EST"
@@ -212,23 +204,31 @@ DESCRIPTION
The name of the rule(s) that apply in the time zone or,
alternately, an amount of time to add to local standard time. If
this field is - then standard time always applies in the time
- zone.
+ zone. When an amount of time is given, only the sum of standard
+ time and this amount matters.
FORMAT
The format for time zone abbreviations in this time zone. The
pair of characters %s is used to show where the "variable part"
- of the time zone abbreviation goes. Alternately, a slash (/)
- separates standard and daylight abbreviations.
+ of the time zone abbreviation goes. Alternately, a format can
+ use the pair of characters %z to stand for the UTC offset in the
+ form +-hh, +-hhmm, or +-hhmmss, using the shortest form that does
+ not lose information, where hh, mm, and ss are the hours,
+ minutes, and seconds east (+) or west (-) of UTC. Alternately, a
+ slash (/) separates standard and daylight abbreviations. To
+ conform to POSIX, a time zone abbreviation should contain only
+ alphanumeric ASCII characters, "+" and "-".
UNTILYEAR [MONTH [DAY [TIME]]]
The time at which the UT offset or the rule(s) change for a
location. It is specified as a year, a month, a day, and a time
of day. If this is specified, the time zone information is
generated from the given UT offset and rule change until the time
- specified. The month, day, and time of day have the same format
- as the IN, ON, and AT fields of a rule; trailing fields can be
- omitted, and default to the earliest possible value for the
- missing fields.
+ specified, which is interpreted using the rules in effect just
+ before the transition. The month, day, and time of day have the
+ same format as the IN, ON, and AT fields of a rule; trailing
+ fields can be omitted, and default to the earliest possible value
+ for the missing fields.
The next line must be a "continuation" line; this has the same
form as a zone line except that the string "Zone" and the name
@@ -239,6 +239,11 @@ DESCRIPTION
lines do, indicating that the next line is a further
continuation.
+ If a zone changes at the same instant that a rule would otherwise take
+ effect in the earlier zone or continuation line, the rule is ignored.
+ In a single zone it is an error if two rules take effect at the same
+ instant, or if two zone changes take effect at the same instant.
+
A link line has the form
Link TARGET LINK-NAME
diff --git a/elsie.nci.nih.gov/src/zic.c b/elsie.nci.nih.gov/src/zic.c
index 636649b..5d5f1cd 100644
--- a/elsie.nci.nih.gov/src/zic.c
+++ b/elsie.nci.nih.gov/src/zic.c
@@ -76,6 +76,7 @@ struct zone {
zic_t z_gmtoff;
const char * z_rule;
const char * z_format;
+ char z_format_specifier;
zic_t z_stdoff;
@@ -130,6 +131,9 @@ static void rulesub(struct rule * rp,
static zic_t tadd(zic_t t1, zic_t t2);
static bool yearistype(int year, const char * type);
+/* Bound on length of what %z can expand to. */
+enum { PERCENT_Z_LEN_BOUND = sizeof "+995959" - 1 };
+
static int charcnt;
static bool errors;
static bool warnings;
@@ -139,7 +143,7 @@ static bool leapseen;
static zic_t leapminyear;
static zic_t leapmaxyear;
static int linenum;
-static int max_abbrvar_len;
+static int max_abbrvar_len = PERCENT_Z_LEN_BOUND;
static int max_format_len;
static zic_t max_year;
static zic_t min_year;
@@ -443,7 +447,8 @@ verror(const char *const string, va_list args)
** zic ... 2>&1 | error -t "*" -v
** on BSD systems.
*/
- fprintf(stderr, _("\"%s\", line %d: "), filename, linenum);
+ if (filename)
+ fprintf(stderr, _("\"%s\", line %d: "), filename, linenum);
vfprintf(stderr, string, args);
if (rfilename != NULL)
fprintf(stderr, _(" (rule from \"%s\", line %d)"),
@@ -492,7 +497,7 @@ usage(FILE *stream, int status)
fprintf(stream,
_("%s: usage is %s [ --version ] [ --help ] [ -v ] \\\n"
"\t[ -l localtime ] [ -p posixrules ] [ -d directory ] \\\n"
- "\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\n"
+ "\t[ -L leapseconds ] [ filename ... ]\n\n"
"Report bugs to %s.\n"),
progname, progname, REPORT_BUGS_TO);
if (status == EXIT_SUCCESS)
@@ -595,7 +600,7 @@ _("%s: More than one -L option specified\n"),
noise = true;
break;
case 's':
- warning(_("-s ignored\n"));
+ warning(_("-s ignored"));
break;
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
@@ -648,36 +653,43 @@ _("%s: More than one -L option specified\n"),
return errors ? EXIT_FAILURE : EXIT_SUCCESS;
}
-static void
+static bool
componentcheck(char const *name, char const *component,
char const *component_end)
{
enum { component_len_max = 14 };
size_t component_len = component_end - component;
if (component_len == 0) {
- fprintf(stderr, _("%s: file name '%s' contains empty component"),
- progname, name);
- exit(EXIT_FAILURE);
+ if (!*name)
+ error (_("empty file name"));
+ else
+ error (_(component == name
+ ? "file name '%s' begins with '/'"
+ : *component_end
+ ? "file name '%s' contains '//'"
+ : "file name '%s' ends with '/'"),
+ name);
+ return false;
}
if (0 < component_len && component_len <= 2
&& component[0] == '.' && component_end[-1] == '.') {
- fprintf(stderr, _("%s: file name '%s' contains"
- " '%.*s' component"),
- progname, name, (int) component_len, component);
- exit(EXIT_FAILURE);
+ error(_("file name '%s' contains '%.*s' component"),
+ name, (int) component_len, component);
+ return false;
}
- if (!noise)
- return;
- if (0 < component_len && component[0] == '-')
- warning(_("file name '%s' component contains leading '-'"),
- name);
- if (component_len_max < component_len)
- warning(_("file name '%s' contains overlength component"
- " '%.*s...'"),
- name, component_len_max, component);
+ if (noise) {
+ if (0 < component_len && component[0] == '-')
+ warning(_("file name '%s' component contains leading '-'"),
+ name);
+ if (component_len_max < component_len)
+ warning(_("file name '%s' contains overlength component"
+ " '%.*s...'"),
+ name, component_len_max, component);
+ }
+ return true;
}
-static void
+static bool
namecheck(const char *name)
{
register char const *cp;
@@ -701,14 +713,14 @@ namecheck(const char *name)
? _("file name '%s' contains byte '%c'")
: _("file name '%s' contains byte '\\%o'")),
name, c);
- return;
}
if (c == '/') {
- componentcheck(name, component, cp);
+ if (!componentcheck(name, component, cp))
+ return false;
component = cp + 1;
}
}
- componentcheck(name, component, cp);
+ return componentcheck(name, component, cp);
}
static char *
@@ -727,13 +739,12 @@ relname(char const *dir, char const *base)
}
static void
-dolink(const char *const fromfield, const char *const tofield)
+dolink(char const *fromfield, char const *tofield)
{
register char * fromname;
register char * toname;
register int fromisdir;
- namecheck(tofield);
fromname = relname(directory, fromfield);
toname = relname(directory, tofield);
/*
@@ -813,8 +824,8 @@ warning(_("hard link failed, symbolic link used"));
#define TIME_T_BITS_IN_FILE 64
-static const zic_t min_time = (zic_t) -1 << (TIME_T_BITS_IN_FILE - 1);
-static const zic_t max_time = -1 - ((zic_t) -1 << (TIME_T_BITS_IN_FILE - 1));
+static zic_t const min_time = MINVAL (zic_t, TIME_T_BITS_IN_FILE);
+static zic_t const max_time = MAXVAL (zic_t, TIME_T_BITS_IN_FILE);
/* Estimated time of the Big Bang, in seconds since the POSIX epoch.
rounded downward to the negation of a power of two that is
@@ -848,7 +859,7 @@ static const zic_t big_bang_time = BIG_BANG;
/* Return 1 if NAME is a directory, 0 if it's something else, -1 if trouble. */
static int
-itsdir(const char *const name)
+itsdir(char const *name)
{
struct stat st;
int res = stat(name, &st);
@@ -948,7 +959,7 @@ associate(void)
** Note, though, that if there's no rule,
** a '%s' in the format is a bad thing.
*/
- if (strchr(zp->z_format, '%') != 0)
+ if (zp->z_format_specifier == 's')
error("%s", _("%s in ruleless zone"));
}
}
@@ -1020,9 +1031,9 @@ infile(const char *name)
break;
case LC_LEAP:
if (name != leapsec)
- warning(
-_("%s: Leap line in non leap seconds file %s\n"),
- progname, name);
+ warning(_("%s: Leap line in non leap"
+ " seconds file %s"),
+ progname, name);
else inleap(fields, nfields);
wantcont = false;
break;
@@ -1090,7 +1101,7 @@ warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
}
static void
-inrule(register char **const fields, const int nfields)
+inrule(char **fields, int nfields)
{
static struct rule r;
@@ -1116,7 +1127,7 @@ inrule(register char **const fields, const int nfields)
}
static bool
-inzone(register char **const fields, const int nfields)
+inzone(char **fields, int nfields)
{
register int i;
@@ -1150,7 +1161,7 @@ _("duplicate zone name %s (file \"%s\", line %d)"),
}
static bool
-inzcont(register char **const fields, const int nfields)
+inzcont(char **fields, int nfields)
{
if (nfields < ZONEC_MINFIELDS || nfields > ZONEC_MAXFIELDS) {
error(_("wrong number of fields on Zone continuation line"));
@@ -1163,6 +1174,7 @@ static bool
inzsub(char **fields, int nfields, bool iscont)
{
register char * cp;
+ char * cp1;
static struct zone z;
register int i_gmtoff, i_rule, i_format;
register int i_untilyear, i_untilmonth;
@@ -1178,7 +1190,9 @@ inzsub(char **fields, int nfields, bool iscont)
i_untilday = ZFC_TILDAY;
i_untiltime = ZFC_TILTIME;
z.z_name = NULL;
- } else {
+ } else if (!namecheck(fields[ZF_NAME]))
+ return false;
+ else {
i_gmtoff = ZF_GMTOFF;
i_rule = ZF_RULE;
i_format = ZF_FORMAT;
@@ -1192,13 +1206,21 @@ inzsub(char **fields, int nfields, bool iscont)
z.z_linenum = linenum;
z.z_gmtoff = gethms(fields[i_gmtoff], _("invalid UT offset"), true);
if ((cp = strchr(fields[i_format], '%')) != 0) {
- if (*++cp != 's' || strchr(cp, '%') != 0) {
+ if ((*++cp != 's' && *cp != 'z') || strchr(cp, '%')
+ || strchr(fields[i_format], '/')) {
error(_("invalid abbreviation format"));
return false;
}
}
z.z_rule = ecpyalloc(fields[i_rule]);
- z.z_format = ecpyalloc(fields[i_format]);
+ z.z_format = cp1 = ecpyalloc(fields[i_format]);
+ z.z_format_specifier = cp ? *cp : '\0';
+ if (z.z_format_specifier == 'z') {
+ if (noise)
+ warning(_("format '%s' not handled by pre-2015 versions of zic"),
+ z.z_format);
+ cp1[cp - fields[i_format]] = 's';
+ }
if (max_format_len < strlen(z.z_format))
max_format_len = strlen(z.z_format);
hasuntil = nfields > i_untilyear;
@@ -1237,7 +1259,7 @@ inzsub(char **fields, int nfields, bool iscont)
}
static void
-inleap(register char ** const fields, const int nfields)
+inleap(char **fields, int nfields)
{
register const char * cp;
register const struct lookup * lp;
@@ -1342,7 +1364,7 @@ inleap(register char ** const fields, const int nfields)
}
static void
-inlink(register char **const fields, const int nfields)
+inlink(char **fields, int nfields)
{
struct link l;
@@ -1354,10 +1376,8 @@ inlink(register char **const fields, const int nfields)
error(_("blank FROM field on Link line"));
return;
}
- if (*fields[LF_TO] == '\0') {
- error(_("blank TO field on Link line"));
- return;
- }
+ if (! namecheck(fields[LF_TO]))
+ return;
l.l_filename = filename;
l.l_linenum = linenum;
l.l_from = ecpyalloc(fields[LF_FROM]);
@@ -1367,13 +1387,9 @@ inlink(register char **const fields, const int nfields)
}
static void
-rulesub(register struct rule *const rp,
- const char *const loyearp,
- const char *const hiyearp,
- const char *const typep,
- const char *const monthp,
- const char *const dayp,
- const char *const timep)
+rulesub(struct rule *rp, const char *loyearp, const char *hiyearp,
+ const char *typep, const char *monthp, const char *dayp,
+ const char *timep)
{
register const struct lookup * lp;
register const char * cp;
@@ -1587,7 +1603,6 @@ writezone(const char *const name, const char *const string, char version)
void *typesptr = ats + timecnt;
unsigned char *types = typesptr;
- namecheck(name);
/*
** Sort.
*/
@@ -1884,19 +1899,59 @@ writezone(const char *const name, const char *const string, char version)
free(fullname);
}
+static char const *
+abbroffset(char *buf, zic_t offset)
+{
+ char sign = '+';
+ int seconds, minutes;
+
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+
+ seconds = offset % SECSPERMIN;
+ offset /= SECSPERMIN;
+ minutes = offset % MINSPERHOUR;
+ offset /= MINSPERHOUR;
+ if (100 <= offset) {
+ error(_("%%z UTC offset magnitude exceeds 99:59:59"));
+ return "%z";
+ } else {
+ char *p = buf;
+ *p++ = sign;
+ *p++ = '0' + offset / 10;
+ *p++ = '0' + offset % 10;
+ if (minutes | seconds) {
+ *p++ = '0' + minutes / 10;
+ *p++ = '0' + minutes % 10;
+ if (seconds) {
+ *p++ = '0' + seconds / 10;
+ *p++ = '0' + seconds % 10;
+ }
+ }
+ *p = '\0';
+ return buf;
+ }
+}
+
static size_t
-doabbr(char *const abbr, const char *const format, const char *const letters,
+doabbr(char *abbr, struct zone const *zp, char const *letters,
bool isdst, bool doquotes)
{
register char * cp;
register char * slashp;
register size_t len;
+ char const *format = zp->z_format;
slashp = strchr(format, '/');
if (slashp == NULL) {
- if (letters == NULL)
- strcpy(abbr, format);
- else sprintf(abbr, format, letters);
+ char letterbuf[PERCENT_Z_LEN_BOUND + 1];
+ if (zp->z_format_specifier == 'z')
+ letters = abbroffset(letterbuf, -zp->z_gmtoff);
+ else if (!letters)
+ letters = "%s";
+ sprintf(abbr, format, letters);
} else if (isdst) {
strcpy(abbr, slashp + 1);
} else {
@@ -2121,7 +2176,7 @@ stringzone(char *result, const struct zone *const zpfirst, const int zonecount)
if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0))
return -1;
abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
- len = doabbr(result, zp->z_format, abbrvar, false, true);
+ len = doabbr(result, zp, abbrvar, false, true);
offsetlen = stringoffset(result + len, -zp->z_gmtoff);
if (! offsetlen) {
result[0] = '\0';
@@ -2130,7 +2185,7 @@ stringzone(char *result, const struct zone *const zpfirst, const int zonecount)
len += offsetlen;
if (dstrp == NULL)
return compat;
- len += doabbr(result + len, zp->z_format, dstrp->r_abbrvar, true, true);
+ len += doabbr(result + len, zp, dstrp->r_abbrvar, true, true);
if (dstrp->r_stdoff != SECSPERMIN * MINSPERHOUR) {
offsetlen = stringoffset(result + len,
-(zp->z_gmtoff + dstrp->r_stdoff));
@@ -2161,7 +2216,7 @@ stringzone(char *result, const struct zone *const zpfirst, const int zonecount)
}
static void
-outzone(const struct zone * const zpfirst, const int zonecount)
+outzone(const struct zone *zpfirst, int zonecount)
{
register const struct zone * zp;
register struct rule * rp;
@@ -2301,8 +2356,7 @@ outzone(const struct zone * const zpfirst, const int zonecount)
startoff = zp->z_gmtoff;
if (zp->z_nrules == 0) {
stdoff = zp->z_stdoff;
- doabbr(startbuf, zp->z_format,
- NULL, stdoff != 0, false);
+ doabbr(startbuf, zp, NULL, stdoff != 0, false);
type = addtype(oadd(zp->z_gmtoff, stdoff),
startbuf, stdoff != 0, startttisstd,
startttisgmt);
@@ -2369,6 +2423,16 @@ outzone(const struct zone * const zpfirst, const int zonecount)
if (k < 0 || jtime < ktime) {
k = j;
ktime = jtime;
+ } else if (jtime == ktime) {
+ char const *dup_rules_msg =
+ _("two rules for same instant");
+ eats(zp->z_filename, zp->z_linenum,
+ rp->r_filename, rp->r_linenum);
+ warning("%s", dup_rules_msg);
+ rp = &zp->z_rules[k];
+ eats(zp->z_filename, zp->z_linenum,
+ rp->r_filename, rp->r_linenum);
+ error("%s", dup_rules_msg);
}
}
if (k < 0)
@@ -2384,7 +2448,7 @@ outzone(const struct zone * const zpfirst, const int zonecount)
if (ktime < starttime) {
startoff = oadd(zp->z_gmtoff,
stdoff);
- doabbr(startbuf, zp->z_format,
+ doabbr(startbuf, zp,
rp->r_abbrvar,
rp->r_stdoff != 0,
false);
@@ -2394,7 +2458,7 @@ outzone(const struct zone * const zpfirst, const int zonecount)
startoff == oadd(zp->z_gmtoff,
stdoff)) {
doabbr(startbuf,
- zp->z_format,
+ zp,
rp->r_abbrvar,
rp->r_stdoff !=
false,
@@ -2403,7 +2467,7 @@ outzone(const struct zone * const zpfirst, const int zonecount)
}
eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum);
- doabbr(ab, zp->z_format, rp->r_abbrvar,
+ doabbr(ab, zp, rp->r_abbrvar,
rp->r_stdoff != 0, false);
offset = oadd(zp->z_gmtoff, rp->r_stdoff);
type = addtype(offset, ab, rp->r_stdoff != 0,
@@ -2484,7 +2548,7 @@ error(_("can't determine time zone abbreviation to use just after until time"));
}
static void
-addtt(const zic_t starttime, int type)
+addtt(zic_t starttime, int type)
{
if (starttime <= big_bang_time ||
(timecnt == 1 && attypes[0].at < big_bang_time)) {
@@ -2595,7 +2659,7 @@ adjleap(void)
}
static bool
-yearistype(const int year, const char *const type)
+yearistype(int year, const char *type)
{
static char * buf;
int result;
@@ -2693,8 +2757,7 @@ itsabbr(register const char *abbr, register const char *word)
}
static ATTRIBUTE_PURE const struct lookup *
-byword(register const char *const word,
- register const struct lookup *const table)
+byword(const char *word, const struct lookup *table)
{
register const struct lookup * foundlp;
register const struct lookup * lp;
@@ -2766,7 +2829,7 @@ time_overflow(void)
}
static ATTRIBUTE_PURE zic_t
-oadd(const zic_t t1, const zic_t t2)
+oadd(zic_t t1, zic_t t2)
{
if (t1 < 0 ? t2 < ZIC_MIN - t1 : ZIC_MAX - t1 < t2)
time_overflow();
@@ -2774,7 +2837,7 @@ oadd(const zic_t t1, const zic_t t2)
}
static ATTRIBUTE_PURE zic_t
-tadd(const zic_t t1, const zic_t t2)
+tadd(zic_t t1, zic_t t2)
{
if (t1 < 0) {
if (t2 < min_time - t1) {
@@ -2798,7 +2861,7 @@ tadd(const zic_t t1, const zic_t t2)
*/
static zic_t
-rpytime(register const struct rule *const rp, register const zic_t wantedy)
+rpytime(const struct rule *rp, zic_t wantedy)
{
register int m, i;
register zic_t dayoff; /* with a nod to Margaret O. */
@@ -2879,7 +2942,7 @@ will not work with pre-2004 versions of zic"));
}
static void
-newabbr(const char *const string)
+newabbr(const char *string)
{
register int i;
@@ -2887,27 +2950,15 @@ newabbr(const char *const string)
register const char * cp;
const char * mp;
- /*
- ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
- ** optionally followed by a + or - and a number from 1 to 14.
- */
cp = string;
mp = NULL;
- while (is_alpha(*cp))
+ while (is_alpha(*cp) || ('0' <= *cp && *cp <= '9')
+ || *cp == '-' || *cp == '+')
++cp;
- if (cp - string == 0)
-mp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string < 3)
-mp = _("time zone abbreviation has fewer than 3 alphabetics");
+ mp = _("time zone abbreviation has fewer than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-mp = _("time zone abbreviation has too many alphabetics");
- if (mp == NULL && (*cp == '+' || *cp == '-')) {
- ++cp;
- if (is_digit(*cp))
- if (*cp++ == '1' &&
- *cp >= '0' && *cp <= '4')
- ++cp;
- }
+ mp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
mp = _("time zone abbreviation differs from POSIX standard");
if (mp != NULL)
@@ -2952,7 +3003,7 @@ mkdirs(char *argname)
if (itsdir(name) <= 0) {
char const *e = strerror(err);
warning(_("%s: Can't create directory"
- " %s: %s\n"),
+ " %s: %s"),
progname, name, e);
free(name);
return false;
diff --git a/elsie.nci.nih.gov/src/zone.tab b/elsie.nci.nih.gov/src/zone.tab
index f418e7f..381f245 100644
--- a/elsie.nci.nih.gov/src/zone.tab
+++ b/elsie.nci.nih.gov/src/zone.tab
@@ -106,8 +106,8 @@ BW -2439+02555 Africa/Gaborone
BY +5354+02734 Europe/Minsk
BZ +1730-08812 America/Belize
CA +4734-05243 America/St_Johns Newfoundland Time, including SE Labrador
-CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (most places), PEI
-CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
+CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (peninsula), PEI
+CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia (Cape Breton)
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
diff --git a/elsie.nci.nih.gov/src/zone1970.tab b/elsie.nci.nih.gov/src/zone1970.tab
index 5da0200..c9d31d9 100644
--- a/elsie.nci.nih.gov/src/zone1970.tab
+++ b/elsie.nci.nih.gov/src/zone1970.tab
@@ -103,8 +103,8 @@ BT +2728+08939 Asia/Thimphu
BY +5354+02734 Europe/Minsk
BZ +1730-08812 America/Belize
CA +4734-05243 America/St_Johns Newfoundland Time, including SE Labrador
-CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (most places), PEI
-CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
+CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (peninsula), PEI
+CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia (Cape Breton)
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
@@ -206,6 +206,7 @@ KI -0308-17105 Pacific/Enderbury Phoenix Islands
KI +0152-15720 Pacific/Kiritimati Line Islands
KP +3901+12545 Asia/Pyongyang
KR +3733+12658 Asia/Seoul
+KY +1918-08123 America/Cayman
KZ +4315+07657 Asia/Almaty most locations
KZ +4448+06528 Asia/Qyzylorda Qyzylorda (Kyzylorda, Kzyl-Orda)
KZ +5017+05710 Asia/Aqtobe Aqtobe (Aktobe)
@@ -259,7 +260,7 @@ 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 +0858-07932 America/Panama
PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands