diff options
author | Roland McGrath <roland@gnu.org> | 1995-02-18 01:27:10 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-02-18 01:27:10 +0000 |
commit | 28f540f45bbacd939bfd07f213bcad2bf730b1bf (patch) | |
tree | 15f07c4c43d635959c6afee96bde71fb1b3614ee /time | |
download | glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.tar.gz glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.tar.bz2 glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.zip |
initial import
Diffstat (limited to 'time')
46 files changed, 12755 insertions, 0 deletions
diff --git a/time/.cvsignore b/time/.cvsignore new file mode 100644 index 0000000000..1f69fd919a --- /dev/null +++ b/time/.cvsignore @@ -0,0 +1,4 @@ +*.gz *.Z *.tar *.tgz +=* +TODO COPYING* AUTHORS copyr-* copying.* +glibc-* diff --git a/time/Makefile b/time/Makefile new file mode 100644 index 0000000000..684fa51a53 --- /dev/null +++ b/time/Makefile @@ -0,0 +1,126 @@ +# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. + +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If +# not, write to the Free Software Foundation, Inc., 675 Mass Ave, +# Cambridge, MA 02139, USA. + +# +# Makefile for time routines +# +subdir := time + +headers := time.h sys/time.h sys/timeb.h +distribute := tzfile.h private.h scheck.c ialloc.c emkdir.c yearistype +extra-objs = scheck.o ialloc.o emkdir.o zonenames $(tzfiles:%=z.%) + +routines := offtime asctime clock ctime difftime gmtime \ + localtime mktime strftime time tzset tzfile \ + gettimeofday settimeofday adjtime \ + getitimer setitimer \ + stime dysize timegm ftime + +others := ap zdump zic +tests := test_time clocktest + +tzfiles := africa antarctica asia australasia europe northamerica \ + southamerica etcetera factory systemv backward +# pacificnew doesn't compile; if it is to be used, it should be included in +# northamerica. +distribute := $(distribute) $(tzfiles) leapseconds pacificnew + +install-sbin := zic zdump + +include ../Makeconfig # Get objpfx defined so we can use it below. + +# zonenames uses this variable. +define nl + + +endef +include $(objpfx)zonenames + +# Make these absolute file names. +installed-localtime-file := $(firstword $(filter /%,$(localtime-file)) \ + $(addprefix $(zonedir)/, \ + $(localtime-file))) +installed-posixrules-file := $(firstword $(filter /%,$(posixrules-file)) \ + $(addprefix $(zonedir)/, \ + $(posixrules-file))) + +ifndef cross-compiling +# Don't try to install the zoneinfo files since we can't run zic. +install-others = $(addprefix $(zonedir)/,$(zonenames)) \ + $(installed-localtime-file) $(installed-posixrules-file) +endif + +include ../Rules + + +$(tzfiles:%=$(objpfx)z.%): $(objpfx)z.%: % Makefile +# Kludge alert: we use an implicit rule (in what we are generating here) +# because that is the only way to tell Make that the one command builds all +# the files. + (echo 'define $*-zones' ;\ + awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^;\ + echo 'endef' ;\ + echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))' ;\ + echo 'ifdef $*-zones' ;\ + echo '$$(addprefix $$(datadir)/zone%/,$$($*-zones)): \' ;\ + echo '$< $$(objpfx)zic leapseconds yearistype' ;\ + echo ' $$(tzcompile)' ;\ + echo 'endif' ;\ + echo 'zonenames := $$(zonenames) $$($*-zones)' ;\ + ) > $@.new + mv $@.new $@ +$(objpfx)zonenames: Makefile + (for file in $(tzfiles); do \ + echo "include \$$(objpfx)z.$$file"; \ + done) > $@.new + mv $@.new $@ + +.PHONY: echo-zonenames +echo-zonenames: zonenames + @echo 'Known zones: $(zonenames)' + + +# Although $(zonedir) gets compiled into zic, it is useful to always +# specify it with -d on the command line so that it can be overridden on +# the command line of `make install' (e.g., "make install prefix=/foo"). +zic-cmd = $(dir $(word 2,$^))$(notdir $(word 2,$^)) -d $(zonedir) +define tzcompile +$(zic-cmd) -L $(word 3,$^) -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $< +endef + +ifdef localtime +$(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic + $(zic-cmd) -l $(localtime) +endif +ifdef posixrules +$(installed-posixrules-file): $(zonedir)/$(posixrules) $(objpfx)zic + $(zic-cmd) -p $(posixrules) +endif + + +$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o $(objpfx)emkdir.o + +$(objpfx)tzfile.o: tzfile.c; $(tz-cc) +$(objpfx)zic.o: zic.c; $(tz-cc) + +# Some versions of GNU make have a bug with backslashes in define directives. +tz-cc = $(COMPILE.c) $(+gcc-nowarn) \ + -DTZDIR='"$(zonedir)"' \ + -DTZDEFAULT='"$(localtime-file)"' \ + -DTZDEFRULES='"$(posixrules-file)"' \ + $< $(OUTPUT_OPTION) diff --git a/time/africa b/time/africa new file mode 100644 index 0000000000..a9786670b5 --- /dev/null +++ b/time/africa @@ -0,0 +1,603 @@ +# @(#)africa 7.6 + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where otherwise noted, it is the source for the data below. +# +# Another source occasionally used is Edward W. Whitman, World Time Differences, +# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which +# I found in the UCLA library. +# +# I added so many Zone names that the old, mostly flat name space was unwieldy. +# So I renamed the Zones to 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. +# For example, the old zone name `Egypt' is now `Africa/Cairo'. +# +# Here are the general rules I used for choosing location names, +# in decreasing order of importance: +# +# Use only valid Posix file names. Use only Ascii letters, digits, `.', +# `-' and `_'. Do not exceed 14 characters or start with `-'. +# E.g. prefer `Brunei' to `Bandar_Seri_Begawan'. +# Include at least one location per time zone rule set per country. +# One such location is enough. +# If a name is ambiguous, use a less ambiguous alternative; +# e.g. many cities are named San Jose 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 traditional English spelling, e.g. prefer `Rome' to `Roma', and +# prefer `Athens' to the true name (which uses Greek letters). +# The Posix file name restrictions encourage this rule. +# Use the most populous among locations in a country's time 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'. +# +# We typically use traditional English time zone abbreviations, +# and assume that applications translate them to other languages +# as part of the normal localization process. +# +# I made up the following time zone abbreviations; corrections are welcome! +# LMT Local Mean Time +# -2:00 CVT Cape Verde Time (no longer used) +# -1:00 AAT Atlantic Africa Time +# 0:00 WAT West Africa Time +# 1:00 CAT Central Africa Time +# 2:00 SAT South Africa Time +# 3:00 EAT East Africa Time +# 4:00 SMT Seychelles and Mascarene Time +# The final `T' is replaced by `ST' for summer time, e.g. `SAST'. +# BEAT is British East Africa Time, which was 2:30 before 1948 and 2:45 after. + + +# Algeria +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Algeria 1911 only - Jan 1 0:00s 0 - +Rule Algeria 1916 only - Jun 14 23:00s 1:00 " DST" +Rule Algeria 1916 1919 - Oct Sun<=7 23:00s 0 - +Rule Algeria 1917 only - Mar 24 23:00s 1:00 " DST" +Rule Algeria 1918 only - Mar 9 23:00s 1:00 " DST" +Rule Algeria 1919 only - Mar 1 23:00s 1:00 " DST" +Rule Algeria 1920 only - Feb 14 23:00s 1:00 " DST" +Rule Algeria 1920 only - Oct 23 23:00s 0 - +Rule Algeria 1921 only - Mar 14 23:00s 1:00 " DST" +Rule Algeria 1921 only - Jun 21 23:00s 0 - +Rule Algeria 1939 only - Sep 11 23:00s 1:00 " DST" +Rule Algeria 1939 only - Nov 19 1:00 0 - +Rule Algeria 1944 1945 - Apr Mon<=7 2:00 1:00 " DST" +Rule Algeria 1944 only - Oct 8 2:00 0 - +Rule Algeria 1945 only - Sep 16 1:00 0 - +Rule Algeria 1971 only - Apr 25 23:00s 1:00 " DST" +Rule Algeria 1971 only - Sep 26 23:00s 0 - +Rule Algeria 1977 only - May 6 0:00 1:00 " DST" +Rule Algeria 1977 only - Oct 21 0:00 0 - +Rule Algeria 1978 only - Mar 24 1:00 1:00 " DST" +Rule Algeria 1978 only - Sep 22 3:00 0 - +Rule Algeria 1980 only - Apr 25 0:00 1:00 " DST" +Rule Algeria 1980 only - Oct 31 2:00 0 - +# Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:05 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WET%s 1940 Feb 25 2:00 + 1:00 Algeria MET%s 1946 Oct 7 + 0:00 - WET 1956 Jan 29 + 1:00 - MET 1963 Apr 14 + 0:00 Algeria WET%s 1977 Oct 21 + 1:00 Algeria MET%s 1979 Oct 26 + 0:00 Algeria WET%s 1981 May + 1:00 - MET + +# Angola +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Luanda 0:52:56 - LMT 1892 + 0:52 - LMT 1911 May 26 # Luanda Mean Time + 1:00 - CAT + +# Benin +# Whitman says they switched to 1:00 in 1946, not 1934; go with Shanks. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Porto-Novo 0:10:28 - LMT 1912 + 0:00 - WAT 1934 Feb 26 + 1:00 - CAT + +# Botswana +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Gaborone 1:43:40 - LMT 1885 + 2:00 - SAT 1943 Sep 19 2:00 + 2:00 1:00 SAST 1944 Mar 19 2:00 + 2:00 - SAT + +# Burkina Faso +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Ouagadougou -0:06:04 - LMT 1912 + 0:00 - WAT + +# Burundi +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Bujumbura 1:57:28 - LMT 1890 + 2:00 - SAT + +# Cameroon +# Whitman says they switched to 1:00 in 1920; go with Shanks. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Douala 0:38:48 - LMT 1912 + 1:00 - CAT + +# Cape Verde +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia + -2:00 - CVT 1942 Sep + -2:00 1:00 CVST 1945 Oct 15 + -2:00 - CVT 1975 Nov 25 2:00 + -1:00 - AAT + +# Central African Republic +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Bangui 1:14:20 - LMT 1912 + 1:00 - CAT + +# Chad +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Ndjamena 1:00:12 - LMT 1912 + 1:00 - CAT 1979 Oct 14 + 1:00 1:00 CAST 1980 Mar 8 + 1:00 - CAT + +# Comoros +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro + 3:00 - EAT + +# Congo +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Brazzaville 1:01:08 - LMT 1912 + 1:00 - CAT + +# Cote D'Ivoire +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Abidjan -0:16:08 - LMT 1912 + 0:00 - WAT + +# Djibouti +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul + 3:00 - EAT + +############################################################################### + +# Egypt + +# From Bob Devine (January 28, 1988): +# Egypt: DST from first day of May to first of October (ending may +# also be on Sept 30th not 31st -- you might want to ask one of the +# soc.* groups, you might hit someone who could ask an embassy). +# DST since 1960 except for 1981-82. + +# From U. S. Naval Observatory (January 19, 1989): +# EGYPT 2 H AHEAD OF UTC +# EGYPT 3 H AHEAD OF UTC MAY 17 - SEP 30 (AFTER +# EGYPT RAMADAN) + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Egypt 1900 only - Oct 1 0:00 0 - +Rule Egypt 1940 only - Jul 15 0:00 1:00 " DST" +Rule Egypt 1940 only - Oct 1 0:00 0 - +Rule Egypt 1941 only - Apr 15 0:00 1:00 " DST" +Rule Egypt 1941 only - Sep 16 0:00 0 - +Rule Egypt 1942 1944 - Apr 1 0:00 1:00 " DST" +Rule Egypt 1942 only - Oct 27 0:00 0 - +Rule Egypt 1943 1945 - Nov 1 0:00 0 - +Rule Egypt 1945 only - Apr 16 0:00 1:00 " DST" +Rule Egypt 1957 only - May 10 0:00 1:00 " DST" +Rule Egypt 1957 1958 - Oct 1 0:00 0 - +Rule Egypt 1958 only - May 1 0:00 1:00 " DST" +Rule Egypt 1959 1981 - May 1 1:00 1:00 " DST" +Rule Egypt 1959 1965 - Sep 30 3:00 0 - +Rule Egypt 1966 max - Oct 1 3:00 0 - +Rule Egypt 1982 only - Jul 25 1:00 1:00 " DST" +Rule Egypt 1983 only - Jul 12 1:00 1:00 " DST" +Rule Egypt 1984 1988 - May 1 1:00 1:00 " DST" +Rule Egypt 1989 only - May 6 1:00 1:00 " DST" +Rule Egypt 1990 max - May 1 1:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Cairo 2:05:00 - LMT 1900 Oct + 2:00 Egypt EET%s + +# Equatorial Guinea +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Malabo 0:35:08 - LMT 1912 + 0:00 - WAT 1963 Dec 15 + 1:00 - CAT + +# Eritrea +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Asmera 2:35:32 - LMT 1870 + 2:36 - AMT 1890 # Asmera Mean Time + 2:35 - AAMT 1936 May 5 # Addis Ababa MT + 3:00 - EAT + +# Ethiopia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 + 2:35 - AAMT 1936 May 5 # Addis Ababa MT + 3:00 - EAT + +# Gabon +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Libreville 0:37:48 - LMT 1912 + 1:00 - CAT + +# Gambia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Banjul -1:06:36 - LMT 1912 + -1:07 - BMT 1935 # Banjul Mean Time + -1:00 - AAT 1964 + 0:00 - WAT + +# Ghana +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# WATDT is my invention for ``West Africa one-Third Daylight Time''. +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Ghana 1918 only - Jan 1 0:00 0 WAT +# Whitman says DST was observed from 1931 to ``the present''; go with Shanks. +Rule Ghana 1936 1942 - Sep 1 0:00 0:20 WATDT +Rule Ghana 1936 1942 - Dec 31 0:00 0 WAT +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Accra -0:00:52 - LMT 1918 + 0:00 Ghana %s + +# Guinea +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Conakry -0:54:52 - LMT 1912 + 0:00 - WAT 1934 Feb 26 + 1:00 - CAT 1960 + 0:00 - WAT + +# Guinea-Bissau +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 + 1:00 - CAT 1975 + 0:00 - WAT + +# Kenya +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Shanks says the transition to 2:45 was in 1940, but it must have been 1948. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul + 3:00 - EAT 1930 + 2:30 - BEAT 1948 + 2:45 - BEAT 1960 + 3:00 - EAT + +# Lesotho +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Maseru 1:50:00 - LMT 1903 Mar + 2:00 - SAT 1943 Sep 19 2:00 + 2:00 1:00 SAST 1944 Mar 19 2:00 + 2:00 - SAT + +# Liberia +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# In 1972 Liberia was the last country to switch +# from a GMT offset that was not a multiple of 15 minutes. +# Time magazine reported that it was in honor of their leader's birthday. +# For Liberia before 1972, Shanks reports -0:44, and Whitman reports -0:44:30; +# go with Whitman. +# +# From Shanks (1991), as corrected by Whitman: +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Monrovia -0:43:08 - LMT 1882 + -0:43:08 - MMT 1919 Mar # Monrovia Mean Time + -0:44:30 - LST 1972 May # Liberia Standard Time + 0:00 - WAT + +############################################################################### + +# Libya + +# From Bob Devine (January 28 1988): +# Libya: Since 1982 April 1st to September 30th (?) + +# From U. S. Naval Observatory (January 19, 1989): +# LIBYAN ARAB 1 H AHEAD OF UTC JAMAHIRIYA/LIBYA +# LIBYAN ARAB 2 H AHEAD OF UTC APR 1 - SEP 30 JAMAHIRIYA/LIBYA + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Libya 1920 only - Jan 1 0:00 0 - +Rule Libya 1951 only - Oct 14 2:00 1:00 " DST" +Rule Libya 1952 only - Jan 1 0:00 0 - +Rule Libya 1953 only - Oct 9 2:00 1:00 " DST" +Rule Libya 1954 only - Jan 1 0:00 0 - +Rule Libya 1955 only - Sep 30 0:00 1:00 " DST" +Rule Libya 1956 only - Jan 1 0:00 0 - +Rule Libya 1982 1984 - Apr 1 0:00 1:00 " DST" +Rule Libya 1982 1985 - Oct 1 0:00 0 - +Rule Libya 1985 only - Apr 6 0:00 1:00 " DST" +Rule Libya 1986 only - Apr 4 0:00 1:00 " DST" +Rule Libya 1986 only - Oct 3 0:00 0 - +Rule Libya 1987 1989 - Apr 1 0:00 1:00 " DST" +Rule Libya 1987 1990 - Oct 1 0:00 0 - +Rule Libya 1990 only - May 4 0:00 1:00 " DST" +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Here's a guess for years starting with 1991. +Rule Libya 1991 max - Apr 1 0:00 1:00 " DST" +Rule Libya 1991 max - Oct 1 0:00 0 - + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Tripoli 0:52:44 - LMT 1920 + 1:00 Libya MET%s 1959 + 2:00 - EET 1982 + 1:00 Libya MET%s + +# Madagascar +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul + 3:00 - EAT 1954 Feb 27 23:00s + 3:00 1:00 EAST 1954 May 29 23:00s + 3:00 - EAT + +# Malawi +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar + 2:00 - SAT + +# Mali +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Bamako -0:32:00 - LMT 1912 + 0:00 - WAT 1934 Feb 26 + -1:00 - AAT 1960 Jun 20 + 0:00 - WAT +# no longer different from Bamako, but too famous to omit +Zone Africa/Timbuktu -0:12:04 - LMT 1912 + 0:00 - WAT + +# Mauritania +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Nouakchott -1:03:48 - LMT 1912 + 0:00 - WAT 1934 Feb 26 + -1:00 - AAT 1960 Jun 20 + 0:00 - WAT + +# Mauritius +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis + 4:00 - SMT +# Agalega Is, Rodriguez +# no information; probably like Indian/Mauritius + +# Mayotte +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Mayotte 3:01:08 - LMT 1911 Jul # Dzaoudzi + 3:00 - EAT + +# Morocco +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Morocco 1913 only - Oct 26 0:00 0 - +Rule Morocco 1939 only - Sep 12 0:00 1:00 " DST" +Rule Morocco 1939 only - Nov 19 0:00 0 - +Rule Morocco 1940 only - Feb 25 0:00 1:00 " DST" +Rule Morocco 1945 only - Nov 18 0:00 0 - +Rule Morocco 1950 only - Jun 11 0:00 1:00 " DST" +Rule Morocco 1950 only - Oct 29 0:00 0 - +Rule Morocco 1967 only - Jun 3 12:00 1:00 " DST" +Rule Morocco 1967 only - Oct 1 0:00 0 - +Rule Morocco 1974 only - Jun 24 0:00 1:00 " DST" +Rule Morocco 1974 only - Sep 1 0:00 0 - +Rule Morocco 1976 1977 - May 1 0:00 1:00 " DST" +Rule Morocco 1976 only - Aug 1 0:00 0 - +Rule Morocco 1977 only - Sep 28 0:00 0 - +Rule Morocco 1978 only - Jun 1 0:00 1:00 " DST" +Rule Morocco 1978 only - Aug 4 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 + 0:00 Morocco WET%s 1984 Mar 16 + 1:00 - MET 1986 + 0:00 - WET +# The following are controlled by Spain, and are like Europe/Madrid: +# Alboran, Alhucemas Is, Ceuta, Chafarinas Is, Mellila. + +# Mozambique +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Maputo 2:10:20 - LMT 1903 Mar + 2:00 - SAT + +# Namibia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAT 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 + 2:00 - SAT + +# Niger +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Niamey 0:08:28 - LMT 1912 + 1:00 - CAT 1934 Feb 26 + 0:00 - WAT 1960 + 1:00 - CAT + +# Nigeria +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Lagos 0:13:36 - LMT 1919 Sep + 1:00 - CAT + +# Reunion +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # St Denis + 4:00 - SMT + +# Rwanda +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Kigali 2:00:16 - LMT 1935 Jun + 2:00 - SAT + +# St Helena +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/St_Helena -0:22:48 - LMT 1890 # Jamestown + -0:06 - ?MT 1951 # a typo in Shanks? + 0:00 - GMT +# Whitman says Tristan da Cunha is on GMT, like Atlantic/St_Helena. +# +# Ascension, Gough, Inaccessible, Nightingale +# no information; probably like Atlantic/St_Helena + +# Sao Tome and Principe +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Sao_Tome 0:26:56 - LMT 1884 + -0:37 - ?MT 1912 # a typo in Shanks? + 0:00 - WAT + +# Senegal +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Dakar -1:09:44 - LMT 1912 + -1:00 - AAT 1941 Jun + 0:00 - WAT + +# Seychelles +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria + 4:00 - SMT + +# Sierra Leone +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule SL 1913 only - Oct 26 0:00 0 - +# Whitman gives Mar 31 - Aug 31 for 1931 on; go with Shanks. +Rule SL 1935 1942 - Jun 1 0:00 1:00 S +Rule SL 1935 1942 - Oct 1 0:00 0 - +Rule SL 1957 1962 - Jun 1 0:00 1:00 S +Rule SL 1957 1962 - Sep 1 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Freetown -0:53:00 - LMT 1882 + -0:53 - FMT 1913 Jun + -1:00 SL AA%sT 1957 + 0:00 SL WA%sT + +# Somalia +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Shanks omits the 1948 transition to 2:45; this is probably a typo. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov + 3:00 - EAT 1931 + 2:30 - BEAT 1948 + 2:45 - BEAT 1957 # not in Shanks + 3:00 - EAT + +# South Africa +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule SA 1892 only - Feb 8 0:00 0 - +Rule SA 1942 1943 - Sep Sun>=15 2:00 1:00 S +Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 + 1:30 - SAT 1903 Mar + 2:00 SA SA%sT +# Prince Edward Is +# no information + +# Sudan +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Sudan 1931 only - Feb 8 0:00 0 - +Rule Sudan 1970 only - May 1 0:00 1:00 " DST" +Rule Sudan 1970 max - Oct 15 0:00 0 - +Rule Sudan 1971 only - Apr 30 0:00 1:00 " DST" +Rule Sudan 1972 max - Apr lastSun 0:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Khartoum 2:10:08 - LMT 1931 + 2:00 Sudan EET%s + +# Swaziland +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar + 2:00 - SAT + +# Tanzania +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931 + 3:00 - EAT 1948 + 2:45 - BEAT 1961 + 3:00 - EAT + +# Togo +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Lome 0:04:52 - LMT 1893 + 0:00 - WAT + +# Tunisia +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Tunisia 1911 only - Mar 9 0:00 0 - +Rule Tunisia 1939 only - Apr 15 23:00s 1:00 " DST" +Rule Tunisia 1939 only - Nov 18 23:00s 0 - +Rule Tunisia 1940 only - Feb 25 23:00s 1:00 " DST" +Rule Tunisia 1941 only - Oct 6 0:00 0 - +Rule Tunisia 1942 only - Mar 9 0:00 1:00 " DST" +Rule Tunisia 1942 only - Nov 2 3:00 0 - +Rule Tunisia 1943 only - Mar 29 2:00 1:00 " DST" +Rule Tunisia 1943 only - Apr 17 2:00 0 - +Rule Tunisia 1943 only - Apr 25 2:00 1:00 " DST" +Rule Tunisia 1943 only - Oct 4 2:00 0 - +Rule Tunisia 1944 1945 - Apr Mon>=1 2:00 1:00 " DST" +Rule Tunisia 1944 only - Oct 8 0:00 0 - +Rule Tunisia 1945 only - Sep 16 0:00 0 - +Rule Tunisia 1977 only - Apr 30 0:00s 1:00 " DST" +Rule Tunisia 1977 only - Sep 24 0:00s 0 - +Rule Tunisia 1978 only - May 1 0:00s 1:00 " DST" +Rule Tunisia 1978 only - Oct 1 0:00s 0 - +Rule Tunisia 1988 only - Jun 1 0:00s 1:00 " DST" +Rule Tunisia 1988 max - Sep lastSun 0:00s 0 - +Rule Tunisia 1989 only - Mar 26 0:00s 1:00 " DST" +Rule Tunisia 1990 only - May 1 0:00s 1:00 " DST" +Rule Tunisia 1991 max - Mar lastSun 0:00s 1:00 " DST" +# Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 + 0:09:05 - PMT 1911 Mar 9 # Paris Mean Time + 1:00 Tunisia MET%s + +# Uganda +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Kampala 2:09:40 - LMT 1928 Jul + 3:00 - EAT 1930 + 2:30 - BEAT 1948 + 2:45 - BEAT 1957 + 3:00 - EAT + +# Zaire +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 + 1:00 - CAT +Zone Africa/Lumumbashi 1:49:52 - LMT 1897 Nov 9 + 2:00 - SAT + +# Zambia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar + 2:00 - SAT + +# Zimbabwe +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Africa/Harare 2:04:12 - LMT 1903 Mar + 2:00 - SAT diff --git a/time/antarctica b/time/antarctica new file mode 100644 index 0000000000..f5ed31370d --- /dev/null +++ b/time/antarctica @@ -0,0 +1,19 @@ +# @(#)antarctica 7.2 + +# From Arthur David Olson (February 13, 1988): +# No data available. + +# Balleny Is + +# British Antarctic Territories include +# South Orkney Is +# South Shetland Is + +# Amsterdam Island +# Bouvet +# Crozet Is +# Heard and McDonald Is +# Kerguelen Is +# St Paul Island +# Peter I Island +# Scott Island diff --git a/time/ap.c b/time/ap.c new file mode 100644 index 0000000000..c982bd66bb --- /dev/null +++ b/time/ap.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <malloc.h> + +/* Prints the time in the form "hh:mm ?M", where ? is A or P. + A simple test for strftime(). */ +int +DEFUN(main, (argc, argv), int argc AND char **argv) +{ + char buf[20]; + time_t t; + + mcheck (NULL); + + if (argc != 1) + fprintf(stderr, "Usage: %s\n", argv[0]); + + t = time((time_t *) NULL); + if (strftime(buf, sizeof(buf), "%I:%M %p", localtime(&t)) == 0) + exit(EXIT_FAILURE); + + puts(buf); + + exit(EXIT_SUCCESS); + return EXIT_SUCCESS; +} diff --git a/time/asctime.c b/time/asctime.c new file mode 100644 index 0000000000..3337c74388 --- /dev/null +++ b/time/asctime.c @@ -0,0 +1,50 @@ +/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <localeinfo.h> +#include <errno.h> +#include <stdio.h> +#include <time.h> + + +/* Returns a string of the form "Day Mon dd hh:mm:ss yyyy\n" + which is the representation of TP in that form. */ +char * +DEFUN(asctime, (tp), CONST struct tm *tp) +{ + static const char format[] = "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n"; + static char result[ 3+1+ 3+1+20+1+20+1+20+1+20+1+20+1 + 1]; + + if (tp == NULL) + { + errno = EINVAL; + return NULL; + } + + if (sprintf (result, format, + (tp->tm_wday < 0 || tp->tm_wday >= 7 ? + "???" : _time_info->abbrev_wkday[tp->tm_wday]), + (tp->tm_mon < 0 || tp->tm_mon >= 12 ? + "???" : _time_info->abbrev_month[tp->tm_mon]), + tp->tm_mday, tp->tm_hour, tp->tm_min, + tp->tm_sec, 1900 + tp->tm_year) < 0) + return NULL; + + return result; +} diff --git a/time/asia b/time/asia new file mode 100644 index 0000000000..78ecb30d93 --- /dev/null +++ b/time/asia @@ -0,0 +1,803 @@ +# @(#)asia 7.12 + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (August 18, 1994): +# +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where otherwise noted, it is the source for the data below. +# +# Another source occasionally used is Edward W. Whitman, World Time Differences, +# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which +# I found in the UCLA library. +# +# A reliable and entertaining source about time zones is +# Derek Howse, Greenwich time and the discovery of the longitude, +# Oxford University Press (1980). +# +# I invented the abbreviations marked `*' in the following table; +# the rest are from earlier versions of this file, or from other sources. +# Corrections are welcome! +# std dst +# LMT Local Mean Time +# LST Local Star Time (Russian ``mestnoe zvezdnoe vremya'') +# 2:00 EET EET DST Eastern European Time +# 2:00 IST IDT Israel +# 3:00 AST ADT Arabia* +# 3:00 MSK MSD Moscow +# 3:30 IST IDT Iran +# 4:00 BSK BSD Baku* +# 4:00 GST GDT Gulf* +# 4:30 AFT Afghanistan* +# 5:00 ASK ASD Ashkhabad* +# 5:00 PKT Pakistan* +# 5:30 IST IST India +# 5:45 NPT Nepal* +# 6:00 BGT Bengal, Bangladesh* +# 6:00 TSK TSD Tashkent* +# 6:30 BMT Burma* +# 7:00 ICT Indochina* +# 7:00 JVT Java* +# 8:00 BNT Borneo, Brunei* +# 8:00 CST CDT China +# 8:00 HKT HKST Hong Kong +# 8:00 PST PDT Philippines* +# 8:00 SGT Singapore +# 8:00 UST UDT Ulan Bator* +# 9:00 JST Japan +# 9:00 KST KDT Korea +# 9:00 MLT Moluccas* +# 9:30 CST Australian Central Standard Time +# +# See the `europe' file for Russia and Turkey in Asia. +# +# See the `africa' file for Zone naming conventions. + +# From Guy Harris: +# Incorporates data for Singapore from Robert Elz' asia 1.1, as well as +# additional information from Tom Yap, Sun Microsystems Intercontinental +# Technical Support (including a page from the Official Airline Guide - +# Worldwide Edition). The names for time zones are guesses. + +############################################################################### + +# From Paul Eggert <eggert@twinsun.com> (May 28, 1994): +# We don't know what happened to the clocks in the Caucausus and the ex-Soviet +# Central Asia after 1990. Until we get more info, stick with the pre-1991 rules. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Russia 1981 1984 - Apr 1 0:00 1:00 D +Rule Russia 1981 1983 - Oct 1 0:00 0 K +Rule Russia 1984 max - Sep lastSun 3:00 0 K +Rule Russia 1985 max - Mar lastSun 2:00 1:00 D + +# Afghanistan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Kabul 4:36:48 - LMT 1890 + 4:00 - GST 1945 + 4:30 - AFT + +# Armenia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 + 3:00 - MSK 1957 Mar + 4:00 Russia BS%s + +# Azerbaijan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Baku 3:19:24 - LMT 1924 May 2 + 3:00 - MSK 1957 Mar + 4:00 Russia BS%s + +# Bahrain +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al-Manamah + 4:00 - GST 1972 Jun + 3:00 - AST + +# Bangladesh +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Dacca 6:01:40 - LMT 1890 + 5:53 - CMT 1941 Oct # Calcutta Mean Time + 6:30 - BMT 1942 May 15 + 5:30 - IST 1942 Sep + 6:30 - BMT 1951 Sep 30 + 6:00 - BGT + +# Bhutan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Thimbu 5:58:36 - LMT 1947 Aug 15 + 5:30 - IST 1987 Oct + 6:00 - BGT + +# British Indian Ocean Territory +# From Whitman: +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Chagos 5:00 - PKT + +# Brunei +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan + 7:30 - BNT 1933 + 8:00 - BNT + +# Burma +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Rangoon 6:24:40 - LMT 1880 + 6:25 - RMT 1920 + 6:30 - BMT 1942 May + 9:00 - JST 1945 May 3 + 6:30 - BMT + +# Cambodia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 + 7:06 - SMT 1911 Mar 11 0:01 # Saigon MT + 7:00 - ICT 1912 May + 8:00 - ICT 1931 May + 7:00 - ICT + +# People's Republic of China + +# From Guy Harris: +# People's Republic of China. Yes, they really have only one time zone. + +# From Bob Devine (January 28, 1988): +# No they don't. See TIME mag, February 17, 1986 p.52. Even though +# China is across 4 physical time zones, before Feb 1, 1986 only the +# Peking (Bejing) time zone was recognized. Since that date, China +# has two of 'em -- Peking's and Urumqi (named after the capital of +# the Xinjiang Uighur Autonomous Region). I don't know about DST for it. +# +# . . .I just deleted the DST table and this editor makes it too +# painful to suck in another copy.. So, here is what I have for +# DST start/end dates for Peking's time zone (info from AP): +# +# 1986 May 4 - Sept 14 +# 1987 mid-April - ?? + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# According to Shanks, China started using DST in 1986, +# but it's still all one big happy time zone. + +# From U. S. Naval Observatory (January 19, 1989): +# CHINA 8 H AHEAD OF UTC ALL OF CHINA, INCL TAIWAN +# CHINA 9 H AHEAD OF UTC APR 17 - SEP 10 + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Shanks writes that China switched from the Chinese calendar on 1912 Feb 12. +# He also writes that China has had a single time zone since 1980 May 1, +# and that they instituted DST on 1986 May 4; this contradicts Devine's +# note about Time magazine, though apparently _something_ happened in 1986. + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Shang 1928 only - Jan 1 0:00 0 S +Rule Shang 1940 only - Jun 3 0:00 1:00 D +Rule Shang 1940 1941 - Oct 1 0:00 0 S +Rule Shang 1941 only - Mar 16 0:00 1:00 D +Rule PRC 1949 only - Jan 1 0:00 0 S +Rule PRC 1986 only - May 4 0:00 1:00 D +Rule PRC 1986 max - Sep Sun>=11 0:00 0 S +Rule PRC 1987 max - Apr Sun>=10 0:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Shanghai 8:05:52 - LMT 1928 + 8:00 Shang C%sT 1949 + 8:00 PRC C%sT + +############################################################################### + +# Republic of China + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Taiwan 1896 only - Jan 1 0:00 0 S +Rule Taiwan 1945 1951 - May 1 0:00 1:00 D +Rule Taiwan 1945 1951 - Oct 1 0:00 0 S +Rule Taiwan 1952 only - Mar 1 0:00 1:00 D +Rule Taiwan 1952 1954 - Nov 1 0:00 0 S +Rule Taiwan 1953 1959 - Apr 1 0:00 1:00 D +Rule Taiwan 1955 1961 - Oct 1 0:00 0 S +Rule Taiwan 1960 1961 - Jun 1 0:00 1:00 D +Rule Taiwan 1974 1975 - Apr 1 0:00 1:00 D +Rule Taiwan 1974 1975 - Oct 1 0:00 0 S +Rule Taiwan 1980 only - Jun 30 0:00 1:00 D +Rule Taiwan 1980 only - Sep 30 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Taipei 8:06:00 - LMT 1896 + 8:00 Taiwan C%sT + +############################################################################### +# Hong Kong +# Presumably Hong Kong will have DST again when it merges with China, +# but it's too early to predict the details. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule HK 1904 only - Oct 30 0:00 0 - +Rule HK 1946 only - Apr 20 3:30 1:00 S +Rule HK 1946 only - Dec 1 3:30 0 - +Rule HK 1947 only - Apr 13 3:30 1:00 S +Rule HK 1947 only - Dec 30 3:30 0 - +Rule HK 1948 only - May 2 3:30 1:00 S +Rule HK 1948 1952 - Oct lastSun 3:30 0 - +Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S +Rule HK 1953 only - Nov 1 3:30 0 - +Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S +Rule HK 1954 only - Oct 31 3:30 0 - +Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - +Rule HK 1965 1977 - Apr Sun>=16 3:30 1:00 S +Rule HK 1965 1977 - Oct Sun>=16 3:30 0 - +Rule HK 1979 1980 - May Sun>=8 3:30 1:00 S +Rule HK 1979 1980 - Oct Sun>=16 3:30 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30 + 8:00 HK HK%sT + +# Macao +# Presumably Macao will have DST again when it merges with China, +# but it's too early to predict the details. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Macao 1912 only - Jan 1 0:00 0 S +Rule Macao 1961 1962 - Mar Sun>=16 3:30 1:00 D +Rule Macao 1961 1964 - Nov Sun>=1 3:30 0 S +Rule Macao 1963 only - Mar Sun>=16 0:00 1:00 D +Rule Macao 1964 only - Mar Sun>=16 3:30 1:00 D +Rule Macao 1965 only - Mar Sun>=16 0:00 1:00 D +Rule Macao 1965 only - Oct 31 0:00 0 S +Rule Macao 1966 1971 - Apr Sun>=16 3:30 1:00 D +Rule Macao 1966 1971 - Oct Sun>=16 3:30 0 S +Rule Macao 1972 1974 - Apr Sun>=15 0:00 1:00 D +Rule Macao 1972 1973 - Oct Sun>=15 0:00 0 S +Rule Macao 1974 1977 - Oct Sun>=15 3:30 0 S +Rule Macao 1975 1977 - Apr Sun>=15 3:30 1:00 D +Rule Macao 1978 1980 - Apr Sun>=15 0:00 1:00 D +Rule Macao 1978 1980 - Oct Sun>=15 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Macao 7:34:20 - LMT 1912 + 8:00 Macao C%sT + + +############################################################################### + +# Cyprus +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Cyprus 1921 only - Nov 14 0:00 0 - +Rule Cyprus 1975 only - Apr 13 0:00 1:00 " DST" +Rule Cyprus 1975 only - Oct 12 0:00 0 - +Rule Cyprus 1976 only - May 15 0:00 1:00 " DST" +Rule Cyprus 1976 only - Oct 11 0:00 0 - +Rule Cyprus 1977 1980 - Apr Sun>=1 0:00 1:00 " DST" +Rule Cyprus 1977 only - Sep 25 0:00 0 - +Rule Cyprus 1978 only - Oct 2 0:00 0 - +Rule Cyprus 1979 max - Sep lastSun 0:00 0 - +Rule Cyprus 1981 max - Mar lastSun 0:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14 + 2:00 Cyprus EET%s + +# Georgia +# From Paul Eggert <eggert@twinsun.com> (1994-11-19): +# Today's _Economist_ (p 60) reports that Georgia moved its clocks forward +# an hour recently, due to a law proposed by Zurab Murvanidze, +# an MP who went on a hunger strike for 11 days to force discussion about it! +# Alas, we have no details. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Tbilisi 2:59:16 - LMT 1880 + 2:59 - LST 1924 May 2 + 3:00 - MSK 1957 Mar + 4:00 Russia BS%s + +# India +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Calcutta 5:53:28 - LMT 1880 + 5:53 - CMT 1941 Oct # Calcutta Mean Time + 6:30 - BMT 1942 May 15 + 5:30 - IST 1942 Sep + 5:30 1:00 IST 1945 Oct 15 + 5:30 - IST +# The following are like Asia/Calcutta: +# Andaman Is +# Lakshadweep (Laccadive, Minicoy and Amindivi Is) +# Nicobar Is + +# Indonesia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10 + 7:07 - JMT 1924 Jan 1 0:13 + 7:20 - JVT 1932 Nov + 7:30 - JVT 1942 Mar 23 + 9:00 - JST 1945 Aug + 7:30 - JVT 1948 May + 8:00 - JVT 1950 May + 7:30 - JVT 1964 + 7:00 - JVT +Zone Asia/Ujung_Pandang 7:57:36 - LMT 1920 + 7:58 - MMT 1932 Nov # Macassar Mean Time + 8:00 - BNT 1942 Feb 9 + 9:00 - JST 1945 Aug + 8:00 - BNT +Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov + 9:00 - MLT 1944 + 9:30 - CST 1964 + 9:00 - MLT + +# Iran + +# Shanks has no record of DST after 1980. + +# From Bob Devine (January 28, 1988): +# Iran: Last Sunday in March to third (?) Sunday in +# September. Since the revolution, the official calendar is Monarchic +# calendar; I have no idea what the correspondence between dates are. + +# From U. S. Naval Observatory (January 19, 1989): +# IRAN 3.5H AHEAD OF UTC + +# From Shanks (1991), with corrections from Devine: +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Iran 1977 only - Nov 1 0:00 0 S +Rule Iran 1978 1980 - Mar 21 0:00 1:00 D +Rule Iran 1978 only - Oct 21 0:00 0 S +Rule Iran 1979 only - Sep 19 0:00 0 S +Rule Iran 1980 only - Sep 23 0:00 0 S +Rule Iran 1988 max - Mar lastSun 2:00 1:00 D +Rule Iran 1988 max - Sep Sun>=15 2:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Tehran 3:25:44 - LMT 1916 + 3:26 - TMT 1946 + 3:30 - IST 1977 Nov + 4:00 Iran G%sT 1979 + 3:30 Iran I%sT + +# Iraq +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Iraq 1982 only - May 1 0:00 1:00 D +Rule Iraq 1982 1984 - Oct 1 0:00 0 S +Rule Iraq 1983 only - Mar 31 0:00 1:00 D +Rule Iraq 1984 1985 - Apr 1 0:00 1:00 D +Rule Iraq 1985 max - Sep lastSun 1:00s 0 S +Rule Iraq 1986 max - Mar lastSun 1:00s 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Baghdad 2:57:40 - LMT 1890 + 2:58 - BMT 1918 # Baghdad Mean Time + 3:00 - AST 1982 May + 3:00 Iraq A%sT + + +############################################################################### + +# Israel + +# From U. S. Naval Observatory (January 19, 1989): +# ISRAEL 2 H AHEAD OF UTC +# ISRAEL 3 H AHEAD OF UTC APR 10 - SEP 3 + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# +# Shanks gives the following rules for Jerusalem from 1918 through 1991. +# After 1989 Shanks often disagrees with Silverberg; we go with Silverberg. + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 1918 only - Jan 1 0:00 0 S +Rule Zion 1940 only - Jun 1 0:00 1:00 D +Rule Zion 1942 1944 - Nov 1 0:00 0 S +Rule Zion 1943 only - Apr 1 2:00 1:00 D +Rule Zion 1944 only - Apr 1 0:00 1:00 D +Rule Zion 1945 only - Apr 16 0:00 1:00 D +Rule Zion 1945 only - Nov 1 2:00 0 S +Rule Zion 1946 only - Apr 16 2:00 1:00 D +Rule Zion 1946 only - Nov 1 0:00 0 S +Rule Zion 1948 only - May 23 0:00 2:00 DD +Rule Zion 1948 only - Sep 1 0:00 1:00 D +Rule Zion 1948 1949 - Nov 1 2:00 0 S +Rule Zion 1949 only - May 1 0:00 1:00 D +Rule Zion 1950 only - Apr 16 0:00 1:00 D +Rule Zion 1950 only - Sep 15 3:00 0 S +Rule Zion 1951 only - Apr 1 0:00 1:00 D +Rule Zion 1951 only - Nov 11 3:00 0 S +Rule Zion 1952 only - Apr 20 2:00 1:00 D +Rule Zion 1952 only - Oct 19 3:00 0 S +Rule Zion 1953 only - Apr 12 2:00 1:00 D +Rule Zion 1953 only - Sep 13 3:00 0 S +Rule Zion 1954 only - Jun 13 0:00 1:00 D +Rule Zion 1954 only - Sep 12 0:00 0 S +Rule Zion 1955 only - Jun 11 2:00 1:00 D +Rule Zion 1955 only - Sep 11 0:00 0 S +Rule Zion 1956 only - Jun 3 0:00 1:00 D +Rule Zion 1956 only - Sep 30 3:00 0 S +Rule Zion 1957 only - Apr 29 2:00 1:00 D +Rule Zion 1957 only - Sep 22 0:00 0 S +Rule Zion 1974 only - Jul 7 0:00 1:00 D +Rule Zion 1974 only - Oct 13 0:00 0 S +Rule Zion 1975 only - Apr 20 0:00 1:00 D +Rule Zion 1975 only - Aug 31 0:00 0 S +Rule Zion 1985 only - Apr 14 0:00 1:00 D +Rule Zion 1985 only - Sep 15 0:00 0 S +Rule Zion 1986 only - May 18 0:00 1:00 D +Rule Zion 1986 only - Sep 7 0:00 0 S +Rule Zion 1987 only - Apr 15 0:00 1:00 D +Rule Zion 1987 only - Sep 13 0:00 0 S +Rule Zion 1988 only - Apr 9 0:00 1:00 D +Rule Zion 1988 only - Sep 3 0:00 0 S +#Rule Zion 1989 only - Apr 29 0:00 1:00 D +#Rule Zion 1989 only - Sep 2 0:00 0 S +#Rule Zion 1990 only - Mar 25 0:00 1:00 D +#Rule Zion 1990 only - Aug 26 0:00 0 S +#Rule Zion 1991 only - Mar 10 0:00 1:00 D +#Rule Zion 1991 only - Sep 1 0:00 0 S + +# From Ephraim Silverberg (September 5, 1993): +# +# According to the Office of the Secretary General of the Ministry of +# Interior, there is NO set rule for Daylight-Savings/Standard time changes. +# Each year they decide anew what havoc to wreak on the country. However, +# there is a "supposed" set of rules which is subject to change depending +# on the party the Minister of Interior, the size of the coalition +# government, the phase of the moon and the direction of the wind. Hence, +# changes may need to be made on a semi-annual basis. One thing is entrenched +# in law, however: that there must be at least 150 days on daylight savings +# time annually. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 1989 only - Apr 30 0:00 1:00 D +Rule Zion 1989 only - Sep 3 0:00 0:00 S +Rule Zion 1990 only - Mar 25 0:00 1:00 D +Rule Zion 1990 only - Aug 26 0:00 0:00 S +Rule Zion 1991 only - Mar 24 0:00 1:00 D +Rule Zion 1991 only - Sep 1 0:00 0:00 S +Rule Zion 1992 only - Mar 29 0:00 1:00 D +Rule Zion 1992 only - Sep 6 0:00 0:00 S +Rule Zion 1993 only - Apr 2 0:00 1:00 D +Rule Zion 1993 only - Sep 5 0:00 0:00 S + +# The dates for 1994-1995 were obtained from Office of the Spokeswoman for +# the Ministry of Interior, Jerusalem. There are no dates yet for 1996 and +# beyond so your guess is as good as theirs (those who are interested can +# call 972-2-701411 and ask for the spokeswoman). + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 1994 only - Apr 1 0:00 1:00 D +Rule Zion 1994 only - Aug 28 0:00 0:00 S +Rule Zion 1995 only - Mar 31 0:00 1:00 D +Rule Zion 1995 only - Aug 27 0:00 0:00 S + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Tel_Aviv 2:19:04 - LMT 1880 + 2:21 - JMT 1918 + 2:00 Zion I%sT + + +############################################################################### + +# Japan + +# `9:00' and `JST' is from Guy Harris. + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Shanks says that the far southern Ryukyu Is (Nansei-Shoto) are 8:00, +# but we don't have a good location name for them; +# we don't even know the name of the principal town. +# There is no information for Marcus. +# Other Japanese possessions are probably like Asia/Tokyo. + +# From Shanks (1991): +# Japan switched from the Japanese calendar on 1893 Jan 1. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Tokyo 9:19:04 - LMT 1896 + 9:00 - JST +#Zone Asia/South_Ryukyu 8:14:44 - LMT 1896 # Amitori +# 8:00 - CST + +# Jordan +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Most likely Shanks is merely guessing dates from 1992 on. +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Jordan 1931 only - Jan 1 0:00 0 - +Rule Jordan 1973 only - Jun 6 0:00 1:00 " DST" +Rule Jordan 1973 1975 - Oct 1 0:00 0 - +Rule Jordan 1974 1977 - May 1 0:00 1:00 " DST" +Rule Jordan 1976 only - Nov 1 0:00 0 - +Rule Jordan 1977 only - Oct 1 0:00 0 - +Rule Jordan 1978 only - Apr 30 0:00 1:00 " DST" +Rule Jordan 1978 only - Sep 30 0:00 0 - +Rule Jordan 1985 only - Apr 1 0:00 1:00 " DST" +Rule Jordan 1985 only - Oct 1 0:00 0 - +Rule Jordan 1986 1988 - Apr Fri>=1 0:00 1:00 " DST" +Rule Jordan 1986 1990 - Oct Fri>=1 0:00 0 - +Rule Jordan 1989 only - May 8 0:00 1:00 " DST" +Rule Jordan 1990 only - Apr 27 0:00 1:00 " DST" +Rule Jordan 1991 only - Apr 19 0:00 1:00 " DST" +Rule Jordan 1991 only - Sep 27 0:00 0 - +Rule Jordan 1992 max - Apr Fri>=1 0:00 1:00 " DST" +Rule Jordan 1992 max - Oct Fri>=1 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Amman 2:23:44 - LMT 1931 + 2:00 Jordan EET%s + +# Kazakhstan +# From Shanks (1991): +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Alma-Ata 5:07:48 - LMT 1924 May 2 + 5:00 - TSK 1957 Mar + 6:00 Russia TS%s + +# Kirgizstan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 + 5:00 - TSK 1957 Mar + 6:00 Russia TS%s + +############################################################################### + +# Korea + +# From Guy Harris: +# According to someone at the Korean Times in San Francisco, +# Daylight Savings Time was not observed until 1987. He did not know +# at what time of day DST starts or ends. + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule ROK 1960 only - May 15 0:00 1:00 D +Rule ROK 1960 only - Sep 13 0:00 0 S +Rule ROK 1987 1988 - May Sun<=14 0:00 1:00 D +Rule ROK 1987 1988 - Oct Sun<=14 0:00 0 S + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Seoul 8:27:52 - LMT 1890 + 8:30 - KST 1904 Dec + 9:00 - KST 1928 + 8:30 - KST 1932 + 9:00 - KST 1954 Mar 21 + 8:00 ROK K%sT 1961 Aug 10 + 8:30 - KST 1968 Oct + 9:00 ROK K%sT +Zone Asia/Pyongyang 8:23:00 - LMT 1890 + 8:30 - KST 1904 Dec + 9:00 - KST 1928 + 8:30 - KST 1932 + 9:00 - KST 1954 Mar 21 + 8:00 - KST 1961 Aug 10 + 9:00 - KST + +############################################################################### + +# Kuwait +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Kuwait 3:11:56 - LMT 1950 + 3:00 - AST + +# Laos +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 + 7:06 - SMT 1911 Mar 11 0:01 # Saigon MT + 7:00 - ICT 1912 May + 8:00 - ICT 1931 May + 7:00 - ICT + +# Lebanon +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Lebanon 1880 only - Jan 1 0:00 0 - +Rule Lebanon 1920 only - Mar 28 0:00 1:00 " DST" +Rule Lebanon 1920 only - Oct 25 0:00 0 - +Rule Lebanon 1921 only - Apr 3 0:00 1:00 " DST" +Rule Lebanon 1921 only - Oct 3 0:00 0 - +Rule Lebanon 1922 only - Mar 26 0:00 1:00 " DST" +Rule Lebanon 1922 only - Oct 8 0:00 0 - +Rule Lebanon 1923 only - Apr 22 0:00 1:00 " DST" +Rule Lebanon 1923 only - Sep 16 0:00 0 - +Rule Lebanon 1957 1961 - May 1 0:00 1:00 " DST" +Rule Lebanon 1957 1961 - Oct 1 0:00 0 - +Rule Lebanon 1972 only - Jun 22 0:00 1:00 " DST" +Rule Lebanon 1972 1977 - Oct 1 0:00 0 - +Rule Lebanon 1973 1977 - May 1 0:00 1:00 " DST" +Rule Lebanon 1978 only - Apr 30 0:00 1:00 " DST" +Rule Lebanon 1978 only - Sep 30 0:00 0 - +Rule Lebanon 1984 1987 - May 1 0:00 1:00 " DST" +Rule Lebanon 1984 max - Oct 16 0:00 0 - +Rule Lebanon 1988 only - Jun 1 0:00 1:00 " DST" +Rule Lebanon 1989 only - May 10 0:00 1:00 " DST" +Rule Lebanon 1990 max - May 1 0:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Beirut 2:22:00 - LMT 1880 + 2:00 Lebanon EET%s + +# Malaysia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Kuala_Lumpur 6:46:48 - LMT 1880 + 6:55 - SMT 1905 Jun + 7:00 - SGT 1933 + 7:20 - SGT 1942 Feb 15 + 9:00 - JST 1945 Sep 2 + 7:20 - SGT 1950 + 7:30 - SGT 1982 May + 8:00 - SGT + +# Maldives +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54 - MMT 1960 + 5:00 - PKT + +# Mongolia +# Let's comment out the western and eastern Mongolian time zones +# till we know what their principal towns are. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Mongol 1978 only - Jan 1 0:00 0 S +Rule Mongol 1981 1984 - Apr 1 0:00 1:00 T +Rule Mongol 1981 1984 - Oct 1 0:00 0 S +Rule Mongol 1985 max - Mar lastSun 2:00 1:00 T +Rule Mongol 1985 max - Sep lastSun 3:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +#Zone Asia/Dariv 6:14:32 - LMT 1905 Aug +# 6:00 - DST 1978 +# 7:00 Mongol D%sT +Zone Asia/Ulan_Bator 7:07:32 - LMT 1905 Aug + 7:00 - UST 1978 + 8:00 Mongol U%sT +#Zone Asia/Baruun-Urt 7:33:00 - LMT 1905 Aug +# 8:00 - BST 1978 +# 9:00 Mongol B%sT + +# Nepal +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Katmandu 5:41:16 - LMT 1920 + 5:30 - IST 1986 + 5:45 - NPT + +# Oman +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Muscat 3:54:20 - LMT 1920 + 4:00 - GST + +# Pakistan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Karachi 4:28:12 - LMT 1907 + 5:30 - IST 1942 Sep + 5:30 1:00 IST 1945 Oct 15 + 5:30 - IST 1951 Sep 30 + 5:00 - PKT + +# Palestine +# These rules for Egypt are stolen from the `africa' file. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Egypt 1957 only - May 10 0:00 1:00 " DST" +Rule Egypt 1957 1958 - Oct 1 0:00 0 - +Rule Egypt 1958 only - May 1 0:00 1:00 " DST" +Rule Egypt 1959 1981 - May 1 1:00 1:00 " DST" +Rule Egypt 1959 1965 - Sep 30 3:00 0 - +Rule Egypt 1966 max - Oct 1 3:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Gaza 2:17:52 - LMT 1900 Oct + 2:00 - EET 1957 May 10 + 2:00 Egypt EET%s 1967 Jun 30 + 2:00 Zion I%sT +# This will undoubtedly change soon. + +# Philippines +# Howse writes (p 162) that until 1844 the Philippines kept American date. +# The rest of this data is from Shanks. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Phil 1899 only - May 11 0:00 0 S +Rule Phil 1936 only - Nov 1 0:00 1:00 D +Rule Phil 1937 only - Feb 1 0:00 0 S +Rule Phil 1954 only - Apr 12 0:00 1:00 D +Rule Phil 1954 only - Jul 1 0:00 0 S +Rule Phil 1978 only - Mar 22 0:00 1:00 D +Rule Phil 1978 only - Sep 21 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Manila -15:56:00 - LMT 1844 + 8:04:00 - LMT 1899 May 11 + 8:00 Phil P%sT 1942 May + 9:00 - JST 1944 Nov + 8:00 Phil P%sT + +# Qatar +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah + 4:00 - GST 1972 Jun + 3:00 - AST + +# Saudi Arabia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Riyadh 3:06:52 - LMT 1950 + 3:00 - AST + +# Singapore +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Singapore 6:55:24 - LMT 1880 + 6:55 - SMT 1905 Jun + 7:00 - SGT 1933 + 7:20 - SGT 1942 Feb 15 + 9:00 - JST 1945 Sep 2 + 7:20 - SGT 1950 + 7:30 - SGT 1982 May + 8:00 - SGT + +# Sri Lanka +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Colombo 5:19:24 - LMT 1880 + 5:20 - JMT 1906 + 5:30 - IST 1942 Jan 5 + 5:30 0:30 IHST 1942 Sep + 5:30 1:00 IST 1945 Oct 16 2:00 + 5:30 - IST + +# Syria +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Syria 1920 only - Jan 1 0:00 0 - +Rule Syria 1920 1923 - Apr Sun>=15 2:00 1:00 " DST" +Rule Syria 1920 1923 - Oct Sun>=1 2:00 0 - +Rule Syria 1962 only - Apr 29 2:00 1:00 " DST" +Rule Syria 1962 only - Oct 1 2:00 0 - +Rule Syria 1963 1965 - May 1 2:00 1:00 " DST" +Rule Syria 1963 only - Sep 30 2:00 0 - +Rule Syria 1964 only - Oct 1 2:00 0 - +Rule Syria 1965 only - Sep 30 2:00 0 - +Rule Syria 1966 only - Apr 24 2:00 1:00 " DST" +Rule Syria 1966 1976 - Oct 1 2:00 0 - +Rule Syria 1967 1978 - May 1 2:00 1:00 " DST" +Rule Syria 1977 1978 - Sep 1 2:00 0 - +Rule Syria 1983 1984 - Apr 9 2:00 1:00 " DST" +Rule Syria 1983 1984 - Oct 1 2:00 0 - +Rule Syria 1986 only - Feb 16 2:00 1:00 " DST" +Rule Syria 1986 only - Oct 9 2:00 0 - +Rule Syria 1987 only - Mar 1 2:00 1:00 " DST" +Rule Syria 1987 1988 - Oct 31 2:00 0 - +Rule Syria 1988 only - Mar 15 2:00 1:00 " DST" +Rule Syria 1989 only - Mar 31 2:00 1:00 " DST" +Rule Syria 1989 only - Oct 1 2:00 0 - +Rule Syria 1990 max - Apr 1 2:00 1:00 " DST" +Rule Syria 1990 max - Sep 30 2:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Damascus 2:25:12 - LMT 1920 + 2:00 Syria EET%s + +# Tajikistan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2 + 5:00 - TSK 1957 Mar + 6:00 Russia TS%s + +# Thailand +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Bangkok 6:42:04 - LMT 1880 + 6:42 - BMT 1920 Apr + 7:00 - ICT + +# Turkmenistan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Ashkhabad 3:53:32 - LMT 1924 May 2 + 4:00 - ASK 1957 Mar + 5:00 Russia AS%s + +# United Arab Emirates +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Dubai 3:41:12 - LMT 1920 + 4:00 - GST + +# Uzbekistan +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2 + 5:00 - TSK 1957 Mar + 6:00 Russia TS%s + +# Vietnam +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Saigon's official name is Thanh-Pho Ho Chi Minh, but it's too long. +# We'll stick with the traditional name for now. +# From Shanks (1991): +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Saigon 7:06:40 - LMT 1906 Jun 9 + 7:06 - SMT 1911 Mar 11 0:01 # Saigon MT + 7:00 - ICT 1912 May + 8:00 - ICT 1931 May + 7:00 - ICT + +# Yemen +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Asia/Aden 3:00:48 - LMT 1950 + 3:00 - AST diff --git a/time/australasia b/time/australasia new file mode 100644 index 0000000000..f9cde459e6 --- /dev/null +++ b/time/australasia @@ -0,0 +1,783 @@ +# @(#)australasia 7.21 +# This file also includes Pacific islands. + +# Notes are at the end of this file + +############################################################################### + +# Australia + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Aus 1895 only - Jan 1 0:00 0 - +# Shanks gives 1917 Jan 1 0:01; go with Whitman (and guess 2:00). +Rule Aus 1916 only - Oct 1 2:00 1:00 - +Rule Aus 1917 only - Mar 25 2:00 0 - +Rule Aus 1942 only - Jan 1 2:00 1:00 - +Rule Aus 1942 only - Mar 29 2:00 0 - +Rule Aus 1942 only - Sep 27 2:00 1:00 - +Rule Aus 1943 1944 - Mar lastSun 2:00 0 - +Rule Aus 1943 only - Oct 3 2:00 1:00 - +# Whitman says W Australia didn't use DST in 1943/1944, and that +# 1944/1945 was just like 1943/1944; go with Shanks. + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Northern Territory +Zone Australia/Darwin 8:43:20 - LMT 1895 Feb + 9:30 - CST 1917 Jan 1 0:01 + 9:30 Aus CST +# Western Australia +Zone Australia/Perth 7:43:24 - LMT 1895 Dec + 8:00 - WST 1917 Jan 1 0:01 + 8:00 Aus WST 1974 Oct lastSun 2:00 + 8:00 1:00 WST 1975 Mar Sun>=1 3:00 + 8:00 - WST 1983 Oct lastSun 2:00 + 8:00 1:00 WST 1984 Mar Sun>=1 3:00 + 8:00 - WST 1991 Nov 17 2:00 + 8:00 1:00 WST 1992 Mar Sun>=1 3:00 + 8:00 - WST +# Queensland +Zone Australia/Brisbane 10:12:08 - LMT 1895 + 10:00 - EST 1917 Jan 1 0:01 + 10:00 Aus EST 1971 Oct lastSun 2:00 + 10:00 1:00 EST 1972 Feb lastSun 3:00 + 10:00 - EST 1989 Oct lastSun 2:00 + 10:00 1:00 EST 1990 Mar Sun>=1 3:00 + 10:00 - EST 1990 Oct lastSun 2:00 + 10:00 1:00 EST 1991 Mar Sun>=1 3:00 + 10:00 - EST 1991 Oct lastSun 2:00 + 10:00 1:00 EST 1992 Mar Sun>=1 3:00 + 10:00 - EST + +# South Australia +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule AS 1971 1985 - Oct lastSun 2:00 1:00 - +Rule AS 1986 only - Oct 19 2:00 1:00 - +Rule AS 1987 max - Oct lastSun 2:00 1:00 - +Rule AS 1972 only - Feb 27 3:00 0 - +Rule AS 1973 1985 - Mar Sun>=1 3:00 0 - +Rule AS 1986 1989 - Mar Sun>=15 3:00 0 - +Rule AS 1990 1994 even Mar Sun>=18 3:00 0 - +Rule AS 1990 1994 odd Mar Sun>=1 3:00 0 - +Rule AS 1995 max - Mar lastSun 3:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Adelaide 9:14:20 - LMT 1895 Feb + 9:00 - CST 1899 May + 9:30 - CST 1917 Jan 1 0:01 + 9:30 Aus CST 1971 Oct lastSun 2:00 + 9:30 AS CST + +# Tasmania +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule AT 1967 only - Oct 1 2:00 1:00 - +Rule AT 1968 only - Mar 31 3:00 0 - +Rule AT 1968 1985 - Oct lastSun 2:00 1:00 - +Rule AT 1969 1971 - Mar Sun>=8 3:00 0 - +Rule AT 1972 only - Feb 27 3:00 0 - +Rule AT 1973 1981 - Mar Sun>=1 3:00 0 - +Rule AT 1982 1983 - Mar lastSun 3:00 0 - +Rule AT 1984 1986 - Mar Sun>=1 3:00 0 - +Rule AT 1986 only - Oct 19 2:00 1:00 - +Rule AT 1987 1990 - Mar Sun>=15 3:00 0 - +Rule AT 1987 1990 - Oct lastSun 2:00 1:00 - +Rule AT 1991 max - Oct Sun>=1 2:00 1:00 - +Rule AT 1991 max - Mar lastSun 3:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Hobart 9:49:16 - LMT 1895 Sep + 10:00 - EST 1917 Jan 1 0:01 + 10:00 Aus EST 1967 Oct 1 2:00 + 10:00 AT EST + +# Victoria +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule AV 1971 1985 - Oct lastSun 2:00 1:00 - +Rule AV 1972 only - Feb 27 3:00 0 - +Rule AV 1973 1985 - Mar Sun>=1 3:00 0 - +Rule AV 1986 1990 - Mar Sun>=15 3:00 0 - +Rule AV 1986 only - Oct 19 2:00 1:00 - +Rule AV 1987 max - Oct lastSun 2:00 1:00 - +Rule AV 1991 1994 - Mar Sun>=1 3:00 0 - +Rule AV 1995 max - Mar lastSun 3:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Melbourne 9:39:52 - LMT 1895 Feb + 10:00 - EST 1917 Jan 1 0:01 + 10:00 Aus EST 1971 Oct 31 2:00 + 10:00 AV EST + +# New South Wales +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule AN 1971 1985 - Oct lastSun 2:00 1:00 - +Rule AN 1972 only - Feb 27 3:00 0 - +Rule AN 1973 1985 - Mar Sun>=1 3:00 0 - +Rule AN 1986 1989 - Mar Sun>=15 3:00 0 - +Rule AN 1986 only - Oct 19 2:00 1:00 - +Rule AN 1987 max - Oct lastSun 2:00 1:00 - +Rule AN 1990 max - Mar Sun>=1 3:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Sydney 10:04:52 - LMT 1895 Feb + 10:00 - EST 1917 Jan 1 0:01 + 10:00 Aus EST 1971 Oct 31 2:00 + 10:00 AN EST +Zone Australia/Broken_Hill 9:25:48 - LMT 1895 Feb + 10:00 - EST 1896 Aug 23 + 9:00 - CST 1899 May + 9:30 - CST 1917 Jan 1 0:01 + 9:30 Aus CST 1971 Oct 31 2:00 + 9:30 AN CST + +# Australian Capital Territory +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Canberra 9:56:32 - LMT 1895 Feb + 10:00 - EST 1917 Jan 1 0:01 + 10:00 Aus EST 1971 Oct 31 2:00 + 10:00 AN EST 1981 Oct 25 2:00 + 10:00 1:00 EST 1982 Apr 4 3:00 + 10:00 AN EST + +# Australian miscellany +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb + 10:00 - EST 1981 Mar + 10:30 AN LHST +Zone Indian/Christmas 7:02:52 - LMT 1895 Feb + 7:00 - JVT +# +# Ashmore Is, Cartier +# no information; probably like Australia/Perth +# +# Macquarie, Manihiki, Penrhyn, Rakehanga +# no information + + +# Cook Is +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Cook 1978 only - Nov 12 0:00 0:30 HD +Rule Cook 1979 max - Mar Sun>=1 0:00 0 H +Rule Cook 1979 max - Oct lastSun 0:00 0:30 HD +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua + -10:30 - CIST 1978 Nov 12 # Cook Is ST + -10:00 Cook T%sT + +# Cocos +# From USNO (1989): +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Indian/Cocos 6:30 - CCT + +# Fiji +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva + 12:00 - NZST + +# French Polynesia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct # Rikitea + -9:00 - GBT +Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct + -9:30 - MQT +Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete + -10:00 - THT + +# Guam +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Guam 9:39:00 - LMT 1901 # Agana + 10:00 - GST + +# Howland, Baker +# no information; probably like Pacific/Samoa + +# Jarvis +# no information; probably like Pacific/Kiritimati + +# Johnston +# no information; probably like Pacific/Honolulu + +# Kiribati +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki + 12:00 - NZST +Zone Pacific/Enderbury -11:24:20 - LMT 1901 + -12:00 - KJT 1979 Oct + -11:00 - SST +Zone Pacific/Kiritimati -10:29:20 - LMT 1901 + -10:40 - LIT 1979 Oct # Line Is Time + -10:00 - THT + +# Nauru +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe + 11:30 - NST 1942 Mar 15 + 9:00 - JST 1944 Aug 15 + 11:30 - NST 1979 May + 12:00 - NZST + +# New Caledonia +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule NC 1912 only - Jan 13 0:00 0 S +Rule NC 1977 1978 - Dec Sun>=1 0:00 1:00 D +Rule NC 1978 1979 - Feb 27 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 + 11:00 NC NC%sT + + +############################################################################### + +# New Zealand + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule NZ 1868 only - Jan 1 0:00 0 S +# Shanks gives 1927 Nov 6 - 1928 Mar 4, 1928 Oct 14 - 1929 Mar 17, +# 1929 Oct 13 - 1930 Mar 16; go with Whitman. +Rule NZ 1927 only - Nov 26 2:00 1:00 D +Rule NZ 1928 1929 - Mar Sun>=1 2:00 0 S +Rule NZ 1928 only - Nov 4 2:00 1:00 D +Rule NZ 1929 only - Oct 30 2:00 1:00 D +Rule NZ 1930 1933 - Mar Sun>=15 2:00 0 S +Rule NZ 1930 1933 - Oct Sun>=8 2:00 1:00 D +# Shanks says DST stopped 1940 Sep lastSun; go with Whitman for war years. +Rule NZ 1934 1944 - Apr lastSun 2:00 0 S +Rule NZ 1934 1944 - Sep lastSun 2:00 1:00 D +Rule NZ 1974 only - Nov 3 2:00s 1:00 D +Rule NZ 1975 1988 - Oct lastSun 2:00s 1:00 D +Rule NZ 1989 only - Oct 8 2:00s 1:00 D +Rule NZ 1990 max - Oct Sun>=1 2:00s 1:00 D +Rule NZ 1975 only - Feb 23 2:00s 0 S +Rule NZ 1976 1989 - Mar Sun>=1 2:00s 0 S +Rule NZ 1990 max - Mar Sun>=15 2:00s 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Auckland 11:39:04 - LMT 1868 + # Shanks gives 1940 Sep 29 2:00; + # go with Whitman. + 11:30 NZ NZ%sT 1945 Apr 29 2:00 + 12:00 NZ NZ%sT +Zone Pacific/Chatham 12:45 - NZ-CHAT + + +# Antipodes Is, Kermadec Is +# no information; probably like Pacific/Auckland + +############################################################################### + + +# Niue +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Niue -11:19:40 - LMT 1901 # Alofi + -11:20 - NIT 1951 # Niue I Time + -11:30 - NIT 1978 Oct 1 + -11:00 - SST + +# Norfolk +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston + 11:12 - NMT 1951 + 11:30 - NRFT + +# Pacific Islands Trust Territories +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - NCST 1969 Oct + 12:00 - NZST +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - NCST 1969 Oct + -12:00 - KJT 1993 Aug 20 + 12:00 - NZST +Zone Pacific/Truk 10:07:08 - LMT 1901 + 10:00 - GST 1978 Oct + 11:00 - NCST +Zone Pacific/Ponape 10:33:00 - LMT 1901 + 11:00 - NCST +Zone Pacific/Yap 9:12:24 - LMT 1901 + 9:00 - PLT 1969 Oct + 10:00 - GST + +# Palau +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror + 9:00 - PLT + +# Palmyra +# no information; probably like Pacific/Kiritmati + +# Papua New Guinea +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Port_Moresby 9:48:40 - LMT 1880 + 9:49 - PMMT 1895 + 10:00 - EST + +# Pitcairn +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Pitcairn -8:40:20 - LMT 1901 # Adamstown + -8:30 - PIT + +# Solomon Is +# excludes Bougainville, for which see Papua New Guinea +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara + 11:00 - NCST + +# Tokelau Is +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Fakaofo -11:24:56 - LMT 1901 + -10:00 - THT + +# Tonga +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Tongatapu 12:19:20 - LMT 1901 + 12:20 - TMT 1968 Oct + 13:00 - TGT + +# Tuvalu +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Funafuti 11:56:52 - LMT 1901 + 12:00 - NZST + +# Vanuatu +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Vanuatu 1912 only - Jan 13 0:00 0 S +Rule Vanuatu 1983 only - Sep 25 0:00 1:00 D +Rule Vanuatu 1984 max - Mar Sun>=23 0:00 0 S +Rule Vanuatu 1984 only - Oct 23 0:00 1:00 D +Rule Vanuatu 1985 max - Sep Sun>=23 0:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila + 11:00 - NCST + +# Wake +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Wake 11:06:28 - LMT 1901 + 12:00 - NZST + +# Wallis and Futuna +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Wallis 12:15:20 - LMT 1901 + 12:00 - NZST + +# Western Samoa +# See Pacific/Samoa in the `northamerica' file, of all places. + +############################################################################### + +# NOTES + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (August 18, 1994): +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where noted, it is the source for the data above. +# +# Another source occasionally used is Edward W. Whitman, World Time Differences, +# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which +# I found in the UCLA library. +# +# A reliable and entertaining source about time zones is +# Derek Howse, Greenwich time and the discovery of the longitude, +# Oxford University Press (1980). +# +# I invented the abbreviations marked `*' in the following table; +# the rest are from earlier versions of this file, or from other sources. +# Corrections are welcome! +# std dst +# LMT Local Mean Time +# 6:30 CCT Cocos* +# 7:00 JVT Java* +# 8:00 WST WST Western Australia +# 9:00 JST Japan +# 9:00 PLT Palau* +# 9:30 CST CST Central Australia +# 10:00 EST EST Eastern Australia +# 10:00 GST Guam* +# 10:30 LHST LHST Lord Howe* +# 11:00 NCST NCDT New Caledonia* +# 11:30 NRFT Norfolk* +# 12:00 NZST NZDT New Zealand +# 12:45 NZ-CHAT Chatham +# 13:00 TGT Tongatapu* +# -12:00 KJT Kwajalein (no longer used)* +# -11:00 SST Samoa +# -10:40 LIT Line Is (no longer used)* +# -10:00 THT Tahiti* +# - 9:30 MQT Marquesas* +# - 9:00 GBT Gambier* +# - 8:30 PIT Pitcairn* +# +# See the `northamerica' file for Hawaii and Samoa. +# See the `southamerica' file for Easter I and the Galapagos Is. +# +# See the `africa' file for Zone naming conventions. + +############################################################################### + +# Australia + +# From John Mackin (March 6, 1991): +# We in Australia have _never_ referred to DST as `daylight' time. +# It is called `summer' time. Now by a happy coincidence, `summer' +# and `standard' happen to start with the same letter; hence, the +# abbreviation does _not_ change... +# The legislation does not actually define abbreviations, at least +# in this State, but the abbreviation is just commonly taken to be the +# initials of the phrase, and the legislation here uniformly uses +# the phrase `summer time' and does not use the phrase `daylight +# time'. +# Announcers on the Commonwealth radio network, the ABC (for Australian +# Broadcasting Commission), use the phrases `Eastern Standard Time' +# or `Eastern Summer Time'. (Note, though, that as I say in the +# current australasia file, there is really no such thing.) Announcers +# on its overseas service, Radio Australia, use the same phrases +# prefixed by the word `Australian' when referring to local times; +# time announcements on that service, naturally enough, are made in UTC. + +# From Arthur David Olson (March 8 1992): +# Given the above, what's chosen for year-round use is: +# CST for any place operating at a GMTOFF of 9:30 +# WST for any place operating at a GMTOFF of 8:00 +# EST for any place operating at a GMTOFF of 10:00 + +# From Paul Eggert (November 8, 1994): +# Shanks reports 2:00 for all autumn changes in Australia and New Zealand. +# Mark Prior <mrp@itd.adelaide.edu.au> writes that his newspaper +# reports that NSW's fall 1995 change will occur at 2:00, +# but Robert Elz says it's been 3:00 in Victoria since 1970 +# and perhaps the newspaper's `2:00' is referring to standard time. +# And Robert Uzgalis <buz@cs.aukuni.ac.nz> says that the New Zealand Daylight +# Savings Time Order in Council dated 1990-06-18 specifies 2:00 standard +# time on both the first Sunday in October and the third Sunday in March. +# For now we'll continue to assume 3:00 for changes since 1970. + +# Northern Territory + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The NORTHERN TERRITORY.. [ Courtesy N.T. Dept of the Chief Minister ] +# # [ Nov 1990 ] +# # N.T. have never utilised any DST due to sub-tropical/tropical location. +# ... +# Zone Australia/North 9:30 - CST + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# the Northern Territory do[es] not have daylight saving. + +# Western Australia + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of WESTERN AUSTRALIA.. [ Courtesy W.A. dept Premier+Cabinet ] +# # [ Nov 1990 ] +# # W.A. suffers from a great deal of public and political opposition to +# # DST in principle. A bill is brought before parliament in most years, but +# # usually defeated either in the upper house, or in party caucus +# # before reaching parliament. +# ... +# Zone Australia/West 8:00 AW %sST +# ... +# Rule AW 1974 only - Oct lastSun 2:00 1:00 D +# Rule AW 1975 only - Mar Sun>=1 3:00 0 W +# Rule AW 1983 only - Oct lastSun 2:00 1:00 D +# Rule AW 1984 only - Mar Sun>=1 3:00 0 W + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# Western Australia...do[es] not have daylight saving. + +# From John D. Newman via Bradley White (November 2, 1991): +# Western Australia is still on "winter time". Some DH in Sydney +# rang me at home a few days ago at 6.00am. (He had just arrived at +# work at 9.00am.) +# W.A. is switching to Summer Time on Nov 17th just to confuse +# everybody again. + +# From Arthur David Olson (March 8, 1992): +# The 1992 ending date used in the rules is a best guess; +# it matches what was used in the past. + +# Queensland +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (December 24, 1989): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (March 6, 1991): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (March 8, 1992): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (March 8, 1992): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + +# South Australia, Tasmania, Victoria + +# From Arthur David Olson (March 8, 1992): +# The rules from version 7.1 follow. +# There are lots of differences between these rules and +# the Shepherd et al. rules. Since the Shepherd et al. rules +# and Bradley White's newspaper article are in agreement on +# current DST ending dates, no worries. +# +# Rule Oz 1971 1985 - Oct lastSun 2:00 1:00 - +# Rule Oz 1986 max - Oct Sun<=24 2:00 1:00 - +# Rule Oz 1972 only - Feb 27 3:00 0 - +# Rule Oz 1973 1986 - Mar Sun>=1 3:00 0 - +# Rule Oz 1987 max - Mar Sun<=21 3:00 0 - +# Zone Australia/Tasmania 10:00 Oz EST +# Zone Australia/South 9:30 Oz CST +# Zone Australia/Victoria 10:00 Oz EST 1985 Oct lastSun 2:00 +# 10:00 1:00 EST 1986 Mar Sun<=21 3:00 +# 10:00 Oz EST + +# From Robert Elz (March 6, 1991): +# I believe that the current start date for DST is "lastSun" in Oct... +# that changed Oct 89. That is, we're back to the +# original rule, and that rule currently applies in all the states +# that have dst, incl Qld. (Certainly it was true in Vic). +# The file I'm including says that happened in 1988, I think +# that's incorrect, but I'm not 100% certain. + +# South Australia + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# ...South Australia...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of SOUTH AUSTRALIA....[ Courtesy of S.A. Dept of Labour ] +# # [ Nov 1990 ] +# ... +# Zone Australia/South 9:30 AS %sST +# ... +# Rule AS 1971 max - Oct lastSun 2:00 1:00 D +# Rule AS 1972 1985 - Mar Sun>=1 3:00 0 C +# Rule AS 1986 1990 - Mar Sun<=21 3:00 0 C +# Rule AS 1991 max - Mar Sun>=1 3:00 0 C + +# From Bradley White (March 11, 1992): +# Recent correspondence with a friend in Adelaide +# contained the following exchange: "Due to the Adelaide Festival, +# South Australia delays setting back our clocks for a few weeks." + +# From Robert Elz (March 13, 1992): +# I heard that apparently (or at least, it appears that) +# South Aus will have an extra 3 weeks daylight saving every even +# numbered year (from 1990). That's when the Adelaide Festival +# is on... + +# From Robert Elz (March 16, 1992, 00:57:07 +1000): +# DST didn't end in Adelaide today (yesterday).... +# But whether it's "4th Sunday" or "2nd last Sunday" I have no idea whatever... +# (it's just as likely to be "the Sunday we pick for this year"...). + +# From Bradley White (April 11, 1994): +# If Sun, 15 March, 1992 was at +1030 as kre asserts, but yet Sun, 20 March, +# 1994 was at +0930 as John Connolly's customer seems to assert, then I can +# only conclude that the actual rule is more complicated.... + +# From John Warburton <jwarb@SACBH.com.au> (1994-10-07): +# The new Daylight Savings dates for South Australia ... +# was gazetted in the Government Hansard on Sep 26 1994.... +# start on last Sunday in October and end in last sunday in March. + +# Tasmania + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# ...Tasmania will revert to Australian Eastern Standard Time on March 31... + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of TASMANIA.. [Courtesy Tasmanian Dept of Premier + Cabinet ] +# # [ Nov 1990 ] +# ... +# Zone Australia/Tasmania 10:00 AT %sST +# ... +# Rule AT 1967 only - Oct Sun>=1 2:00 1:00 D +# Rule AT 1968 only - Mar lastSun 3:00 0 E +# Rule AT 1968 1985 - Oct lastSun 2:00 1:00 D +# Rule AT 1969 1971 - Mar Sun>=8 3:00 0 E +# Rule AT 1972 only - Feb lastSun 3:00 0 E +# Rule AT 1973 1981 - Mar Sun>=1 3:00 0 E +# Rule AT 1982 1983 - Mar lastSun 3:00 0 E +# Rule AT 1984 1986 - Mar Sun>=1 3:00 0 E +# Rule AT 1986 only - Oct Sun>=15 2:00 1:00 D +# Rule AT 1987 1990 - Mar Sun>=15 3:00 0 E +# Rule AT 1987 only - Oct Sun>=22 2:00 1:00 D +# Rule AT 1988 1990 - Oct lastSun 2:00 1:00 D +# Rule AT 1991 max - Oct Sun>=1 2:00 1:00 D +# Rule AT 1991 max - Mar lastSun 3:00 0 E + +# From Bill Hart via Alexander Dupuy and Guy Harris (October 10, 1991): +# My state Government in there eagerness to get a few more bucks for the +# tourist industry industry decided to change the daylight savings times +# yet again (we now have almost 6 months per year)... +# ... +# Rule Oz 1986 1990 - Oct Sun<=24 2:00 1:00 - +# Rule Oz 1991 max - Oct Sun>=1 2:00 1:00 - +# ... +# Rule Oz 1987 1990 - Mar Sun<=21 3:00 0 - +# Rule Oz 1991 max - Mar Sun<=31 3:00 0 - + +# From Bill Hart via Guy Harris (October 10, 1991): +# Oh yes, the new daylight savings rules are uniquely tasmanian, we have +# 6 weeks a year now when we are out of sync with the rest of Australia +# (but nothing new about that). + +# Victoria + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# ...Victoria...[has] agreed to end daylight saving at 3am tomorrow (March 3)... + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of VICTORIA.. [ Courtesy of Vic. Dept of Premier + Cabinet ] +# # [ Nov 1990 ] +# ... +# Zone Australia/Victoria 10:00 AV %sST +# ... +# Rule AV 1971 1985 - Oct lastSun 2:00 1:00 D +# Rule AV 1972 only - Feb lastSun 3:00 0 E +# Rule AV 1973 1985 - Mar Sun>=1 3:00 0 E +# Rule AV 1986 1990 - Mar Sun>=15 3:00 0 E +# Rule AV 1986 1987 - Oct Sun>=15 2:00 1:00 D +# Rule AV 1988 max - Oct lastSun 2:00 1:00 D +# Rule AV 1991 max - Mar Sun>=1 3:00 0 E + +# New South Wales + +# From Arthur David Olson: +# New South Wales and subjurisdictions have their own ideas of a fun time. +# Based on law library research by John Mackin (john@basser.cs.su.oz), +# who notes: +# In Australia, time is not legislated federally, but rather by the +# individual states. Thus, while such terms as ``Eastern Standard Time'' +# [I mean, of course, Australian EST, not any other kind] are in common +# use, _they have NO REAL MEANING_, as they are not defined in the +# legislation. This is very important to understand. +# I have researched New South Wales time only... + +# From Dave Davey (March 3, 1990): +# Rule NSW 1988 only - Mar Sun>=1 3:00 0 - +# Rule NSW 1989 only - Mar Sun<=21 3:00 0 - + +# From Bradley White (March 4, 1991): +# A recent excerpt from an Australian newspaper... +# NSW...[has] agreed to end daylight saving at 3am tomorrow (March 3)... + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The state of NEW SOUTH WALES.. [confirmed by Attorney General's Dept N.S.W] +# # [ Dec 1990 ] +# ... +# Rule AN 1988 1989 - Mar Sun<=21 3:00 0 E +# ... + +# From John Mackin (March 9, 1991) +# I have confirmed the accuracy of the historical data for NSW in the +# file Robert forwarded + +# From Arthur David Olson (March 8, 1992): +# Sources differ on whether DST ended March 6 or March 20 in 1988; +# March 20 (the "confirmed" date) is in the chosen rules. + +# Yancowinna + +# From John Basser (January 4, 1989): +# `Broken Hill' means the County of Yancowinna. + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # YANCOWINNA.. [ Confirmation courtesy of Broken Hill Postmaster ] +# # [ Dec 1990 ] +# ... +# # Yancowinna uses Central Standard Time, despite it's location on the +# # New South Wales side of the S.A. border. Most business and social dealings +# # are with CST zones, therefore CST is legislated by local government +# # although the switch to Summer Time occurs in line with N.S.W. There have +# # been years when this did not apply, but the historical data is not +# # presently available. +# Zone Australia/Yancowinna 9:30 AY %sST +# ... +# Rule AY 1971 1985 - Oct lastSun 2:00 1:00 D +# Rule AY 1972 only - Feb lastSun 3:00 0 C +# [followed by other Rules] + +# Lord Howe Island + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# LHI... [ Courtesy of Pauline Van Winsen.. pauline@Aus ] +# [ Dec 1990 ] +# Lord Howe Island is located off the New South Wales coast, and is half an +# hour ahead of NSW time. + +############################################################################### + +# New Zealand, from Elz' asia 1.1 +# Elz says "no guarantees" + +# From Mark Davies (October 3, 1990): +# the 1989/90 year was a trial of an extended "daylight saving" period. +# This trial was deemed successful and the extended period adopted for +# subsequent years (with the addition of a further week at the start). +# source -- phone call to Ministry of Internal Affairs Head Office. + +# From George Shepherd via Simon Woodhead via Robert Elz (March 6, 1991): +# # The Country of New Zealand (Australia's east island -) Gee they hate that! +# # or is Australia the west island of N.Z. +# # [ courtesy of Geoff Tribble.. Geofft@Aus.. Auckland N.Z. ] +# # [ Nov 1990 ] +# ... +# Rule NZ 1974 1988 - Oct lastSun 2:00 1:00 D +# Rule NZ 1989 max - Oct Sun>=1 2:00 1:00 D +# Rule NZ 1975 1989 - Mar Sun>=1 3:00 0 S +# Rule NZ 1990 max - Mar lastSun 3:00 0 S +# ... +# Zone NZ 12:00 NZ NZ%sT # New Zealand +# Zone NZ-CHAT 12:45 - NZ-CHAT # Chatham Island + +# From Arthur David Olson (March 8, 1992): +# The chosen rules use the Davies October 8 values for the start of DST in 1989 +# rather than the October 1 value. + +############################################################################### + +# Fiji + +# Howse writes (p 162) that in 1879 the British governor of Fiji +# enacted an ordinance standardizing the islands on +12:00. +# Perhaps it didn't take. We go with Shanks's more precise date in 1915. + +# Kwajalein + +# In comp.risks 14.87 (26 August 1993), Peter Neumann writes: +# I wonder what happened in Kwajalein, where there was NO Friday, +# August 20, 1993. Thursday night at midnight Kwajalein switched sides with +# respect to the International Date Line, to rejoin its fellow islands, +# going from 11:59 p.m. Thursday to 12:00 m. Saturday in a blink. + +# Pacific Islands Trust Territories + +# Howse writes (p 162) ``The Spaniards, on the other hand, reached the +# Philippines and the Ladrones from America,'' and implies that the Ladrones +# (now called the Marianas) kept American date for quite some time. +# Ignore this for now, as we have no hard data. See also Asia/Manila. diff --git a/time/backward b/time/backward new file mode 100644 index 0000000000..9298788b30 --- /dev/null +++ b/time/backward @@ -0,0 +1,75 @@ +# @(#)backward 7.6 + +# This file provides links between late-1993-vintage names for time zones +# and their previous names. + +Link Australia/Sydney Australia/ACT +Link Australia/Lord_Howe Australia/LHI +Link Australia/Sydney Australia/NSW +Link Australia/Darwin Australia/North +Link Australia/Brisbane Australia/Queensland +Link Australia/Adelaide Australia/South +Link Australia/Hobart Australia/Tasmania +Link Australia/Melbourne Australia/Victoria +Link Australia/Perth Australia/West +Link Australia/Broken_Hill Australia/Yancowinna +Link America/Porto_Acre Brazil/Acre +Link America/Noronha Brazil/DeNoronha +Link America/Sao_Paulo Brazil/East +Link America/Manaus Brazil/West +Link America/Halifax Canada/Atlantic +Link America/Winnipeg Canada/Central +Link America/Regina Canada/East-Saskatchewan +Link America/Montreal Canada/Eastern +Link America/Edmonton Canada/Mountain +Link America/St_Johns Canada/Newfoundland +Link America/Vancouver Canada/Pacific +Link America/Regina Canada/Saskatchewan +Link America/Whitehorse Canada/Yukon +Link America/Santiago Chile/Continental +Link Pacific/Easter Chile/EasterIsland +Link America/Havana Cuba +Link Africa/Cairo Egypt +Link Europe/Dublin Eire +Link Europe/London GB +Link Etc/GMT GMT +Link Etc/GMT+0 GMT+0 +Link Etc/GMT-0 GMT-0 +Link Etc/GMT0 GMT0 +Link Etc/Greenwich Greenwich +Link Asia/Hong_Kong Hongkong +Link Atlantic/Reykjavik Iceland +Link Asia/Tehran Iran +Link Asia/Tel_Aviv Israel +Link America/Jamaica Jamaica +Link Asia/Tokyo Japan +Link Pacific/Kwajalein Kwajalein +Link Africa/Tripoli Libya +Link America/Tijuana Mexico/BajaNorte +Link America/Mazatlan Mexico/BajaSur +Link America/Mexico_City Mexico/General +Link Pacific/Auckland NZ +Link Pacific/Chatham NZ-CHAT +Link Asia/Shanghai PRC +Link Europe/Warsaw Poland +Link Europe/Lisbon Portugal +Link Asia/Taipei ROC +Link Asia/Seoul ROK +Link Asia/Singapore Singapore +Link Europe/Istanbul Turkey +Link Etc/UCT UCT +Link America/Anchorage US/Alaska +Link America/Atka US/Aleutian +Link America/Phoenix US/Arizona +Link America/Chicago US/Central +Link America/Fort_Wayne US/East-Indiana +Link America/New_York US/Eastern +Link Pacific/Honolulu US/Hawaii +Link America/Knox_IN US/Indiana-Starke +Link America/Detroit US/Michigan +Link America/Denver US/Mountain +Link America/Los_Angeles US/Pacific +Link Pacific/Samoa US/Samoa +Link Etc/UTC UTC +Link Etc/Universal Universal +Link Etc/Zulu Zulu diff --git a/time/clocktest.c b/time/clocktest.c new file mode 100644 index 0000000000..0a248aa181 --- /dev/null +++ b/time/clocktest.c @@ -0,0 +1,16 @@ +#include <stdio.h> +#include <time.h> + +main () +{ + volatile int i; + double t1, t2, t; + + t1 = (double) clock (); + for (i = 0; i < 100000; ++i) ; + t2 = (double) clock (); + + t = (t2 - t1) / ((double) CLOCKS_PER_SEC); + printf ("%f - %f = %f\n",t2,t1,t); + return 0; +} diff --git a/time/ctime.c b/time/ctime.c new file mode 100644 index 0000000000..24f565d006 --- /dev/null +++ b/time/ctime.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#undef __OPTIMIZE__ /* Avoid inline `ctime' function. */ +#include <time.h> + +#undef ctime + + +/* Return a string as returned by asctime which + is the representation of *T in that form. */ +char * +DEFUN(ctime, (t), CONST time_t *t) +{ + register struct tm *tp = localtime(t); + if (tp == NULL) + return NULL; + return asctime(tp); +} diff --git a/time/date.c b/time/date.c new file mode 100644 index 0000000000..2bb5c71b37 --- /dev/null +++ b/time/date.c @@ -0,0 +1,49 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + + +/* Prints the date in the form "Day Mon dd hh:mm:ss ZZZ yyyy\n". + A simple test for localtime and strftime. */ +int +DEFUN(main, (argc, argv), int argc AND char **argv) +{ + time_t t = time(NULL); + register struct tm *tp = localtime(&t); + register char good = tp != NULL; + + if (good) + { + char buf[BUFSIZ]; + good = strftime(buf, sizeof(buf), "%a %b %d %X %Z %Y", tp); + if (good) + puts(buf); + else + perror("strftime"); + } + else + perror("localtime"); + + exit(good ? EXIT_SUCCESS : EXIT_FAILURE); + return(good ? EXIT_SUCCESS : EXIT_FAILURE); +} diff --git a/time/difftime.c b/time/difftime.c new file mode 100644 index 0000000000..49c5bfbc5c --- /dev/null +++ b/time/difftime.c @@ -0,0 +1,66 @@ +/* Copyright (C) 1991, 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <time.h> + + +/* Return the difference between TIME1 and TIME0. */ +double +DEFUN(difftime, (time1, time0), time_t time1 AND time_t time0) +{ + /* Algorithm courtesy Paul Eggert (eggert@twinsun.com). */ + + time_t delta, hibit; + + if (sizeof (time_t) < sizeof (double)) + return (double) time1 - (double) time0; + if (sizeof (time_t) < sizeof (LONG_DOUBLE)) + return (LONG_DOUBLE) time1 - (LONG_DOUBLE) time0; + + if (time1 < time0) + return - difftime (time0, time1); + + /* As much as possible, avoid loss of precision by computing the + difference before converting to double. */ + delta = time1 - time0; + if (delta >= 0) + return delta; + + /* Repair delta overflow. */ + hibit = 1; + while ((hibit <<= 1) > 0) + continue; + + /* The following expression rounds twice, which means the result may not + be the closest to the true answer. For example, suppose time_t is + 64-bit signed int, long_double is IEEE 754 double with default + rounding, time1 = 9223372036854775807 and time0 = -1536. Then the + true difference is 9223372036854777343, which rounds to + 9223372036854777856 with a total error of 513. But delta overflows to + -9223372036854774273, which rounds to -9223372036854774784, and + correcting this by subtracting 2 * (long_double) hibit (i.e. by adding + 2**64 = 18446744073709551616) yields 9223372036854776832, which rounds + to 9223372036854775808 with a total error of 1535 instead. This + problem occurs only with very large differences. It's too painful to + fix this portably. We are not alone in this problem; many C compilers + round twice when converting large unsigned types to small floating + types, so if time_t is unsigned the "return delta" above has the same + double-rounding problem. */ + return delta - 2 * (LONG_DOUBLE) hibit; +} diff --git a/time/dysize.c b/time/dysize.c new file mode 100644 index 0000000000..1f8f624556 --- /dev/null +++ b/time/dysize.c @@ -0,0 +1,26 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <time.h> + +int +dysize (year) + int year; +{ + return __isleap (year) ? 366 : 365; +} diff --git a/time/emkdir.c b/time/emkdir.c new file mode 100644 index 0000000000..5cc62d29e2 --- /dev/null +++ b/time/emkdir.c @@ -0,0 +1,85 @@ +#ifndef lint +#ifndef NOID +static char elsieid[] = "@(#)emkdir.c 8.23"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +#ifndef emkdir + +/*LINTLIBRARY*/ + +#include "private.h" + +extern char * imalloc P((int n)); +extern void ifree P((char * p)); + +static char * +quoted(name) +register const char * name; +{ + register char * result; + register char * cp; + register int c; + + if (name == NULL) + name = ""; + result = imalloc((int) (4 * strlen(name) + 3)); + if (result == NULL) + return NULL; + cp = result; +#ifdef unix + *cp++ = '\''; + while ((c = *name++) != '\0') + if (c == '\'') { + *cp++ = c; + *cp++ = '\\'; + *cp++ = c; + *cp++ = c; + } else *cp++ = c; + *cp++ = '\''; +#endif /* defined unix */ +#ifndef unix + while ((c = *name++) != '\0') + if (c == '/') + *cp++ = '\\'; + else *cp++ = c; +#endif /* !defined unix */ + *cp = '\0'; + return result; +} + +int +emkdir(name, mode) +const char * name; +const int mode; +{ + register int result; + register const char * format; + register char * command; + register char * qname; + + if ((qname = quoted(name)) == NULL) + return -1; +#ifdef unix + format = "mkdir 2>&- %s && chmod 2>&- %o %s"; +#endif /* defined unix */ +#ifndef unix + format = "mkdir %s"; +#endif /* !defined unix */ + command = imalloc((int) (strlen(format) + 2 * strlen(qname) + 20 + 1)); + if (command == NULL) { + ifree(qname); + return -1; + } + (void) sprintf(command, format, qname, mode, qname); + ifree(qname); + result = system(command); + ifree(command); + return (result == 0) ? 0 : -1; +} + +/* +** UNIX was a registered trademark of UNIX System Laboratories in 1993. +*/ + +#endif /* !defined emkdir */ diff --git a/time/etcetera b/time/etcetera new file mode 100644 index 0000000000..ed619aecfa --- /dev/null +++ b/time/etcetera @@ -0,0 +1,54 @@ +# @(#)etcetera 7.4 + +# All of these are set up just so people can "zic -l" to a timezone +# that's right for their area, even if it doesn't have a name or DST rules +# (half hour zones are too much to bother with -- when someone asks!) + +Zone Etc/GMT 0 - GMT +Link Etc/GMT Etc/UTC +Link Etc/GMT Etc/UCT +Link Etc/GMT Etc/Universal +Link Etc/GMT Etc/Greenwich +Link Etc/GMT Etc/Zulu +Link Etc/GMT Etc/GMT-0 +Link Etc/GMT Etc/GMT+0 +Link Etc/GMT Etc/GMT0 + +# We use POSIX-style signedness in the names and output, +# internal-style signedness in the specifications. +# For example, TZ=Etc/GMT+4 corresponds to 4 hours _behind_ GMT; +# it is equivalent to TZ=GMT+4, which is implemented directly as per POSIX. + +# Earlier incarnations of this package were not POSIX-compliant, +# and had lines such as +# Zone GMT-12 -12 - GMT-1200 +# We did not want things to change quietly if someone accustomed to the old +# way does a +# zic -l GMT-12 +# so we moved the names into the Etc subdirectory. + +Zone Etc/GMT-13 13 - GMT-13 # 12 hours ahead of GMT, plus DST +Zone Etc/GMT-12 12 - GMT-12 +Zone Etc/GMT-11 11 - GMT-11 +Zone Etc/GMT-10 10 - GMT-10 +Zone Etc/GMT-9 9 - GMT-9 +Zone Etc/GMT-8 8 - GMT-8 +Zone Etc/GMT-7 7 - GMT-7 +Zone Etc/GMT-6 6 - GMT-6 +Zone Etc/GMT-5 5 - GMT-5 +Zone Etc/GMT-4 4 - GMT-4 +Zone Etc/GMT-3 3 - GMT-3 +Zone Etc/GMT-2 2 - GMT-2 +Zone Etc/GMT-1 1 - GMT-1 +Zone Etc/GMT+1 -1 - GMT+1 +Zone Etc/GMT+2 -2 - GMT+2 +Zone Etc/GMT+3 -3 - GMT+3 +Zone Etc/GMT+4 -4 - GMT+4 +Zone Etc/GMT+5 -5 - GMT+5 +Zone Etc/GMT+6 -6 - GMT+6 +Zone Etc/GMT+7 -7 - GMT+7 +Zone Etc/GMT+8 -8 - GMT+8 +Zone Etc/GMT+9 -9 - GMT+9 +Zone Etc/GMT+10 -10 - GMT+10 +Zone Etc/GMT+11 -11 - GMT+11 +Zone Etc/GMT+12 -12 - GMT+12 diff --git a/time/europe b/time/europe new file mode 100644 index 0000000000..a802cfec8c --- /dev/null +++ b/time/europe @@ -0,0 +1,2072 @@ +# @(#)europe 7.17 + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where otherwise noted, it is the source for the data below. +# +# Another source occasionally used is Edward W. Whitman, World Time Differences, +# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which +# I found in the UCLA library. +# +# I invented the abbreviations marked `*' in the following table; +# the rest are from earlier versions of this file, or from other sources. +# The starred Russian names are dubious. Corrections are welcome! +# std dst +# LMT Local Mean Time +# LST Local Star Time (Russian ``mestnoe zvezdnoe vremya'') +# -4:00 AST Atlantic +# -3:00 WGT+DST Western Greenland* +# -2:00 MGT+DST Middle Greenland* +# -1:00 EGT+DST Eastern Greenland* +# -1:00 ACT+DST Azores and Canaries* +# -1:00 IST IDT Iceland (no longer used)* +# 0:00 GMT BST Greenwich, British Summer +# 0:00 WET+DST Western Europe +# 1:00 MET+DST Middle Europe +# 2:00 EET+DST Eastern Europe +# 3:00 MSK MSD Moscow +# 3:00 TUR+DST Turkey (no longer used)* +# 4:00 KSK KSD Kuybyshev* +# 5:00 ESK ESD Yekaterinburg* +# 6:00 OSK OSD Omsk* +# 6:00 NSK NSD Novosibirsk (was 7:00 until 1994) +# 7:00 TSK TSD Tomsk* +# 8:00 ISK ISD Irkutsk* +# 9:00 YSK YSD Yakutsk* +# 10:00 VSK VSD Vladivostok* +# 11:00 GSK GSD Magadan* +# 12:00 PSK PSD Petropavlovsk-Kamchatski* +# 13:00 ASK ASD Anadyr* +# +# See the `africa' file for Zone naming conventions. +# +# A reliable and entertaining source about time zones, especially in Britain, +# is Derek Howse, Greenwich time and the discovery of the longitude, +# Oxford University Press (1980). + +# From Andrew A. Chernov <ache@astral.msk.su> (November 12, 1993): +# LST is Local Star Time (``mestnoe zvezdnoe vremya''). + +# From Peter Ilieve <peter@memex.co.uk> (December 4, 1994), +# The original six [EU members]: Belguim, France, (West) Germany, Italy, +# Luxembourg, the Netherlands. +# Plus, from 1 Jan 73: Denmark, Ireland, United Kingdom. +# Plus, from 1 Jan 81: Greece. +# Plus, from 1 Jan 86: Spain, Portugal. +# Plus, from 1 Jan 95: Austria, Finland, Sweden. (Norway negotiated terms for +# entry but in a referendum on 28 Nov 94 the people voted No by 52.2% to 47.8% +# on a turnout of 88.6%. This was almost the same result as Norway's previous +# referendum in 1972, they are the only country to have said No twice. +# Referendums in the other three countries voted Yes.) +# ... +# The only [current nonmember using EU rules] I can speak for is Estonia, +# which uses EU dates but not at 01:00 GMT, they use midnight GMT. I don't +# think they know yet what they will do from 1996 onwards. +# ... +# There shouldn't be any [current members who are not using EU rules]. +# A Directive has the force of law, member states are obliged to enact +# national law to implement it. The only contentious issue was the +# different end date for the UK and Ireland, and this was always allowed +# in the Directive. + +############################################################################### + +# United Kingdom + +# From Peter Ilieve <peter@memex.co.uk> (July 6, 1994): +# +# On 17 Jan 1994 the Independent, a UK quality newspaper, had a piece about +# historical vistas along the Thames in west London. There was a photo +# and a sketch map showing some of the sightlines involved. One paragraph +# of the text said: +# +# `An old stone obelisk marking a forgotten terrestrial meridian stands +# beside the river at Kew. In the 18th century, before time and longditude +# was standardised by the Royal Observatory in Greenwich, scholars observed +# this stone and the movement of stars from Kew Observatory nearby. They +# made their calculations and set the time for the Horse Guards and Parliament, +# but now the stone is obscured by scrubwood and can only be seen by walking +# along the towpath within a few yards of it.' +# +# I have a one inch to one mile map of London and my estimate of the stone's +# position is 51 deg. 28' 30" N, 0 deg. 18' 45" W. The longditude should +# be within about +-2". The Ordnance Survey grid reference is TQ172761. +# +# [This yields GMTOFF = -0:01:15 for London LMT in the 18th century.] + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# +# Howse writes that Britain was the first country to use standard time. +# The railways cared most about the inconsistencies of local mean time, +# and it was they who forced a uniform time on the country. +# The original idea was credited to Dr. William Hyde Wollaston (1766-1828); +# it was popularized in 1840 by Capt. Basil Hall, RN (1788-1844), +# famed explorer and former Commissioner for Longitude. +# The first railway to adopt London time was the Great Western Railway +# in November 1840; other railways followed suit, and by 1847 most +# (though not all) railways used London time. On 1847 Sep 22 the +# Railway Clearing House, an industry standards body, recommended that GMT be +# adopted at all stations; the January 1848 Bradshaw's lists most major +# railways as using GMT. By 1855 the vast majority of public +# clocks in Britain were set to GMT (though some, like the Great Clock +# in Tom Tower at Christ Church, Oxford, were fitted with two minute hands, +# one for local time and one for GMT). The last major holdout was the legal +# system, which stubbornly stuck to local time for many years, leading +# to oddities like polls opening at 08:13 and closing at 16:13. +# The legal system finally switched to GMT when the Statutes (Definition +# of Time) Act took effect; it received the Royal Assent on 1880 Aug 2. +# +# In the tables below, we condense this complicated story into a single +# transition date for London, namely 1847 Sep 22. We don't know as much +# about Dublin, so we use 1880 Aug 2, the legal transition time. + +# From Arthur David Olson (January 19, 1989): +# +# A source at the British Information Office in New York avers that it's +# known as "British" Summer Time in all parts of the United Kingdom. + +# Date: 4 Jan 89 08:57:25 GMT (Wed) +# From: Jonathan Leffler <nih-csl!uunet!mcvax!sphinx.co.uk!john> +# [British Summer Time] is fixed annually by Act of Parliament. +# If you can predict what Parliament will do, you should be in +# politics making a fortune, not computing. + +# From Peter Ilieve <peter@memex.co.uk> (September 3, 1993): +# +# Our Government...couldn't...make a decision after the 1989 consultation +# exercise about the UK changing its timezone so it just let things drift +# (different from deciding to keep the status quo). According to the +# Summer Time Order 1992 (SI 1992/1729) the dates of Summer Time for 1993 +# and 1994 are: +# Start End +# 1993 28 March 24 October +# 1994 27 March 23 October +# All start and end times are at 01:00 GMT. +# +# There [was] an error in your tables for the start and end times prior to 1981. +# The UK always used to change at 02:00 GMT. In 1981 it changed to 01:00 GMT +# as a part of EC harmonisation and has remained at that time since. +# +# I have found the default algorithm for UK Summer Time, it is in the +# Summer Time Act 1972. Section 1 states that in the absence of an Order +# in Council Summer Time starts at 02:00 GMT on the morning of the day +# after the third Saturday in March, unless that day is Easter Day, in +# which case it is the morning of the day after the second Saturday. +# It ends at 02:00 GMT on the morning of the day after the fourth Saturday +# in October. (All the redundant `morning of the day ...' is in the Act.) +# This is only of passing interest now as it will always be overridden by +# an Order in Council (a Statutary Instrument, the SI thing mentioned above) +# to specify the EC specified dates. + +# From Peter Ilieve <peter@memex.co.uk> (October 18, 1993): +# +# My contact in the Ministry of Defence Public Relations department +# accepted the challenge of looking into this and produced the following, +# from Hansard (the official record of the UK Parliament), Oral Answers, +# 1 March 1945, cols 1559--60: +# +# `58. Major Sir Goronwy Owen asked the Secretary of State for the Home +# Department if he is now able to state the Government's proposals +# regarding double summer time. +# +# [two other similar questions omitted] +# +# Mr. H. Morrison: The Government, in reviewing the matter, have +# considered, [...] the conclusion has been reached that the adoption of +# double summer time from the beginning of April is essential to the +# maintenance of the war effort. [...] As 1st April is Easter Sunday, +# when very early services are held in many churches, it is proposed that +# double summer time shall start not in the night preceding Easter +# Sunday, but in the night of Sunday- Monday so that it will operate from +# Monday, 2nd April.' + +# From Peter Ilieve <peter@memex.co.uk> (September 3, 1993): +# +# > # Current rules +# > Rule GB-Eire 1981 max - Mar lastSun 1:00s 1:00 BST +# > Rule GB-Eire 1981 max - Oct Sun>=23 1:00s 0 GMT +# +# The ending rule here doesn't match the EC rules, which specify the fourth +# Sunday in October for the UK and Eire. The `fourth Sunday' rule wasn't +# followed in 1989, but then the sixth EC directive wasn't in force then +# and I don't know what previous ones said. 1995 is the next year with +# the 4th Sun on 22 Oct, but that year isn't covered by the UK Summer Time +# Order or the sixth EC directive. Your Oct Sun>=23 rule matches history +# and with things only announced for 2 years or so in advance who knows +# what will happen. +# +# There are renewed rumours that the Government here will make another +# attempt at resolving this issue, which is what prompted me to start +# asking the Home Office and the EC about it again. The EC categorically +# state they are not asking anybody to change timezone, they only want +# common start/end dates. The UK Govt. seem to want to change our zone +# and blame the resulting fuss on the EC. Me, I think we should scrap +# summer time completely, noon is when the Sun is overhead, and that should +# be the end of it. + +# From Peter Ilieve <peter@memex.co.uk> (October 22, 1993): +# +# I now have the text of the Summer Time Act 1916, the granddaddy of them all. +# It is headed: `An Act to provide for the Time in Great Britain and Ireland +# being in advance of Greenwich and Dublin mean time respectively in the +# summer months'. +# +# It specifies 21 May and 1 October for 1916 (both at 02:00 GMT) and whatever +# dates an Order in Council may specify for subsequent years. +# +# Section 4 states: `This act shall apply to Ireland in like manner as it +# applies to Great Britain, with the substitution however of references +# to Dublin mean time for references to Greenwich mean time.' +# +# Lorna, my learned legal friend who supplied it, also offers this quote +# from Halsbury's Statutes on the extent of Acts: +# +# `An Act of the United Kingdom Parliament is to be construed prima facie +# to apply to the whole of the United Kingdom and not to any place outside. +# [...] The expression "United Kingdom" for this purpose includes (since +# 1922) Great Britain (ie. England, Wales and Scotland) and Northern Ireland, +# but it does not include the Channel Islands or the Isle of Man.' +# +# She goes on to say the seminal event of 1922 was the establishment of +# the Irish Free State, now called Eire. +# +# The Act doesn't say anything about Wales (or Scotland) so I would assert +# that Shanks is wrong here. I would like to know why he thinks Wales +# was different. +# +# It also confirms the fact that Ireland followed Dublin time back then, +# and 25 minutes behind Greenwich, as Shanks has it, would be correct. + +# From Peter Ilieve <peter@memex.co.uk> (October 28, 1993): +# +# I now have before me, thanks to my learned legal friend Lorna, the text of +# the Time (Ireland) Act 1916. +# +# It says that as from 2 AM Dublin Mean Time on 1 October 1916 the time +# for general purposes in Ireland shall be the same as the rest of Great +# Britain (ie. GMT with the Summer Time periods specified by the Summer Time +# Act 1916).... As Ireland was behind GMT/BST at 02:00 DMT on 1 Oct GB would +# have already put the clocks back. Using DST as Dublin Summer Time the +# sequence would have been: +# Dublin London +# 02:34 DST 02:59 BST +# 02:35 DST 02:00 GMT +# 02:59 DST 02:24 GMT +# 02:25 GMT 02:25 GMT +# with the transition 03:00 DST -> 02:00 DMT -> 02:25 GMT all at once. +# +# In a table of repeals in the Schedule to the Act it mentions the +# Statutes (Definition of Time) Act 1880. This is presumably the source +# of the 1880 date in Shanks. The little bit of it that is repealed +# also refers solely to Ireland and Dublin Mean Time. + +# From Peter Ilieve <peter@memex.co.uk> (October 29, 1993): +# +# My case is that, with the sole exception of Ireland in 1916 using Dublin +# Mean Time, Summer Time has been uniform throughout the United Kingdom +# ever since it first started in 1916. +# +# The United Kingdom is England, Wales and Scotland plus all of Ireland from +# 1916 up to and including 1921, or plus Northern Ireland from 1922 to date. +# +# The dates used are those specified in the table in Summer Time: A Consultation +# Document (Cm 722, 1989) that are now included in the europe file, with a +# change to a single date, the start in 1924. I made a typo in my 1989 mail +# and the table itself is also wrong. The correct date is 13 April. +# The times were 02:00 GMT up to and including 1980, 01:00 GMT from 1981 on, +# except for wartime double summer time. +# +# As evidence I would cite: +# +# - The Summer Time Act, 1916. +# +# This specifically states that it applies to Ireland, specifies dates of +# 21 May and 1 October and times of 02:00, and says that in Ireland the +# times relate to Dublin mean time. It specifies an offset of 1 hour. +# +# - The Time (Ireland) Act, 1916 +# +# This abolishes Dublin mean time on 02:00 DMT 1 October 1916. +# It repeals that section of the Statutes (Definition of Time) Act, 1880 +# that specifies DMT. It is therefore a safe bet that DMT existed at least +# from 1880 and was the only alternative standard time in the UK. +# +# - The Summer Time Act, 1922 +# +# This specifies an offset of 1 hour and dates of the day after the third +# Saturday in April, unless that be Easter, in which case it is the day after +# the second Saturday, and the day after the third Saturday in September. +# The time is 02:00 GMT. It applied in 1922 and 1923, and longer if Parliament +# so approved. +# +# It specifically states that it applies to Northern Ireland, the Channel +# Islands, and the Isle of Man. +# +# - The Summer Time Act, 1925 +# +# This makes the 1922 Act permanent, with a change to the end date to the +# day after the first Saturday in October. It says nothing about extent, +# so that part of the 1922 Act will still apply. +# +# - The Defence (Summer Time) Regulations, 1939, SR&O 1939 No. 1379 +# [SR&O == Statutary Regulation and Order] +# +# These were made under the Emergency Powers (Defence) Act, 1939. +# It changes the end date to be the day after the third Saturday in November. +# It makes consequential changes to some vehicle lighting legislation, +# which includes the Motor Vehicles and Road Traffic (Northern Ireland) Act, +# 1934, so it seems clear it applies in Northern Ireland. +# +# - An Order in Council amending the The Defence (Summer Time) Regulations, +# 1939, SR&O 1940 No. 1883 +# +# This continues summer time throughout the year after it starts in 1940. +# It says nothing about extent and has no consequential changes. +# +# - An Order in Council amending the The Defence (Summer Time) Regulations, +# 1939, SR&O 1941 No. 476 +# +# This introduces double summer time, starting at 01:00 GMT on the day after +# the first Saturday in May and ending at 01:00 GMT on the day after the +# second Saturday in August, offset another hour from normal summer time, +# which continues throughout the rest of the year. It goes on a lot about +# consequential changes to agricultural wages legislation, and says in part +# `... and in its application to Northern Ireland have effect as +# if for the references to the Agricultural Wages (Regulation) Acts, 1924 and +# 1940, there were substituted references to the Agricultural Wages (Regulation) +# Acts (Northern Ireland), 1939 and 1940, ...'. It also has a similar section +# for Scotland. Both sections substitute the local Agricultural Wages Board +# for the Agricultural Wages Board for England and Wales, showing that +# England and Wales were indivisible. +# +# - An Order in Council amending the The Defence (Summer Time) Regulations, +# 1939, SR&O 1942 No. 506 +# +# This changes the start date of double summer time to the day after the first +# Saturday in April. It says nothing about extent. +# +# - An Order in Council amending the The Defence (Summer Time) Regulations, +# 1939, SR&O 1944 No. 932 +# +# This changed the end date of double summer time to 17 September 1944. +# (I don't have the text of this, just a note of what it did, the text almost +# certainly had the `day after the nth Saturday' form.) +# +# (I am missing whatever regulations there were to change things in 1945 +# and the Summer Time Act, 1947.) +# +# - The British Standard Time Act, 1968 +# +# This came into force on 27 October 1968 and continued summer time throughout +# the year as an experiment until it expired on 31 October 1971. +# There was no double summer time so we didn't have to change the clocks at all. +# It specifically said it applied to Northern Ireland. It also said it +# applied to Jersey, Guernsey and the Isle of Man unless they passed +# measures saying it didn't. +# +# - The Manx Time Act, 1968 +# +# This is an Act of Tynwald (the Isle of Man Parliament) that said that +# henceforth Manx time would be the same as the time in Great Britain. +# +# - The Summer Time Act, 1972 +# +# This specified a reversion to normal summer time behaviour with a start +# date of the day after the third Saturday in March, unless that is Easter, +# when it is the day after the second Saturday, and an end date of the day +# after the fourth Saturday in October. Times are at 02:00 GMT, offset is +# 1 hour. +# +# It has the same wording about extent as the British Standard Time Act, 1968, +# applying to Northern Ireland unconditionally and to Jersey, Guernsey and the +# Isle of Man if they don't do something about it. +# +# (I am missing various Summer Time Orders that modified the 1972 Act to +# harmonise with the EC since 1981. The major change is that the time changes +# to 01:00 GMT.) +# +# - The Summer Time Order, 1992, SI 1992/1729 [SI == Statutary Instrument] +# +# This specifies dates of: +# Start End +# 1993 28 March 24 October +# 1994 27 March 23 October +# All start and end times are at 01:00 GMT.... +# +# - Some text on the extent of Acts, from Halsbury's Statutes +# +# `An Act of the United Kingdom Parliament is to be construed prima facie +# to apply to the whole of the United Kingdom and not to any place outside. +# [...] The expression "United Kingdom" for this purpose includes (since +# 1922) Great Britain (ie. England, Wales and Scotland) and Northern Ireland, +# but it does not include the Channel Islands or the Isle of Man.' +# +# So, many of these measures specifically include Northern Ireland, +# the Channel Islands and the Isle of Man. None of them exclude any +# part of the UK. The default interpretation of Acts is that they apply +# throughout the UK. +# +# With that, I rest my case Milud :-) +# +# Thanks are due to my learned legal friend Lorna Montgomerie, who dug out +# the dusty old statutes, and to Melanie Allison of the Ministry of Defence, +# who provided the wartime regulations and a snippet of Hansard explaining +# why double summer time started on a Monday in 1945 (it was Easter). + +# From Peter Ilieve <peter@memex.co.uk> (November 18, 1993) +# +# Here is a revised version of my tabrules file for the perl script I sent +# before. I have personally verified the various Orders back to 1953 and +# all the Acts. +# +# There are no changes to the dates we already have. +# +# My doubt about an early start in 1967 on 18 Feb was misplaced, the Order +# does say 18 Feb. This is an interesting case as the first Order gave a +# different date of 7 April 1967 for the Isle of Man but this was changed +# before it came into effect by another Order for the Isle of Man alone. +# +# I don't think I will be able to find any more of the earlier Orders. +# The annual volumes for 1949--52 do not contain the various Summer Time +# Orders. They therefore don't appear in the index. They rate a mention in +# italics in the numerical list at the start but that is all. +# I think what happens is that the annual volume is produced well after the +# end of the year in question, by which time the Summer Time Order is spent. +# They assume that nobody would ever be stupid enough to want to see it +# again so they leave it out. +# +# It might be a good idea to put this table, or the output of tabscript +# showing all the moves because of Easter, in the europe file comments in +# place of my old transcription of the Green Paper table [the UK Government +# paper "Summer Time: A Consultation Document" (HMSO Cm722 June 1989)]. +# +# Peter Ilieve peter@memex.co.uk +# +# +# ## control file for tabscript, a program to generate UK summer time dates +# ## matching the table in Cm 722, the 1989 Green Paper. +# ## Lines like this are comments. +# ## Lines with a single # at the start are copied into the output +# ## Control lines are of the form +# ## <years> <start date> <end date> <flags> <double start> <double end> +# ## <years> is either a single year or a hyphen separated range, with -- +# ## also accepted as I use this in TeX a lot. +# ## <start date> and <end date> are a digit followed bu a month name. +# ## It is either an nth Saturday or an explicit date, depending on <flags>. +# ## 0 and/or none are used when there is no date, as during 1968--71. +# ## <flags> can contain `fixed' to indicate explicit dates and `double' +# ## to indicate double summer time dates are present. +# ## At present double requires fixed as well. +# ## <double start> and <double end> are like the start and end dates, with +# ## the exception of the 0 and/or none feature. +# +# ## Blank lines are also ignored. +# +# ## Places where I am uncertain, not having personally verified the dates +# ## against the Act or Order, are marked ??? +# ## These dates are taken from the Cm 722 table. +# +# # Summer Time Act, 1916 +# 1916 21 May 1 October fixed +# +# ## I haven't yet looked for Orders for 1916--22 and I doubt I will find them. +# # unknown Order or Orders ??? +# 1917 8 apr 17 sep fixed +# 1918 24 mar 30 sep fixed +# 1919 30 mar 29 sep fixed +# # end date extended in 1920 from 27 Sep because of coal strike (from Cm 722) +# 1920 28 mar 25 oct fixed +# 1921 3 apr 3 oct fixed +# +# # Summer Time Act, 1922 +# # came into force 22 July 1922, too late for 1922, so missing Order ??? +# 1922 26 mar 8 oct fixed +# 1923-1924 3 April 3 September +# +# # Summer Time Act, 1925 +# 1925--1938 3 April 1 October +# +# # Defence (Summer Time) Regulations, 1939 +# 1939 3 April 3 November +# # 1940 amendment (SR&O 1940 Nos. 172 & 1883) +# 1940 4 feb 0 none +# # 1941 amendment (SR&O 1941 No. 476) +# 1941 0 none 0 none fixed,double 4 may 10 aug +# # 1942 amendment (SR&O 1942 No. 506) +# 1942 0 none 0 none fixed,double 5 apr 9 aug +# 1943 0 none 0 none fixed,double 4 apr 15 aug +# # 1944 amendment (SR&O 1944 No. 932) +# 1944 0 none 0 none fixed,double 2 apr 17 sep +# # 1945 dates from Hansard, Oral Answers, 1 March 1945 +# 1945 0 none 7 oct fixed,double 2 apr 15 jul +# +# # reversion to Summer Time Act, 1925 +# 1946 3 April 1 October +# +# # Summer Time Act, 1947 +# # Fixed dates for 1947 only, gives power to have double summer time +# 1947 16 mar 2 nov fixed,double 13 apr 10 aug +# ## I can't find any trace of the Order for 1948. +# # Unknown Order ??? +# 1948 14 mar 31 oct fixed +# ## I know the numbers for the 1949--52 ones but the text is missing from the +# ## annual volumes. I also don't know if the 49 Order was for 49 or 50, etc. +# # Summer Time Order, 1949 (SI1949/373) ??? +# 1949 3 apr 30 oct fixed +# # Summer Time Order, 1950 (SI1950/518) ??? +# 1950 16 apr 22 oct fixed +# # Summer Time Order, 1951 (SI1951/430) ??? +# 1951 15 apr 21 oct fixed +# # Summer Time Order, 1952 (SI1952/451) ??? +# 1952 20 apr 26 oct fixed +# +# # reversion to Summer Time Act, 1925 +# 1953--1960 3 April 1 October +# +# ## All Orders from here on specify fixed dates, not day after nth Sunday +# ## Start pattern looks like Mar lastSun up to 1963, Mar Sun>=19 up to 1967. +# ## End pattern looks like Oct Sun>=23 up to 1967. +# # Summer Time Order, 1961 (SI1961/71) +# 1961 26 March 29 October fixed +# # Summer Time (1962) Order, 1961 (SI1961/2465) +# 1962 25 Mar 28 Oct fixed +# # Summer Time Order, 1963 (SI1963/81) +# 1963 31 March 27 October fixed +# # Summer Time (1964) Order, 1963 (SI1963/2101) +# 1964 22 March 25 October fixed +# # Summer Time Order, 1964 (SI1964/1201) +# 1965 21 Mar 24 Oct fixed +# 1966 20 Mar 23 Oct fixed +# 1967 19 Mar 29 Oct fixed +# # Summer Time Order, 1967 (SI1967/1148) +# # Specifies different start date of 7 April for Isle of Man +# # Summer Time Order, 1968 (SI1968/117) +# # Changes Isle of Man start date to 18 Feb to match rest of UK +# # British Standard Time Act, 1968 +# 1968 18 feb 0 none fixed +# 1969--1970 0 none 0 none +# 1971 0 none 31 oct fixed +# +# # Summer Time Act, 1972 +# 1972-1980 3 March 4 October +# +# # The pattern here looks like Last Sun in Mar, day after 4th Sat in Oct +# # First EC Directive ??? +# # Summer Time Order, 1980 (SI1980/1089) +# 1981 29 Mar 25 Oct fixed +# 1982 28 Mar 24 Oct fixed +# # Second EC Directive ??? +# # Summer Time Order, 1982 (SI1982/1673) +# 1983 27 Mar 23 Oct fixed +# 1984 25 Mar 28 Oct fixed +# 1985 31 Mar 27 Oct fixed +# # Third EC Directive ??? +# # Summer Time Order, 1986 (SI1986/223) +# 1986 30 Mar 26 Oct fixed +# 1987 29 Mar 25 Oct fixed +# 1988 27 Mar 23 Oct fixed +# # Fourth EC Directive ??? +# # Summer Time Order, 1988 (SI1988/931) +# 1989 26 Mar 29 Oct fixed +# # Fifth EC Directive ??? +# # Summer Time Order, 1989 (SI1989/985) +# 1990 25 Mar 28 Oct fixed +# 1991 31 Mar 27 Oct fixed +# 1992 29 Mar 25 Oct fixed +# # Sixth EC Directive +# # Summer Time Order, 1992 (SI1992/1729) +# 1993 28 Mar 24 Oct fixed +# 1994 27 Mar 23 Oct fixed + +# From Peter Ilieve <peter@memex.co.uk> (August 18, 1994): +# I now have the text of the 7th EC directive on summer time arrangements +# (94/21/EC), which was approved on 30 May.... +# The major changes from existing practice are that 1995 will be the last year +# that the UK and Eire finish on a different date from everyone else, +# and the common end date from 1996 onwards will be the last Sunday in October. +# Year Start End End (UK & Eire, 1995 only) +# (rule) (last Sun) (last Sun) (4th Sun) +# 1995 26 March 24 September 22 October +# 1996 31 March 27 October +# 1997 30 March 26 October +# +# From Peter Ilieve <peter@memex.co.uk> (1994-12-01): +# The final piece of the legislative jigsaw for summer time in the UK for +# 1995-97 is now in place. The Summer Time Order 1994 (SI 1994/2798) +# came into force on 16 November. It restates the dates from the EC +# seventh Summer Time Directive.... + +# From Peter Ilieve <peter@memex.co.uk> (March 28, 1994): +# The UK/Eire end date of 22 October [1995] conflicts with your current rule of +# Oct Sun>=23, and the historical UK formula of Sun after 4th Sat. +# The last time 4th Sun and Sun after 4th Sat differed was in 1989, +# when 29 October was used. That year was covered by a UK Summer Time Order +# for only a single year and it looks as though there was a matching 4th EC +# directive for just this year. I don't have the text of the 5th EC +# directive (for 1990--92) but my guess would be it said 4th Sun. +# To maintain strict historical accuracy you could start a new UK ending rule +# of Oct Sun>=22 in 1990. + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# +# As Ilieve remarks, the date `20 April 1924' in the table of ``Summer Time: A +# Consultation Document'' (Cm 722, 1989) table is a transcription error; +# 20 April was an Easter Sunday. Shanks has 13 April, the correct date. +# Also, the table is not quite right for 1925 through 1938; the correct rules +# (which Shanks uses) are given in the Summer Time Acts of 1922 and 1925. +# Shanks and the UK Government paper disagree about the Apr 1956 transition; +# since we have no other data, and since Shanks was correct in the other +# points of disagreement about London, we'll believe Shanks for now. +# Also, for lack of other data, we'll follow Shanks for Eire in 1940-1948. +# +# Given Peter Ilieve's comments, the following claims by Shanks are incorrect: +# * Wales did not switch from GMT to daylight savings time until +# 1921 Apr 3, when they began to conform with the rest of Great Britain. +# Actually, Wales was identical after 1880. +# * Eire had two transitions on 1916 Oct 1. +# It actually just had one transition. +# * Northern Ireland used single daylight savings time throughout WW II. +# Actually, it conformed to Britain. +# +# The following claim by Shanks is possible though doubtful; +# we'll ignore it for now. +# * Jersey, Guernsey, and the Isle of Man did not switch from GMT +# to daylight savings time until 1921 Apr 3, when they began to +# conform with Great Britain. +# +# Whitman says Dublin Mean Time was -0:25:21, which is more precise than Shanks. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule GB-Eire 1847 only - Sep 22 0:00 0 GMT +# 1916 to 1925--irregular +Rule GB-Eire 1916 only - May 21 2:00s 1:00 BST +Rule GB-Eire 1916 only - Oct 1 2:00s 0 GMT +Rule GB-Eire 1917 only - Apr 8 2:00s 1:00 BST +Rule GB-Eire 1917 only - Sep 17 2:00s 0 GMT +Rule GB-Eire 1918 only - Mar 24 2:00s 1:00 BST +Rule GB-Eire 1918 only - Sep 30 2:00s 0 GMT +Rule GB-Eire 1919 only - Mar 30 2:00s 1:00 BST +Rule GB-Eire 1919 only - Sep 29 2:00s 0 GMT +Rule GB-Eire 1920 only - Mar 28 2:00s 1:00 BST +Rule GB-Eire 1920 only - Oct 25 2:00s 0 GMT +Rule GB-Eire 1921 only - Apr 3 2:00s 1:00 BST +Rule GB-Eire 1921 only - Oct 3 2:00s 0 GMT +Rule GB-Eire 1922 only - Mar 26 2:00s 1:00 BST +Rule GB-Eire 1922 only - Oct 8 2:00s 0 GMT +Rule GB-Eire 1923 only - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1923 1924 - Sep Sun>=16 2:00s 0 GMT +Rule GB-Eire 1924 only - Apr 13 2:00s 1:00 BST +# 1925 to 1939 start--regular, except for avoiding Easter +Rule GB-Eire 1925 1926 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1925 1938 - Oct Sun>=2 2:00s 0 GMT +Rule GB-Eire 1927 only - Apr 10 2:00s 1:00 BST +Rule GB-Eire 1928 1929 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1930 only - Apr 13 2:00s 1:00 BST +Rule GB-Eire 1931 1932 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1933 only - Apr 9 2:00s 1:00 BST +Rule GB-Eire 1934 only - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1935 only - Apr 14 2:00s 1:00 BST +Rule GB-Eire 1936 1937 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1938 only - Apr 10 2:00s 1:00 BST +Rule GB-Eire 1939 only - Apr Sun>=16 2:00s 1:00 BST +# 1939 end to 1947--irregular, and with double summer time +Rule GB-Eire 1939 only - Nov 19 2:00s 0 GMT +Rule GB-Eire 1940 only - Feb 25 2:00s 1:00 BST +Rule GB-Eire 1941 only - May Sun>=2 1:00s 2:00 DST +Rule GB-Eire 1941 1943 - Aug Sun>=9 1:00s 1:00 BST +Rule GB-Eire 1942 1944 - Apr Sun>=2 1:00s 2:00 DST +Rule GB-Eire 1944 only - Sep Sun>=16 1:00s 1:00 BST +# Double daylight starts on a Monday in 1945--see above. +Rule GB-Eire 1945 only - Apr 2 1:00s 2:00 DST +Rule GB-Eire 1945 only - Jul 15 1:00s 1:00 BST +Rule GB-Eire 1945 only - Oct 7 2:00s 0 GMT +Rule GB-Eire 1946 only - Apr 14 2:00s 1:00 BST +Rule GB-Eire 1946 only - Oct 6 2:00s 0 GMT +Rule GB-Eire 1947 only - Mar 16 2:00s 1:00 BST +Rule GB-Eire 1947 only - Apr 13 1:00s 2:00 DST +Rule GB-Eire 1947 only - Aug 10 1:00s 1:00 BST +Rule GB-Eire 1947 only - Nov 2 2:00s 0 GMT +# So much for double saving time. 1948 and 1949, irregular. +Rule GB-Eire 1948 only - Mar 14 2:00s 1:00 BST +Rule GB-Eire 1948 1949 - Oct lastSun 2:00s 0 GMT +Rule GB-Eire 1949 only - Apr 3 2:00s 1:00 BST +# 1950 through start of 1953, regular. +Rule GB-Eire 1950 1953 - Apr Sun>=14 2:00s 1:00 BST +Rule GB-Eire 1950 1952 - Oct Sun>=21 2:00s 0 GMT +# 1954 to 1980, starting rules +Rule GB-Eire 1954 only - Apr 11 2:00s 1:00 BST +Rule GB-Eire 1955 1956 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1957 only - Apr 14 2:00s 1:00 BST +Rule GB-Eire 1958 1959 - Apr Sun>=16 2:00s 1:00 BST +Rule GB-Eire 1960 only - Apr 10 2:00s 1:00 BST +Rule GB-Eire 1961 1963 - Mar lastSun 2:00s 1:00 BST +Rule GB-Eire 1964 1967 - Mar Sun>=19 2:00s 1:00 BST +Rule GB-Eire 1972 1980 - Mar Sun>=16 2:00s 1:00 BST +# 1953 to 1980, ending rules +Rule GB-Eire 1953 1960 - Oct Sun>=1 2:00s 0 GMT +Rule GB-Eire 1961 1967 - Oct Sun>=23 2:00s 0 GMT +Rule GB-Eire 1971 only - Oct 31 3:00 0 GMT +Rule GB-Eire 1972 1980 - Oct Sun>=23 2:00s 0 GMT +# 1981 on +Rule GB-Eire 1981 max - Mar lastSun 1:00s 1:00 BST +Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00s 0 GMT +Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00s 0 GMT +Rule GB-Eire 1996 max - Oct lastSun 1:00s 0 GMT +#Rule GB-Eire 1981 max - Mar lastSun 1:00u 1:00 BST +#Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT +#Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT +#Rule GB-Eire 1996 max - Oct lastSun 1:00u 0 GMT +# Also see W-Eur, which (starting 1996) differs only in LETTER/S. + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/London -0:01:15 - LMT 1847 Sep 22 + 0:00 GB-Eire %s 1968 Feb 18 2:00 + 1:00 - BST 1971 Oct 31 2:00 + 0:00 GB-Eire %s +Zone Europe/Belfast -0:23:40 - LMT 1880 Aug 2 + -0:25:21 - DMT 1916 May 21 2:00 # Dublin MT + -0:25:21 1:00 DST 1916 Oct 1 3:00 + 0:00 GB-Eire %s 1968 Feb 18 2:00 + 1:00 - BST 1971 Oct 31 3:00 + 0:00 GB-Eire %s +Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2 + -0:25:21 - DMT 1916 May 21 2:00 # Dublin MT + -0:25:21 1:00 DST 1916 Oct 1 3:00 + 0:00 GB-Eire %s 1940 Feb 25 2:00 + 0:00 1:00 BST 1946 Oct 6 2:00 + 0:00 - GMT 1947 Mar 16 2:00 + 0:00 1:00 BST 1947 Nov 2 2:00 + 0:00 - GMT 1948 Apr 18 2:00 + 0:00 GB-Eire %s 1968 Feb 18 2:00 + 1:00 - BST 1971 Oct 31 3:00 + 0:00 GB-Eire %s + +############################################################################### + +# Continental Europe + +# The *-Eur rules now correspond to the European Community (EC). +# Three rulesets are used because the EC changes at 01:00 UTC, not local time. +# Older *-Eur rules are for convenience in the tables. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule W-Eur 1800 only - Jan 1 0:00 0 - +Rule W-Eur 1977 1980 - Apr Sun>=1 1:00s 1:00 " DST" +Rule W-Eur 1977 only - Sep lastSun 1:00s 0 - +Rule W-Eur 1978 only - Oct 1 1:00s 0 - +Rule W-Eur 1979 1995 - Sep lastSun 1:00s 0 - +Rule W-Eur 1981 max - Mar lastSun 1:00s 1:00 " DST" +Rule W-Eur 1996 max - Oct lastSun 1:00s 0 - +# Also see GB-Eire, which (starting 1996) differs only in LETTER/S. + +Rule M-Eur 1800 only - Jan 1 0:00 0 - +Rule M-Eur 1916 only - Apr 30 23:00 1:00 " DST" +Rule M-Eur 1916 only - Oct 1 1:00 0 - +Rule M-Eur 1917 1918 - Apr Mon>=15 2:00s 1:00 " DST" +Rule M-Eur 1917 1918 - Sep Mon>=15 2:00s 0 - +Rule M-Eur 1940 only - Apr 1 2:00s 1:00 " DST" +# Shanks says DST was continuous from 1940 Apr 1 to 1942 Nov 2; go with Whitman. +Rule M-Eur 1940 only - Dec 31 2:00s 0 - +Rule M-Eur 1941 only - Feb 25 2:00s 1:00 " DST" +Rule M-Eur 1941 only - Oct 5 2:00s 0 - +Rule M-Eur 1942 only - Jan 1 2:00s 1:00 " DST" +Rule M-Eur 1942 only - Nov 2 2:00s 0 - +Rule M-Eur 1943 only - Mar 29 2:00s 1:00 " DST" +Rule M-Eur 1943 only - Oct 4 2:00s 0 - +Rule M-Eur 1944 only - Apr 3 2:00s 1:00 " DST" +# Whitman gives 1944 Oct 7; go with Shanks. +Rule M-Eur 1944 only - Oct 2 2:00s 0 - +Rule M-Eur 1977 1980 - Apr Sun>=1 2:00s 1:00 " DST" +Rule M-Eur 1977 only - Sep lastSun 2:00s 0 - +Rule M-Eur 1978 only - Oct 1 2:00s 0 - +Rule M-Eur 1979 1995 - Sep lastSun 2:00s 0 - +Rule M-Eur 1981 max - Mar lastSun 2:00s 1:00 " DST" +Rule M-Eur 1996 max - Oct lastSun 2:00s 0 - + +Rule E-Eur 1981 max - Mar lastSun 3:00s 1:00 " DST" +Rule E-Eur 1981 1995 - Sep lastSun 3:00s 0 - +Rule E-Eur 1996 max - Oct lastSun 3:00s 0 - + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Russia 1880 only - Jan 1 0:00 0 - +Rule Russia 1917 only - Jul 1 23:00 1:00 " DST" +Rule Russia 1917 only - Dec 28 0:00 0 - +Rule Russia 1918 only - May 31 22:00 2:00 " DDST" +Rule Russia 1918 only - Sep 17 0:00 1:00 " DST" +Rule Russia 1919 only - May 31 23:00 2:00 " DDST" +Rule Russia 1919 only - Jul 1 2:00 1:00 D +Rule Russia 1919 only - Aug 16 0:00 0 K +Rule Russia 1921 only - Feb 14 23:00 1:00 D +# Shanks gives 1921 Mar 21 for the following transition. +# From Andrew A. Chernov <ache@astral.msk.su> (November 12, 1993): +# My sources says, that it is Mar 20, not 21. +Rule Russia 1921 only - Mar 20 23:00 2:00 DD +Rule Russia 1921 only - Sep 1 0:00 1:00 D +Rule Russia 1921 only - Oct 1 0:00 0 K +Rule Russia 1981 1984 - Apr 1 0:00 1:00 D +Rule Russia 1981 1983 - Oct 1 0:00 0 K +Rule Russia 1984 max - Sep lastSun 2:00s 0 K +Rule Russia 1985 max - Mar lastSun 2:00s 1:00 D + +# These are for backward compatibility with older versions. + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone WET 0:00 W-Eur WET%s +Zone MET 1:00 M-Eur MET%s +Zone EET 2:00 E-Eur EET%s +Zone W-SU 3:00 M-Eur ???? + +# Tom Hoffman says that MET is also known as Central European Time + +Link MET CET + +# Albania +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Albania 1940 only - Jun 16 0:00 1:00 " DST" +Rule Albania 1942 only - Nov 2 3:00 0 - +Rule Albania 1943 only - Mar 29 2:00 1:00 " DST" +Rule Albania 1943 only - Apr 10 3:00 0 - +Rule Albania 1974 only - May 4 0:00 1:00 " DST" +Rule Albania 1974 only - Oct 2 0:00 0 - +Rule Albania 1975 only - May 1 0:00 1:00 " DST" +Rule Albania 1975 only - Oct 2 0:00 0 - +Rule Albania 1976 only - May 2 0:00 1:00 " DST" +Rule Albania 1976 only - Oct 3 0:00 0 - +Rule Albania 1977 only - May 8 0:00 1:00 " DST" +Rule Albania 1977 only - Oct 2 0:00 0 - +Rule Albania 1978 only - May 6 0:00 1:00 " DST" +Rule Albania 1978 only - Oct 1 0:00 0 - +Rule Albania 1979 only - May 5 0:00 1:00 " DST" +Rule Albania 1979 only - Sep 30 0:00 0 - +Rule Albania 1980 only - May 3 0:00 1:00 " DST" +Rule Albania 1980 only - Oct 4 0:00 0 - +Rule Albania 1981 only - Apr 26 0:00 1:00 " DST" +Rule Albania 1981 only - Sep 27 0:00 0 - +Rule Albania 1982 only - May 2 0:00 1:00 " DST" +Rule Albania 1982 only - Oct 3 0:00 0 - +Rule Albania 1983 only - Apr 18 0:00 1:00 " DST" +Rule Albania 1983 only - Oct 1 0:00 0 - +Rule Albania 1984 only - Apr 1 0:00 1:00 " DST" +Rule Albania 1984 only - Oct 1 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Tirane 1:19:20 - LMT 1914 + 1:00 - MET 1940 Jun 16 + 1:00 Albania MET%s 1985 Mar 31 1:00 + 1:00 W-Eur MET%s +# This may change to `M-Eur' soon, for EC compatibility. + +# Andorra +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Andorra 0:06:04 - LMT 1901 + 0:00 - WET 1946 Sep 30 + 1:00 - MET 1985 Mar 31 2:00 + 1:00 M-Eur MET%s + +# Austria +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Austria 1918 only - Jun 16 3:00 0 - +Rule Austria 1920 only - Apr 5 2:00s 1:00 " DST" +Rule Austria 1920 only - Sep 13 2:00s 0 - +Rule Austria 1945 only - Apr 2 2:00s 1:00 " DST" +Rule Austria 1945 only - Nov 18 2:00s 0 - +Rule Austria 1946 only - Apr 14 2:00s 1:00 " DST" +Rule Austria 1946 1948 - Oct Sun>=1 2:00s 0 - +Rule Austria 1947 only - Apr 6 2:00s 1:00 " DST" +Rule Austria 1948 only - Apr 18 2:00s 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Vienna 1:05:20 - LMT 1893 Apr + 1:00 M-Eur MET%s 1918 Jun 16 3:00 + 1:00 Austria MET%s 1940 Apr 1 2:00 + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Austria MET%s 1981 Mar 29 2:00 + 1:00 M-Eur MET%s + +# Belarus +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Minsk 1:50:16 - LMT 1880 + 2:31 Russia LST%s 1919 Jul 1 2:00 + 3:00 Russia MS%s 1922 Oct + 2:00 - EET 1930 Jun 21 + 3:00 Russia MS%s 1991 Mar 31 2:00s +# From Paul Eggert <eggert@twinsun.com> (May 28, 1994): A guess at recent dates: + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s + 2:00 - EET 1992 Jan 19 2:00s + 3:00 Russia MS%s + +# Belgium +# Whitman and Shanks disagree; go with Shanks, usually. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# From Whitman: +Rule Belgium 1919 only - Mar 1 23:00s 1:00 " DST" +Rule Belgium 1919 only - Oct 4 23:00s 0 - +# Shanks gives 1920 Feb 14 23:00s; go with Whitman. +Rule Belgium 1920 1921 - Mar 14 23:00s 1:00 " DST" +Rule Belgium 1920 only - Oct 23 23:00s 0 - +Rule Belgium 1921 only - Oct 25 23:00s 0 - +Rule Belgium 1922 only - Mar 25 23:00s 1:00 " DST" +# Whitman gives 1927 Oct 1 2:00s and 1928 Oct 7 2:00s; go with Shanks. +Rule Belgium 1922 1928 - Oct Sat>=1 23:00s 0 - +Rule Belgium 1923 only - Apr 21 23:00s 1:00 " DST" +Rule Belgium 1924 only - Mar 29 23:00s 1:00 " DST" +Rule Belgium 1925 only - Apr 4 23:00s 1:00 " DST" +Rule Belgium 1926 only - Apr 17 23:00s 1:00 " DST" +Rule Belgium 1927 only - Apr 9 23:00s 1:00 " DST" +Rule Belgium 1928 only - Apr 14 23:00s 1:00 " DST" +Rule Belgium 1929 only - Apr 21 2:00s 1:00 " DST" +Rule Belgium 1929 1938 - Oct Sun>=2 2:00s 0 - +Rule Belgium 1930 only - Apr 13 2:00s 1:00 " DST" +Rule Belgium 1931 only - Apr 19 2:00s 1:00 " DST" +Rule Belgium 1932 only - Apr 17 2:00s 1:00 " DST" +Rule Belgium 1933 only - Mar 26 2:00s 1:00 " DST" +Rule Belgium 1934 only - Apr 8 2:00s 1:00 " DST" +Rule Belgium 1935 only - Mar 31 2:00s 1:00 " DST" +Rule Belgium 1936 only - Apr 19 2:00s 1:00 " DST" +# Whitman says 1937 Apr 18 2:00s; go with Shanks. +Rule Belgium 1937 only - Apr 4 2:00s 1:00 " DST" +# Whitman says 1938 Apr 10 2:00s; go with Shanks. +Rule Belgium 1938 only - Mar 27 2:00s 1:00 " DST" +Rule Belgium 1939 only - Apr 16 2:00s 1:00 " DST" +Rule Belgium 1939 only - Nov 19 2:00s 0 - +Rule Belgium 1945 only - Apr 2 2:00s 1:00 " DST" +Rule Belgium 1945 only - Sep 16 2:00s 0 - +Rule Belgium 1946 only - May 19 2:00s 1:00 " DST" +Rule Belgium 1946 only - Oct 7 2:00s 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Brussels 0:17:20 - LMT 1880 + 0:17 - BST 1892 May 1 12:00 + 0:00 - WET 1914 Aug 4 + 1:00 M-Eur MET%s 1919 Mar 1 23:00 + 0:00 Belgium WET%s 1940 Feb 24 23:00 + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Belgium MET%s 1977 Apr 3 2:00 + 1:00 M-Eur MET%s + +# Bosnia and Herzegovina +# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Sarajevo 1:13:40 - LMT 1884 + 1:00 - MET 1941 Apr 18 23:00 + 1:00 M-Eur MET%s 1945 May 8 2:00s + 1:00 1:00 "MET DST" 1945 Sep 16 2:00s + 1:00 - MET 1983 Mar 27 2:00s + 1:00 M-Eur MET%s + +# Bulgaria +# Part switched from the Julian to the Gregorian calendar on 1915 Nov 14; +# the rest switched on 1920 Sep 17. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Bulg 1979 only - Mar 31 23:00 1:00 " DST" +Rule Bulg 1979 only - Oct 1 1:00 0 - +Rule Bulg 1980 1982 - Apr Sat<=7 23:00 1:00 " DST" +Rule Bulg 1980 only - Sep 29 1:00 0 - +Rule Bulg 1981 only - Sep 27 2:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Sofia 1:33:16 - LMT 1880 + 1:57 - TST 1894 Nov 30 + 2:00 - EET 1942 Nov 2 3:00 + 1:00 M-Eur MET%s 1945 Apr 2 3:00 + 2:00 - EET 1979 Mar 31 23:00 + 2:00 Bulg EET%s 1982 Sep 26 2:00 + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Croatia +# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Zagreb 1:03:52 - LMT 1884 + 1:00 - MET 1941 Apr 18 23:00 + 1:00 M-Eur MET%s 1945 May 8 2:00s + 1:00 1:00 "MET DST" 1945 Sep 16 2:00s + 1:00 - MET 1983 Mar 27 2:00s + 1:00 M-Eur MET%s + +# Czech Republic +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Czech 1944 only - Sep 17 2:00s 0 - +Rule Czech 1945 only - Apr 8 2:00s 1:00 " DST" +Rule Czech 1945 only - Nov 18 2:00s 0 - +Rule Czech 1946 only - May 6 2:00s 1:00 " DST" +Rule Czech 1946 1949 - Oct Sun>=1 2:00s 0 - +Rule Czech 1947 only - Apr 20 2:00s 1:00 " DST" +Rule Czech 1948 only - Apr 18 2:00s 1:00 " DST" +Rule Czech 1949 only - Apr 9 2:00s 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Prague 0:57:44 - LMT 1850 + 0:58 - PMT 1891 Oct # Prague Mean Time + 1:00 M-Eur MET%s 1944 Sep 17 2:00s + 1:00 Czech MET%s 1979 Apr 1 2:00 + 1:00 M-Eur MET%s + +# Denmark +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Denmark 1916 only - May 14 23:00 1:00 " DST" +Rule Denmark 1916 only - Sep 30 23:00 0 - +Rule Denmark 1940 only - May 15 0:00 1:00 " DST" +Rule Denmark 1945 only - Apr 2 2:00s 1:00 " DST" +Rule Denmark 1945 only - Aug 15 2:00s 0 - +Rule Denmark 1946 only - May 1 2:00s 1:00 " DST" +Rule Denmark 1946 only - Sep 1 2:00s 0 - +Rule Denmark 1947 only - May 4 2:00s 1:00 " DST" +Rule Denmark 1947 only - Aug 10 2:00s 0 - +Rule Denmark 1948 only - May 9 2:00s 1:00 " DST" +Rule Denmark 1948 only - Aug 8 2:00s 0 - +# Whitman also gives 1949 Apr 9 to 1949 Oct 1, and disagrees in minor ways +# about many of the above dates; go with Shanks. +# +# For 1894, Shanks says Jan, Whitman Apr; go with Whitman. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Copenhagen 0:50:20 - LMT 1890 + 0:50 - CMT 1894 Apr # Copenhagen Mean Time + 1:00 Denmark MET%s 1942 Nov 2 2:00s + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Denmark MET%s 1980 Apr 6 2:00 + 1:00 M-Eur MET%s +Zone Atlantic/Faeroe -0:27:04 - LMT 1908 Jan 11 # Torshavn + 0:00 - WET 1981 Mar 29 1:00 + 0:00 W-Eur WET%s +Zone America/Scoresbysund -1:29:00 - LMT 1916 Jul 28 + -2:00 - MGT 1980 Apr 6 2:00 + -2:00 M-Eur MGT%s 1981 Mar 29 + -1:00 M-Eur EGT%s +Zone America/Godthab -3:26:56 - LMT 1916 Jul 28 + -3:00 - WGT 1980 Apr 6 2:00 + -3:00 M-Eur WGT%s +Zone America/Thule -4:35:08 - LMT 1916 Jul 28 + -4:00 - AST + +# Estonia +# They switched from the Julian to the Gregorian calendar on 1918 Feb 15. +# +# From Peter Ilieve <peter@memex.co.uk> (1994-10-15): +# A relative in Tallinn confirms the accuracy of the data for 1989 onwards +# [through 1994] and gives the legal authority for it, +# a regulation of the Government of Estonia, No. 111 of 1989.... +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Tallinn 1:39:00 - LMT 1880 + 1:39 - LST 1918 Feb + 1:00 M-Eur MET%s 1919 Jul + 1:39 - LST 1921 May + 2:00 - EET 1940 Aug 6 + 3:00 - MSK 1941 Sep 15 + 1:00 M-Eur MET%s 1944 Sep 22 + 3:00 Russia MS%s 1989 Mar 26 2:00s + 2:00 1:00 "EET DST" 1989 Sep 24 2:00s + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Finland +# +# From Hannu Strang <chs@apu.fi> (25 Sep 1994 06:03:37 UTC): +# Well, here in Helsinki we're just changing from summer time to regular one, +# and it's supposed to change at 4am... +# +# From Paul Eggert <eggert@twinsun.com> (25 Sep 1994): +# Shanks says Finland has switched at 02:00 standard time since 1981. +# Go with Strang instead. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Finland 1921 only - May 1 0:00 0 - +Rule Finland 1942 only - Apr 3 0:00 1:00 " DST" +Rule Finland 1942 only - Oct 3 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Helsinki 1:39:52 - LMT 1878 May 31 + 1:40 - HMT 1921 May # Helsinki Mean Time + 2:00 Finland EET%s 1981 Mar 29 2:00 + 2:00 E-Eur EET%s + +# France +# Shanks seems to use `24:00' ambiguously; we resolve it with Whitman. +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule France 1911 only - Jan 1 0:00 0 - +Rule France 1916 only - Jun 14 23:00s 1:00 " DST" +Rule France 1916 1919 - Oct Sun>=1 0:00 0 - +Rule France 1917 only - Mar 24 23:00s 1:00 " DST" +Rule France 1918 only - Mar 9 23:00s 1:00 " DST" +Rule France 1919 only - Mar 1 23:00s 1:00 " DST" +Rule France 1920 only - Feb 14 23:00s 1:00 " DST" +Rule France 1920 only - Oct 23 23:00s 0 - +Rule France 1921 only - Mar 14 23:00s 1:00 " DST" +Rule France 1921 only - Oct 25 23:00s 0 - +Rule France 1922 only - Mar 25 23:00s 1:00 " DST" +Rule France 1922 1938 - Oct Sat>=1 23:00s 0 - +Rule France 1923 only - May 26 23:00s 1:00 " DST" +Rule France 1924 only - Mar 29 23:00s 1:00 " DST" +Rule France 1925 only - Apr 4 23:00s 1:00 " DST" +Rule France 1926 only - Apr 17 23:00s 1:00 " DST" +Rule France 1927 only - Apr 9 23:00s 1:00 " DST" +Rule France 1928 only - Apr 14 23:00s 1:00 " DST" +Rule France 1929 only - Apr 20 23:00s 1:00 " DST" +Rule France 1930 only - Apr 12 23:00s 1:00 " DST" +Rule France 1931 only - Apr 18 23:00s 1:00 " DST" +Rule France 1932 only - Apr 2 23:00s 1:00 " DST" +Rule France 1933 only - Mar 25 23:00s 1:00 " DST" +Rule France 1934 only - Apr 7 23:00s 1:00 " DST" +Rule France 1935 only - Mar 30 23:00s 1:00 " DST" +Rule France 1936 only - Apr 18 23:00s 1:00 " DST" +Rule France 1937 only - Apr 3 23:00s 1:00 " DST" +Rule France 1938 only - Mar 26 23:00s 1:00 " DST" +Rule France 1939 only - Apr 15 23:00s 1:00 " DST" +Rule France 1939 only - Nov 18 23:00s 0 - +Rule France 1940 only - Feb 25 2:00 1:00 " DST" +# The French rules for 1941-1944 were not used in Paris, +# but were used in other places (e.g. Monaco). +Rule France 1941 only - May 5 0:00 2:00 " DDST" +Rule France 1941 only - Oct 6 1:00 1:00 " DST" +Rule France 1942 only - Mar 8 0:00 2:00 " DDST" +Rule France 1942 only - Nov 2 3:00 1:00 " DST" +Rule France 1943 only - Mar 29 2:00 2:00 " DDST" +Rule France 1943 only - Nov 4 3:00 1:00 " DST" +Rule France 1944 only - Apr 3 2:00 2:00 " DDST" +Rule France 1944 only - Oct 8 1:00 1:00 " DST" +Rule France 1945 only - Apr 2 2:00 2:00 " DDST" +Rule France 1945 only - Sep 16 3:00 0 - +# From Paul Eggert <eggert@twinsun.com) (November 18, 1993): +# Shanks gives no times for 1975, but according to Cm722, +# France introduced summer time in 1975 from 20 March to 22 September. +Rule France 1975 only - Mar 20 2:00s 1:00 " DST" +Rule France 1975 only - Sep 22 2:00s 0 - +Rule France 1976 only - Mar 28 2:00s 1:00 " DST" +Rule France 1976 only - Sep lastSun 2:00s 0 - +# Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Paris 0:09:05 - LMT 1891 Mar 15 0:01 + 0:09:05 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 France WET%s 1940 Jun 14 + 1:00 M-Eur MET%s 1944 Aug 25 + 0:00 France WET%s 1945 Sep 16 3:00 + 1:00 France MET%s 1977 Apr Sun>=1 2:00 + 1:00 M-Eur MET%s + +# Germany +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Germany 1945 only - Apr 2 2:00s 1:00 " DST" +Rule Germany 1945 only - May 24 2:00 2:00 " DDST" +Rule Germany 1945 only - Sep 24 3:00 1:00 " DST" +Rule Germany 1945 only - Nov 18 2:00s 0 - +Rule Germany 1946 only - Apr 14 2:00s 1:00 " DST" +# Whitman gives 1948 Oct 31; go with Shanks. +Rule Germany 1946 1949 - Oct Sun>=1 2:00s 0 - +Rule Germany 1947 only - Apr 6 2:00s 1:00 " DST" +Rule Germany 1947 only - May 11 2:00s 2:00 " DDST" +Rule Germany 1947 only - Jun 29 3:00 1:00 " DST" +Rule Germany 1948 only - Apr 18 2:00s 1:00 " DST" +Rule Germany 1949 only - Apr 10 2:00s 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Berlin 0:53:28 - LMT 1893 Apr + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Germany MET%s 1980 Apr 6 2:00 + 1:00 M-Eur MET%s + +# Gibraltar +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2 + 0:00 GB-Eire %s 1957 Apr 14 2:00 + 1:00 - MET 1982 Mar 28 2:00 + 1:00 M-Eur MET%s + +# Greece +# They adopted the Julian calendar in 1846. +# Part switched to the Gregorian calendar on 1916 Jul 28. +# The rest switched on 1920 Mar 18. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Greece 1916 only - July 28 0:01 0 - +# Whitman gives 1932 Jul 5 - Nov 1; go with Shanks. +Rule Greece 1932 only - Jul 7 0:00 1:00 " DST" +Rule Greece 1932 only - Sep 1 0:00 0 - +# Whitman gives 1941 Apr 25 - ?; go with Shanks. +Rule Greece 1941 only - Apr 7 0:00 1:00 " DST" +# Whitman gives 1942 Feb 2 - ?; go with Shanks. +Rule Greece 1942 only - Nov 2 3:00 0 - +Rule Greece 1943 only - Mar 30 0:00 1:00 " DST" +Rule Greece 1943 only - Oct 4 0:00 0 - +# Whitman gives 1944 Oct 3 - Oct 31; go with Shanks. +Rule Greece 1952 only - Jul 1 0:00 1:00 " DST" +Rule Greece 1952 only - Nov 2 0:00 0 - +Rule Greece 1975 only - Apr 12 0:00s 1:00 " DST" +Rule Greece 1975 only - Nov 26 0:00s 0 - +Rule Greece 1976 only - Apr 11 2:00s 1:00 " DST" +Rule Greece 1976 only - Oct 10 2:00s 0 - +Rule Greece 1977 1978 - Apr Sun>=1 2:00s 1:00 " DST" +Rule Greece 1977 only - Sep 26 2:00s 0 - +Rule Greece 1978 only - Sep 24 4:00 0 - +Rule Greece 1979 only - Apr 1 9:00 1:00 " DST" +Rule Greece 1979 only - Sep 29 2:00 0 - +Rule Greece 1980 only - Apr 1 0:00 1:00 " DST" +Rule Greece 1980 only - Sep 28 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Athens 1:34:52 - LMT 1895 Sep 14 + 1:35 - AMT 1916 Jul 28 0:01 # Athens MT + 2:00 Greece EET%s 1941 Apr 30 + 1:00 Greece MET%s 1944 Apr 4 + 2:00 Greece EET%s 1981 Mar 29 2:00 +# Greece must change by 1996 for EC compatibility. + 2:00 M-Eur EET%s 1996 # Guess the last minute. + 2:00 E-Eur EET%s + +# Hungary +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Hungary 1918 only - Sep 29 2:00s 0 - +Rule Hungary 1919 only - Apr 15 3:00 1:00 " DST" +Rule Hungary 1919 only - Sep 15 3:00 0 - +Rule Hungary 1920 only - Apr 5 3:00 1:00 " DST" +Rule Hungary 1920 only - Sep 30 3:00 0 - +Rule Hungary 1945 only - May 1 23:00 1:00 " DST" +Rule Hungary 1945 only - Nov 3 0:00 0 - +Rule Hungary 1946 only - Mar 31 2:00s 1:00 " DST" +Rule Hungary 1946 1949 - Oct Sun>=1 2:00s 0 - +Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 " DST" +Rule Hungary 1950 only - Apr 17 2:00s 1:00 " DST" +Rule Hungary 1950 only - Oct 23 2:00s 0 - +Rule Hungary 1954 1955 - May 23 0:00 1:00 " DST" +Rule Hungary 1954 1955 - Oct 3 0:00 0 - +Rule Hungary 1956 only - Jun Sun>=1 0:00 1:00 " DST" +Rule Hungary 1956 only - Sep lastSun 0:00 0 - +Rule Hungary 1957 only - Jun Sun>=1 1:00 1:00 " DST" +Rule Hungary 1957 only - Sep lastSun 3:00 0 - +Rule Hungary 1980 only - Apr 6 1:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Budapest 1:16:20 - LMT 1890 Oct + 1:00 M-Eur MET%s 1918 Jul + 1:00 Hungary MET%s 1941 Apr 6 2:00 + 1:00 M-Eur MET%s 1945 May 1 23:00 + 1:00 Hungary MET%s 1980 Sep 28 2:00s + 1:00 M-Eur MET%s + +# Iceland +# +# From Adam David <adam@veda.is> (November 6, 1993): +# The name of the timezone in Iceland for system / mail / news purposes is GMT. +# +# (December 5, 1993): +# This material is paraphrased from the 1988 edition of the University of +# Iceland Almanak. +# +# From January 1st, 1908 the whole of Iceland was standardised at 1 hour +# behind GMT. Previously, local mean solar time was used in different parts +# of Iceland, the almanak had been based on Reykjavik mean solar time which +# was 1 hour and 28 minutes behind GMT. +# +# "first day of winter" referred to [below] means the first day of the 26 weeks +# of winter, according to the old icelandic calendar that dates back to the +# time the norsemen first settled Iceland. The first day of winter is always +# Saturday, but is not dependent on the Julian or Gregorian calendars. +# +# (December 10, 1993): +# I have a reference from the Oxford Icelandic-English dictionary for the +# beginning of winter, which ties it to the ecclesiastical calendar (and thus +# to the julian/gregorian calendar) over the period in question. +# the winter begins on the Saturday next before St. Luke's day +# (old style), or on St. Luke's day, if a Saturday. +# St. Luke's day ought to be traceable from ecclesiastical sources. "old style" +# might be a reference to the Julian calendar as opposed to Gregorian, or it +# might mean something else (???). The Gregorian calendar was not introduced +# in Iceland until 1700. +# +# From Paul Eggert <eggert@twinsun.com> (December 9, 1993): +# The Iceland Almanak, Shanks and Whitman disagree on many points. +# We go with the Almanak, except for one claim from Shanks, namely that +# Reykavik was -1:28 from 1837 to 1908, local mean time before that. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Iceland 1908 only - Jan 1 0:00 0 S +Rule Iceland 1917 1918 - Feb 19 23:00 1:00 D +Rule Iceland 1917 only - Oct 21 1:00 0 S +Rule Iceland 1918 only - Nov 16 1:00 0 S +Rule Iceland 1939 only - Apr 29 23:00 1:00 D +Rule Iceland 1939 only - Nov 29 2:00 0 S +Rule Iceland 1940 only - Feb 25 2:00 1:00 D +Rule Iceland 1940 only - Nov 3 2:00 0 S +Rule Iceland 1941 only - Mar 2 1:00s 1:00 D +Rule Iceland 1941 only - Nov 2 1:00s 0 S +Rule Iceland 1942 only - Mar 8 1:00s 1:00 D +Rule Iceland 1942 only - Oct 25 1:00s 0 S +# 1943-1946 - first Sunday in March until first Sunday in winter +Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 D +Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 S +# 1947-1967 - first Sunday in April until first Sunday in winter +Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 D +# 1949 Oct transition delayed by 1 week +Rule Iceland 1949 only - Oct 30 1:00s 0 S +Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 S +Rule Iceland 1967 only - Oct 29 1:00s 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 + -1:28 - RMT 1908 # Reykjavik Mean Time + -1:00 Iceland I%sT 1968 Apr 7 1:00s + 0:00 - GMT + +# Italy +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Italy 1893 only - Nov 1 0:00s 0 S +# Shanks gives transition times of 1916-1920 as 24:00; go with Whitman. +Rule Italy 1916 only - Jun 3 0:00s 1:00 " DST" +Rule Italy 1916 only - Sep 30 0:00s 0 - +Rule Italy 1917 only - Mar 31 0:00s 1:00 " DST" +Rule Italy 1917 only - Sep 30 0:00s 0 - +Rule Italy 1918 only - Mar 9 0:00s 1:00 " DST" +Rule Italy 1918 1919 - Oct Sun>=1 0:00s 0 - +Rule Italy 1919 only - Mar 1 0:00s 1:00 " DST" +Rule Italy 1920 only - Mar 20 0:00s 1:00 " DST" +# Shanks gives 1920 Sep 18; go with Whitman. +Rule Italy 1920 only - Oct 1 0:00s 0 - +Rule Italy 1940 only - Jun 15 0:00 1:00 " DST" +Rule Italy 1945 only - Apr 2 2:00 1:00 " DST" +Rule Italy 1945 only - Sep 17 0:00 0 - +Rule Italy 1946 only - Mar 17 2:00s 1:00 " DST" +Rule Italy 1946 only - Oct 6 2:00s 0 - +Rule Italy 1947 only - Mar 16 0:00s 1:00 " DST" +Rule Italy 1947 only - Oct 5 0:00s 0 - +Rule Italy 1948 only - Feb 29 2:00s 1:00 " DST" +Rule Italy 1948 only - Oct 3 2:00s 0 - +Rule Italy 1966 1968 - May Sun>=22 0:00 1:00 " DST" +Rule Italy 1966 1969 - Sep Sun>=22 0:00 0 - +Rule Italy 1969 only - Jun 1 0:00 1:00 " DST" +Rule Italy 1970 only - May 31 0:00 1:00 " DST" +Rule Italy 1970 only - Sep lastSun 0:00 0 - +Rule Italy 1971 1972 - May Sun>=22 0:00 1:00 " DST" +Rule Italy 1971 only - Sep lastSun 1:00 0 - +Rule Italy 1972 only - Oct 1 0:00 0 - +Rule Italy 1973 only - Jun 3 0:00 1:00 " DST" +Rule Italy 1973 1974 - Sep lastSun 0:00 0 - +Rule Italy 1974 only - May 26 0:00 1:00 " DST" +Rule Italy 1975 only - Jun 1 0:00s 1:00 " DST" +Rule Italy 1975 1977 - Sep lastSun 0:00s 0 - +Rule Italy 1976 only - May 30 0:00s 1:00 " DST" +Rule Italy 1977 1979 - May Sun>=22 0:00s 1:00 " DST" +Rule Italy 1978 only - Oct 1 0:00s 0 - +Rule Italy 1979 only - Sep 30 0:00s 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Rome 0:49:56 - LMT 1866 Sep 22 + 0:50 - RMT 1893 Nov # Rome Mean Time + 1:00 Italy MET%s 1942 Nov 2 2:00s + 1:00 M-Eur MET%s 1945 Apr 2 2:00s + 1:00 Italy MET%s 1980 Apr 6 2:00 + 1:00 M-Eur MET%s +# Vatican is identical to Europe/Rome; San Marino is like Europe/Rome. + +# Latvia +# They switched from the Julian to the Gregorian calendar on 1918 Feb 15. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Riga 1:36:24 - LMT 1880 + 1:36 - LST 1918 Apr 15 2:00 + 1:36 M-Eur LST%s 1919 Apr 1 2:00 + 1:36 1:00 "LST DST" 1919 May 22 3:00 + 1:36 - LST 1926 May 11 + 2:00 - EET 1940 Aug 5 + 3:00 - MSK 1941 Jul + 1:00 M-Eur MET%s 1944 Aug 8 + 3:00 Russia MS%s 1991 Mar 31 2:00s + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Liechtenstein +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun + 1:00 - MET 1981 Mar 29 2:00 + 1:00 M-Eur MET%s + +# Lithuania +# They switched from the Julian to the Gregorian calendar on 1918 Feb 15. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Vilnius 1:41:16 - LMT 1880 + 1:24 - LST 1917 # Kaunas + 1:36 - LST 1919 Oct 10 + 1:00 - MET 1920 Jul 12 + 2:00 - EET 1920 Oct 9 + 1:00 - MET 1940 Aug 3 + 3:00 - MSK 1941 Jun 24 + 1:00 M-Eur MET%s 1944 Aug + 3:00 Russia MS%s 1991 Mar 31 2:00s + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Luxembourg +# Whitman disagrees with most of these dates in minor ways; go with Shanks. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Lux 1904 only - Jun 1 0:00 0 - +Rule Lux 1916 only - May 14 23:00 1:00 " DST" +Rule Lux 1916 only - Oct 1 1:00 0 - +Rule Lux 1917 only - Apr 28 23:00 1:00 " DST" +Rule Lux 1917 only - Sep 17 1:00 0 - +Rule Lux 1918 only - Apr Mon>=15 2:00s 1:00 " DST" +Rule Lux 1918 only - Sep Mon>=15 2:00s 0 - +Rule Lux 1919 only - Mar 1 23:00 1:00 " DST" +Rule Lux 1919 only - Oct 5 3:00 0 - +Rule Lux 1920 only - Feb 14 23:00 1:00 " DST" +Rule Lux 1920 only - Oct 24 2:00 0 - +Rule Lux 1921 only - Mar 14 23:00 1:00 " DST" +Rule Lux 1921 only - Oct 26 2:00 0 - +Rule Lux 1922 only - Mar 25 23:00 1:00 " DST" +Rule Lux 1922 only - Oct Sun>=2 1:00 0 - +Rule Lux 1923 only - Apr 21 23:00 1:00 " DST" +Rule Lux 1923 only - Oct Sun>=2 2:00 0 - +Rule Lux 1924 only - Mar 29 23:00 1:00 " DST" +Rule Lux 1924 1928 - Oct Sun>=2 1:00 0 - +Rule Lux 1925 only - Apr 5 23:00 1:00 " DST" +Rule Lux 1926 only - Apr 17 23:00 1:00 " DST" +Rule Lux 1927 only - Apr 9 23:00 1:00 " DST" +Rule Lux 1928 only - Apr 14 23:00 1:00 " DST" +Rule Lux 1929 only - Apr 20 23:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun + 1:00 Lux MET%s 1918 Nov 25 + 0:00 Lux WET%s 1929 Oct 6 2:00s + 0:00 Belgium WET%s 1940 May 14 3:00 + 1:00 M-Eur WET%s 1944 Sep 18 3:00 + 1:00 Belgium MET%s 1979 Apr 1 2:00 + 1:00 M-Eur MET%s + +# Macedonia +# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Skopje 1:25:44 - LMT 1884 + 1:00 - MET 1941 Apr 18 23:00 + 1:00 M-Eur MET%s 1945 May 8 2:00s + 1:00 1:00 "MET DST" 1945 Sep 16 2:00s + 1:00 - MET 1983 Mar 27 2:00s + 1:00 M-Eur MET%s + +# Malta +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Malta 1973 only - Mar 31 0:00s 1:00 " DST" +Rule Malta 1973 only - Sep 29 0:00s 0 - +Rule Malta 1974 only - Apr 21 0:00s 1:00 " DST" +Rule Malta 1974 only - Sep 16 0:00s 0 - +Rule Malta 1975 1979 - Apr Sun>=15 2:00 1:00 " DST" +Rule Malta 1975 1980 - Sep Sun>=15 2:00 0 - +Rule Malta 1980 only - Mar 31 2:00 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta + 1:00 Italy MET%s 1942 Nov 2 2:00s + 1:00 M-Eur MET%s 1945 Apr 2 2:00s + 1:00 Italy MET%s 1973 Mar 31 + 1:00 Malta MET%s 1981 Mar 29 2:00s + 1:00 M-Eur MET%s + +# Moldova +# They switched from the Julian to the Gregorian calendar on 1919 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Chisinau 1:55:20 - LMT 1924 May 2 + 2:00 - EET 1930 Jun 21 + 3:00 Russia MS%s 1991 Mar 31 2:00s + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Monaco +# Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15 + 0:09:05 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 France WET%s 1945 Sep 16 3:00 + 1:00 France MET%s 1977 Apr Sun>=1 2:00 + 1:00 M-Eur MET%s + +# Netherlands +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Neth 1892 only - May 1 0:00 0 AMT +# Shanks gives 1916 May 1 0:00 and 1916 Oct 1 0:00; go with Whitman. +Rule Neth 1916 only - May 1 2:00s 1:00 NST +Rule Neth 1916 only - Oct 2 2:00s 0 AMT +Rule Neth 1917 only - Apr 16 2:00s 1:00 NST +Rule Neth 1917 only - Sep 17 2:00s 0 AMT +# Whitman gives 1918 Apr 14, 1918 Oct 31, and 1921 Sep 28; go with Shanks. +Rule Neth 1918 1921 - Apr Mon>=1 2:00s 1:00 NST +Rule Neth 1918 1921 - Sep Mon>=24 2:00s 0 AMT +Rule Neth 1922 only - Mar 26 2:00s 1:00 NST +# Whitman gives 1939 Oct 1; go with Shanks. +Rule Neth 1922 1939 - Oct Sun>=2 2:00s 0 AMT +Rule Neth 1923 only - Jun 1 2:00s 1:00 NST +Rule Neth 1924 only - Mar 30 2:00s 1:00 NST +# Whitman gives 1925 Apr 5; go with Shanks. +Rule Neth 1925 only - Jun 5 2:00s 1:00 NST +# For 1926 through 1930 Whitman gives Apr 15; go with Shanks. +Rule Neth 1926 1931 - May 15 2:00s 1:00 NST +Rule Neth 1932 only - May 22 2:00s 1:00 NST +Rule Neth 1933 1936 - May 15 2:00s 1:00 NST +Rule Neth 1937 only - May 22 2:00s 1:00 NST +# Whitman gives 1939 Apr 15 and 1940 Apr 19; go with Shanks. +Rule Neth 1938 1939 - May 15 2:00s 1:00 NST +Rule Neth 1945 only - Apr 2 2:00s 1:00 - +Rule Neth 1945 only - May 20 2:00s 0 " DST" +# Before 1937, Shanks says just `0:20'; we use Whitman's more precise figure. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Amsterdam 0:19:28 - LMT 1892 May + 0:19:28 Neth %s 1937 Jul + 0:20 Neth %s 1940 May 16 0:40 + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Neth MET%s 1977 Apr Sun>=1 2:00 + 1:00 M-Eur MET%s + +# Norway +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Norway 1892 only - May 1 0:00 0 - +# Whitman gives 1916 May 21 - 1916 Oct 21; go with Shanks. +Rule Norway 1916 only - May 22 1:00 1:00 " DST" +Rule Norway 1916 only - Sep 30 0:00 0 - +# Shanks omits the following transition; go with Whitman. +Rule Norway 1935 only - Aug 11 0:00 1:00 " DST" +# Whitman says DST observed until 1942 Nov 1, then 1943 Mar 29 - Oct 4, +# 1944 Apr 3 - Oct 2, and 1945 Apr 1 - Oct 1; go with Shanks after 1940. +Rule Norway 1945 only - Apr 2 2:00s 1:00 " DST" +Rule Norway 1945 only - Oct 1 2:00s 0 - +Rule Norway 1959 1964 - Mar Sun>=15 2:00s 1:00 " DST" +Rule Norway 1959 1965 - Sep Sun>=15 2:00s 0 - +Rule Norway 1965 only - Apr 25 2:00s 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Oslo 0:43:00 - LMT 1895 + 1:00 Norway MET%s 1940 Aug 10 23:00 + 1:00 M-Eur MET%s 1945 Apr 2 2:00 + 1:00 Norway MET%s 1980 Apr 6 2:00 + 1:00 M-Eur MET%s +# Svalbard is like Europe/Oslo. +# +# From Whitman: +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Jan_Mayen -1:00 - EGT + +# Poland +# Austrian and German Poland switched from the Julian to the Gregorian calendar +# on 1582 Oct 15. Russian Poland switched on 1918 Jan 14. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Poland 1918 1919 - Sep 16 2:00s 0 - +Rule Poland 1919 only - Apr 15 2:00s 1:00 " DST" +# Whitman gives 1944 Nov 30; go with Shanks. +Rule Poland 1944 only - Oct 4 2:00 0 - +# For 1944-1948 Whitman gives the previous day; go with Shanks. +Rule Poland 1945 only - Apr 29 0:00 1:00 " DST" +Rule Poland 1945 only - Nov 1 0:00 0 - +Rule Poland 1946 only - Apr 14 0:00 1:00 " DST" +Rule Poland 1946 only - Sep 7 0:00 0 - +Rule Poland 1947 only - May 4 0:00 1:00 " DST" +Rule Poland 1947 1948 - Oct Sun>=1 0:00 0 - +Rule Poland 1948 only - Apr 18 0:00 1:00 " DST" +# Whitman also gives 1949 Apr 9 - 1949 Oct 1; go with Shanks. +Rule Poland 1957 only - Jun 2 1:00s 1:00 " DST" +Rule Poland 1957 1958 - Sep lastSun 1:00s 0 - +Rule Poland 1958 only - Mar 30 1:00s 1:00 " DST" +Rule Poland 1959 only - May 31 1:00s 1:00 " DST" +Rule Poland 1959 1961 - Oct Sun>=1 1:00s 0 - +Rule Poland 1960 only - Apr 3 1:00s 1:00 " DST" +Rule Poland 1961 1964 - May Sun>=25 1:00s 1:00 " DST" +Rule Poland 1962 1964 - Sep lastSun 1:00s 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Warsaw 1:24:00 - LMT 1880 + 1:24 - WMT 1915 Aug 5 # Warsaw Mean Time + 1:00 M-Eur MET%s 1918 Sep 16 3:00 + 2:00 Poland EET%s 1922 Jun + 1:00 Poland MET%s 1940 Jun 23 2:00 + 1:00 M-Eur MET%s 1944 Oct + 1:00 Poland MET%s 1977 Apr 3 1:00 + 1:00 W-Eur MET%s +# This may change to `M-Eur' soon, for EC compatibility. + +# Portugal +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Port 1911 only - May 24 0:00 0 - +Rule Port 1916 only - Jun 17 23:00 1:00 " DST" +# Whitman gives 1916 Oct 31; go with Shanks. +Rule Port 1916 only - Nov 1 1:00 0 - +Rule Port 1917 only - Feb 28 23:00s 1:00 " DST" +Rule Port 1917 1921 - Oct 14 23:00s 0 - +Rule Port 1918 only - Mar 1 23:00s 1:00 " DST" +Rule Port 1919 only - Feb 28 23:00s 1:00 " DST" +Rule Port 1920 only - Feb 29 23:00s 1:00 " DST" +Rule Port 1921 only - Feb 28 23:00s 1:00 " DST" +Rule Port 1924 only - Apr 16 23:00s 1:00 " DST" +Rule Port 1924 only - Oct 14 23:00s 0 - +Rule Port 1926 only - Apr 17 23:00s 1:00 " DST" +Rule Port 1926 1929 - Oct Sat>=1 23:00s 0 - +Rule Port 1927 only - Apr 9 23:00s 1:00 " DST" +Rule Port 1928 only - Apr 14 23:00s 1:00 " DST" +Rule Port 1929 only - Apr 20 23:00s 1:00 " DST" +Rule Port 1931 only - Apr 18 23:00s 1:00 " DST" +# Whitman gives 1931 Oct 8; go with Shanks. +Rule Port 1931 1932 - Oct Sat>=1 23:00s 0 - +Rule Port 1932 only - Apr 2 23:00s 1:00 " DST" +# Shanks gives 1934 Apr 4; go with Whitman. +Rule Port 1934 only - Apr 7 23:00s 1:00 " DST" +# Whitman gives 1934 Oct 5; go with Shanks. +Rule Port 1934 1938 - Oct Sat>=1 23:00s 0 - +# Shanks gives 1935 Apr 30; go with Whitman. +Rule Port 1935 only - Mar 30 23:00s 1:00 " DST" +Rule Port 1936 only - Apr 18 23:00s 1:00 " DST" +# Whitman gives 1937 Apr 2; go with Shanks. +Rule Port 1937 only - Apr 3 23:00s 1:00 " DST" +Rule Port 1938 only - Mar 26 23:00s 1:00 " DST" +Rule Port 1939 only - Apr 15 23:00s 1:00 " DST" +# Whitman gives 1939 Oct 7; go with Shanks. +Rule Port 1939 only - Nov 18 23:00s 0 - +Rule Port 1940 only - Feb 24 23:00s 1:00 " DST" +# Shanks gives 1940 Oct 7; go with Whitman. +Rule Port 1940 1941 - Oct 5 23:00s 0 - +Rule Port 1941 only - Apr 5 23:00s 1:00 " DST" +Rule Port 1942 1945 - Mar Sat>=8 23:00s 1:00 " DST" +Rule Port 1942 only - Apr 25 22:00s 2:00 " DDST" +Rule Port 1942 only - Aug 15 22:00s 1:00 " DST" +Rule Port 1942 1945 - Oct Sat>=24 23:00s 0 - +Rule Port 1943 only - Apr 17 22:00s 2:00 " DDST" +Rule Port 1943 1945 - Aug Sat>=25 22:00s 1:00 " DST" +Rule Port 1944 1945 - Apr Sat>=21 22:00s 2:00 " DDST" +Rule Port 1946 only - Apr Sat>=1 23:00s 1:00 " DST" +Rule Port 1946 only - Oct Sat>=1 23:00s 0 - +Rule Port 1947 1949 - Apr Sun>=1 2:00s 1:00 " DST" +Rule Port 1947 1949 - Oct Sun>=1 2:00s 0 - +# Shanks says DST was observed in 1950; go with Whitman. +# Whitman gives Oct lastSun for 1952 on; go with Shanks. +Rule Port 1951 1965 - Apr Sun>=1 2:00s 1:00 " DST" +Rule Port 1951 1965 - Oct Sun>=1 2:00s 0 - +Rule Port 1977 only - Mar 27 0:00s 1:00 " DST" +Rule Port 1977 only - Sep 25 0:00s 0 - +Rule Port 1978 1979 - Apr Sun>=1 0:00s 1:00 " DST" +Rule Port 1978 only - Oct 1 0:00s 0 - +Rule Port 1979 1982 - Sep lastSun 1:00s 0 - +Rule Port 1980 only - Mar lastSun 0:00s 1:00 " DST" +Rule Port 1981 1982 - Mar lastSun 1:00s 1:00 " DST" +Rule Port 1983 only - Mar lastSun 2:00s 1:00 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Lisbon -0:36:32 - LMT 1884 + -0:37 - LMT 1911 May 24 # Lisbon Mean Time + 0:00 Port WET%s 1966 Apr 3 2:00 + 1:00 - MET 1976 Sep 26 1:00 + 0:00 Port WET%s 1983 Sep 25 1:00s + 0:00 W-Eur WET%s 1992 Sep 27 1:00s +# From Rui Pedro Salgueiro <rps@inescca.inescc.pt> (November 12, 1992): +# Portugal has recently (September, 27) changed timezone +# (from WET to MET or CET) to harmonize with EEC. + 1:00 M-Eur MET%s +# We don't know what happened to Madeira or the Azores, +# so we'll just use Shanks for now. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada + -1:55 - HMT 1911 May 24 # Horta Mean Time + -2:00 Port ACT%s 1966 Apr 3 2:00 + -1:00 - ACT 1977 Mar 27 + -1:00 - ACT 1983 Sep 25 1:00s + -1:00 W-Eur ACT%s +Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal + -1:08 - FMT 1911 May 24 # Funchal Mean Time + -1:00 Port ACT%s 1966 Apr 3 2:00 + 0:00 - WET 1977 Mar 27 + 0:00 Port WET%s 1983 Sep 25 1:00s + 0:00 W-Eur WET%s + +# Slovakia +Link Europe/Prague Europe/Bratislava + +# Romania +# Catholic Romania switched from the Julian to the Gregorian calendar on +# on 1919 Mar 18. Greek Orthodox Romania switched on 1920 Mar 18. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Romania 1931 only - Jul 24 0:00 0 - +Rule Romania 1932 only - May 21 0:00s 1:00 " DST" +Rule Romania 1932 1939 - Oct Sun>=1 0:00s 0 - +Rule Romania 1933 1939 - Apr Sun>=2 0:00s 1:00 " DST" +Rule Romania 1979 only - May 27 0:00 1:00 " DST" +Rule Romania 1979 only - Sep lastSun 0:00 0 - +Rule Romania 1980 only - Apr 5 23:00 1:00 " DST" +Rule Romania 1980 only - Sep lastSun 1:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct + 1:44 - BMT 1931 Jul 24 # Bucharest MT + 2:00 Romania EET%s 1981 Mar 29 2:00s + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. + +# Russia +# From Paul Eggert <eggert@twinsun.com> (May 28, 1994): +# Moscow and Novosibirsk time zone names, and Moscow rules after 1991, +# are from Andrew A. Chernov <ache@astral.msk.su>. +# I invented the other time zone names, and (unless otherwise specified) +# guessed what happened after 1991; the clocks were chaotic, and we know little. +# The rest is from Shanks. +# +# From Shanks (1991): +# Western Russia switched from the Julian to the Gregorian calendar +# on 1918 Jan 14. Eastern Russia switched on 1920 Mar 18. +# In 1929 the Soviet Union instituted a 5 day week; in 1932 it instituted +# a 6 day week; on 1940 Jun 27 it returned to the Gregorian week. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Moscow 2:30:20 - LMT 1880 + 2:31 Russia LST%s 1919 Jul 1 2:00 + 3:00 Russia MS%s 1922 Oct + 2:00 - EET 1930 Jun 21 + 3:00 Russia MS%s 1991 Mar 31 2:00s + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s + 2:00 - EET 1992 Jan 19 2:00s + 3:00 Russia MS%s +Zone Europe/Kuybyshev 3:20:36 - LMT 1924 May 2 + 3:00 - KSK 1957 Mar + 4:00 Russia KS%s 1991 Mar 31 2:00s + 3:00 1:00 KSD 1991 Sep 29 2:00s + 3:00 - KSK 1992 Jan 19 2:00s + 4:00 Russia KS%s +Zone Asia/Yekaterinburg 4:02:34 - LMT 1924 May 2 + 4:00 - SSK 1957 Mar + 5:00 Russia SS%s 1991 Mar 31 2:00s + 4:00 1:00 SSD 1991 Sep 29 2:00s + 4:00 - SSK 1992 Jan 19 2:00s + 5:00 Russia ES%s # name change from Sverdlovsk +Zone Asia/Omsk 4:53:36 - LMT 1924 May 2 + 5:00 - OSK 1957 Mar + 6:00 Russia OS%s 1991 Mar 31 2:00s + 5:00 1:00 OSD 1991 Sep 29 2:00s + 5:00 - OSK 1992 Jan 19 2:00s + 6:00 Russia OS%s +# From Stanislaw A. Kuzikowski <S.A.Kuz@iae.nsk.su> (June 29, 1994): +# But now it is some months since Novosibirsk is 3 hours ahead of Moscow! +# I do not know why they have decided to make this change; +# as far as I remember it was done exactly during winter->summer switching +# so we (Novosibirsk) simply did not switch. +# Tomsk is still 4 hours ahead of Moscow. +Zone Asia/Novosibirsk 5:31:40 - LMT 1924 May 2 + 6:00 - NSK 1957 Mar + 7:00 Russia NS%s 1991 Mar 31 2:00s + 6:00 1:00 NSD 1991 Sep 29 2:00s + 6:00 - NSK 1992 Jan 19 2:00s + 7:00 Russia NS%s 1994 Mar 27 2:00s + 6:00 1:00 NSD 1994 Sep 25 2:00s + 6:00 Russia NS%s +Zone Asia/Tomsk 5:39:52 - LMT 1924 May 2 + 6:00 - TSK 1957 Mar + 7:00 Russia TS%s 1991 Mar 31 2:00s + 6:00 1:00 TSD 1991 Sep 29 2:00s + 6:00 - TSK 1992 Jan 19 2:00s + 7:00 Russia TS%s +Zone Asia/Irkutsk 6:57:20 - LMT 1880 + 6:57 - LST 1924 May 2 + 7:00 - ISK 1957 Mar + 8:00 Russia IS%s 1991 Mar 31 2:00s + 7:00 1:00 ISD 1991 Sep 29 2:00s + 7:00 - ISK 1992 Jan 19 2:00s + 8:00 Russia IS%s +Zone Asia/Yakutsk 8:38:40 - LMT 1924 May 2 + 8:00 - YSK 1957 Mar + 9:00 Russia YS%s 1991 Mar 31 2:00s + 8:00 1:00 YSD 1991 Sep 29 2:00s + 8:00 - YSK 1992 Jan 19 2:00s + 9:00 Russia YS%s +Zone Asia/Vladivostok 8:47:44 - LMT 1880 + 8:48 - LST 1924 May 2 + 9:00 - VSK 1957 Mar + 10:00 Russia VS%s 1991 Mar 31 2:00s + 9:00 1:00 VSD 1991 Sep 29 2:00s + 9:00 - VSK 1992 Jan 19 2:00s + 10:00 Russia VS%s +# MSK is taken; settle for GSK. +Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 + 10:00 - GSK 1957 Mar + 11:00 Russia GS%s 1991 Mar 31 2:00s + 10:00 1:00 GSD 1991 Sep 29 2:00s + 10:00 - GSK 1992 Jan 19 2:00s + 11:00 Russia GS%s +# This name should be Asia/Petropavlovsk-Kamchatski, but that's too long. +Zone Asia/Kamchatka 10:34:36 - LMT 1924 May 2 + 11:00 - PSK 1957 Mar + 12:00 Russia PS%s 1991 Mar 31 2:00s + 11:00 1:00 PSD 1991 Sep 29 2:00s + 11:00 - PSK 1992 Jan 19 2:00s + 12:00 Russia PS%s +Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 + 12:00 - ASK 1957 Mar + 13:00 Russia AS%s 1991 Mar 31 2:00s + 12:00 1:00 ASD 1991 Sep 29 2:00s + 12:00 - ASK 1992 Jan 19 2:00s + 13:00 Russia AS%s + +# Serbia +# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Belgrade 1:22:00 - LMT 1884 + 1:00 - MET 1941 Apr 18 23:00 + 1:00 M-Eur MET%s 1945 May 8 2:00s + 1:00 1:00 "MET DST" 1945 Sep 16 2:00s + 1:00 - MET 1983 Mar 27 2:00s + 1:00 M-Eur MET%s + +# Slovenia +# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Ljubljana 0:58:04 - LMT 1884 + 1:00 - MET 1941 Apr 18 23:00 + 1:00 M-Eur MET%s 1945 May 8 2:00s + 1:00 1:00 "MET DST" 1945 Sep 16 2:00s + 1:00 - MET 1983 Mar 27 2:00s + 1:00 M-Eur MET%s + +# Spain +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Spain 1901 only - Jan 1 0:00 0 - +# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1; go with Shanks. +Rule Spain 1917 only - May 5 23:00s 1:00 " DST" +Rule Spain 1917 1919 - Oct 6 23:00s 0 - +Rule Spain 1918 only - Apr 15 23:00s 1:00 " DST" +Rule Spain 1919 only - Apr 5 23:00s 1:00 " DST" +# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks. +Rule Spain 1924 only - Apr 16 23:00s 1:00 " DST" +# Whitman gives 1924 Oct 14; go with Shanks. +Rule Spain 1924 only - Oct 4 23:00s 0 - +Rule Spain 1926 only - Apr 17 23:00s 1:00 " DST" +# Whitman says no DST in 1929; go with Shanks. +Rule Spain 1926 1929 - Oct Sat>=1 23:00s 0 - +Rule Spain 1927 only - Apr 9 23:00s 1:00 " DST" +Rule Spain 1928 only - Apr 14 23:00s 1:00 " DST" +Rule Spain 1929 only - Apr 20 23:00s 1:00 " DST" +# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13; go with Shanks. +Rule Spain 1937 only - May 22 23:00s 1:00 " DST" +Rule Spain 1937 1939 - Oct Sat>=1 23:00s 0 - +Rule Spain 1938 only - Mar 22 23:00s 1:00 " DST" +Rule Spain 1939 only - Apr 15 23:00s 1:00 " DST" +Rule Spain 1940 only - Mar 16 23:00s 1:00 " DST" +# Whitman says no DST 1942-1945; go with Shanks. +Rule Spain 1942 only - May 2 22:00s 2:00 " DDST" +Rule Spain 1942 only - Sep 1 22:00s 1:00 " DST" +Rule Spain 1943 1946 - Apr Sat>=13 22:00s 2:00 " DDST" +Rule Spain 1943 only - Oct 3 22:00s 1:00 " DST" +Rule Spain 1944 only - Oct 10 22:00s 1:00 " DST" +Rule Spain 1945 only - Sep 30 1:00 1:00 " DST" +Rule Spain 1949 only - Apr 30 23:00 1:00 " DST" +Rule Spain 1949 only - Sep 30 1:00 0 - +Rule Spain 1974 1975 - Apr Sat>=13 23:00 1:00 " DST" +Rule Spain 1974 1975 - Oct Sun>=1 1:00 0 - +Rule Spain 1976 only - Mar 27 23:00 1:00 " DST" +Rule Spain 1976 1977 - Sep lastSun 1:00 0 - +Rule Spain 1977 1978 - Apr 2 23:00 1:00 " DST" +Rule Spain 1978 only - Oct 1 1:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Madrid -0:14:44 - LMT 1901 + 0:00 Spain WET%s 1946 Sep 30 + 1:00 Spain MET%s 1979 Apr 1 2:00 + 1:00 M-Eur MET%s +Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C. + -1:00 - ACT 1946 Sep 30 1:00 + 0:00 - WET 1980 Apr 6 0:00s + 0:00 1:00 "WET DST" 1980 Sep 28 0:00s + 0:00 W-Eur WET%s + +# Sweden +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Stockholm 1:12:12 - LMT 1878 May 31 + 1:12 - SMT 1900 Jan 1 1:00 # Stockholm MT + 1:00 - MET 1916 Apr 14 23:00s + 1:00 1:00 "MET DST" 1916 Sep 30 23:00s + 1:00 - MET 1980 Apr 6 2:00 + 1:00 M-Eur MET%s + +# Switzerland +# From Howse (1988), p 82: +# By the end of the 18th century clocks and watches became commonplace +# and their performance improved enormously. Communities began to keep +# mean time in preference to apparent time -- Geneva from 1780 .... +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Swiss 1894 only - Jun 1 0:00 0 - +# From Whitman (who writes ``Midnight?''): +Rule Swiss 1940 only - Nov 2 0:00 1:00 " DST" +Rule Swiss 1940 only - Dec 31 0:00 0 " DST" +# From Shanks (1991): +Rule Swiss 1941 1942 - May Sun>=1 2:00 1:00 " DST" +Rule Swiss 1941 1942 - Oct Sun>=1 0:00 0 " DST" +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 + 0:30 - SST 1894 Jun # Swiss Standard Time + 1:00 Swiss MET%s 1981 Mar 29 2:00 + 1:00 M-Eur MET%s + +# Turkey +# European Turkey switched to the Gregorian calendar in 1908. +# Asian Turkey switched in 1914. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Turkey 1910 only - Oct 1 0:00 0 - +Rule Turkey 1916 only - May 1 0:00 1:00 " DST" +Rule Turkey 1916 only - Oct 1 0:00 0 - +Rule Turkey 1920 only - Mar 28 0:00 1:00 " DST" +Rule Turkey 1920 only - Oct 25 0:00 0 - +Rule Turkey 1921 only - Apr 3 0:00 1:00 " DST" +Rule Turkey 1921 only - Oct 3 0:00 0 - +Rule Turkey 1922 only - Mar 26 0:00 1:00 " DST" +Rule Turkey 1922 only - Oct 8 0:00 0 - +# Whitman gives 1923 Apr 28 - Sep 16 and no DST in 1924-1925; go with Shanks. +Rule Turkey 1924 only - May 13 0:00 1:00 " DST" +Rule Turkey 1924 1925 - Oct 1 0:00 0 - +Rule Turkey 1925 only - May 1 0:00 1:00 " DST" +# Shanks omits the first two transitions in 1940; go with Whitman. +Rule Turkey 1940 only - Jun 30 0:00 1:00 " DST" +Rule Turkey 1940 only - Oct 5 0:00 0 - +Rule Turkey 1940 only - Dec 1 0:00 1:00 " DST" +Rule Turkey 1941 only - Sep 21 0:00 0 - +Rule Turkey 1942 only - Apr 1 0:00 1:00 " DST" +# Whitman omits the next two transition and gives 1945 Oct 1; go with Shanks. +Rule Turkey 1942 only - Nov 1 0:00 0 - +Rule Turkey 1945 only - Apr 2 0:00 1:00 " DST" +Rule Turkey 1945 only - Oct 8 0:00 0 - +Rule Turkey 1946 only - Jun 1 0:00 1:00 " DST" +Rule Turkey 1946 only - Oct 1 0:00 0 - +Rule Turkey 1947 1948 - Apr Sun>=16 0:00 1:00 " DST" +Rule Turkey 1947 1950 - Oct Sun>=2 0:00 0 - +Rule Turkey 1949 only - Apr 10 0:00 1:00 " DST" +Rule Turkey 1950 only - Apr 19 0:00 1:00 " DST" +Rule Turkey 1951 only - Apr 22 0:00 1:00 " DST" +Rule Turkey 1951 only - Oct 8 0:00 0 - +Rule Turkey 1962 only - Jul 15 0:00 1:00 " DST" +Rule Turkey 1962 only - Oct 8 0:00 0 - +Rule Turkey 1964 only - May 15 0:00 1:00 " DST" +Rule Turkey 1964 only - Oct 1 0:00 0 - +Rule Turkey 1970 1972 - May Sun>=2 0:00 1:00 " DST" +Rule Turkey 1970 1972 - Oct Sun>=2 0:00 0 - +Rule Turkey 1973 only - Jun 3 1:00 1:00 " DST" +Rule Turkey 1973 only - Nov 4 3:00 0 - +Rule Turkey 1974 only - Mar 31 2:00 1:00 " DST" +Rule Turkey 1974 only - Nov 3 5:00 0 - +Rule Turkey 1975 only - Mar 30 0:00 1:00 " DST" +Rule Turkey 1975 1976 - Oct lastSun 0:00 0 - +Rule Turkey 1976 only - Jun 1 0:00 1:00 " DST" +Rule Turkey 1977 1978 - Apr Sun>=1 0:00 1:00 " DST" +Rule Turkey 1977 only - Oct 16 0:00 0 - +Rule Turkey 1979 1980 - Apr Sun>=1 3:00 1:00 " DST" +Rule Turkey 1979 1982 - Oct Mon>=11 0:00 0 - +Rule Turkey 1981 1982 - Mar lastSun 3:00 1:00 " DST" +Rule Turkey 1983 only - Jul 31 0:00 1:00 " DST" +Rule Turkey 1983 only - Oct 2 0:00 0 - +Rule Turkey 1985 only - Apr 20 0:00 1:00 " DST" +Rule Turkey 1985 only - Sep 28 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Istanbul 1:55:52 - LMT 1880 + 1:57 - OMT 1910 Oct # Ottoman Mean Time + 2:00 Turkey EET%s 1978 Oct 15 + 3:00 Turkey TUR%s 1985 Apr 20 + 2:00 Turkey EET%s 1986 + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. +Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. + +# Ukraine +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Ukraine 1919 only - Jul 1 2:00 1:00 " DST" +Rule Ukraine 1919 only - Aug 16 0:00 0 - +Rule Ukraine 1921 only - Feb 14 23:00 1:00 " DST" +Rule Ukraine 1921 only - Mar 21 23:00 2:00 " DDST" +Rule Ukraine 1921 only - Sep 1 0:00 1:00 " DST" +Rule Ukraine 1921 only - Oct 1 0:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Europe/Kiev 2:02:04 - LMT 1880 + 2:02 Russia LST%s 1919 Jul 1 2:00 + 2:02 Ukraine LST%s 1924 May 2 + 2:00 - EET 1930 Jun 21 + 3:00 Russia MS%s 1990 Jul 17 + 2:00 M-Eur EET%s +# This may change to `E-Eur' soon, for EC compatibility. +Zone Europe/Simferopol 2:16:24 - LMT 1880 + 2:08 Russia LST%s 1919 Jul 1 2:00 + 2:08 Ukraine LST%s 1924 May 2 + 2:00 - EET 1930 Jun 21 + 3:00 Russia MS%s 1991 Mar 31 2:00s + 2:00 1:00 "EET DST" 1991 Sep 29 2:00s +# From Paul Eggert <eggert@twinsun.com> (May 28, 1994): +# Today's _Economist_ (p 45) reports that Crimea switched +# from Kiev to Moscow time sometime after the January elections. +# For now, we'll guess that there was a 2-hour leap forward on March 27. + 2:00 M-Eur EET%s 1994 Mar 27 2:00s + 3:00 Russia MS%s + +############################################################################### + +# One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from +# the last Sunday in March to the last Sunday in September in 1986. +# The source shows Romania changing a day later than everybody else. +# +# According to Bernard Sieloff's source, Poland is in the MET time zone but +# uses the WE DST rules. The Western USSR uses EET+1 and ME DST rules. +# Bernard Sieloff's source claims Romania switches on the same day, but at +# 00:00 standard time (i.e., 01:00 DST). It also claims that Turkey +# switches on the same day, but switches on at 01:00 standard time +# and off at 00:00 standard time (i.e., 01:00 DST) + +# ... +# Date: Wed, 28 Jan 87 16:56:27 -0100 +# From: seismo!mcvax!cgcha!wtho (Tom Hofmann) +# Message-Id: <8701281556.AA22174@cgcha.uucp> +# ... +# +# ...the European time rules are...standardized since 1981, when +# most European coun[tr]ies started DST. Before that year, only +# a few countries (UK, France, Italy) had DST, each according +# to own national rules. In 1981, however, DST started on +# 'Apr firstSun', and not on 'Mar lastSun' as in the following +# years... +# But also since 1981 there are some more national exceptions +# than listed in 'europe': Switzerland, for example, joined DST +# one year later, Denmark ended DST on 'Oct 1' instead of 'Sep +# lastSun' in 1981---I don't know how they handle now. +# +# Finally, DST ist always from 'Apr 1' to 'Oct 1' in the +# Soviet Union (as far as I know). +# +# Tom Hofmann, Scientific Computer Center, CIBA-GEIGY AG, +# 4002 Basle, Switzerland +# UUCP: ...!mcvax!cernvax!cgcha!wtho + +# ... +# Date: Wed, 4 Feb 87 22:35:22 +0100 +# From: seismo!mcvax!cwi.nl!dik (Dik T. Winter) +# ... +# +# The information from Tom Hofmann is (as far as I know) not entirely correct. +# After a request from chongo at amdahl I tried to retrieve all information +# about DST in Europe. I was able to find all from about 1969. +# +# ...standardization on DST in Europe started in about 1977 with switches on +# first Sunday in April and last Sunday in September... +# In 1981 UK joined Europe insofar that +# the starting day for both shifted to last Sunday in March. And from 1982 +# the whole of Europe used DST, with switch dates April 1 and October 1 in +# the Sov[i]et Union. In 1985 the SU reverted to standard Europe[a]n switch +# dates... +# +# It should also be remembered that time-zones are not constants; e.g. +# Portugal switched in 1976 from MET (or CET) to WET with DST... +# Note also that though there were rules for switch dates not +# all countries abided to these dates, and many individual deviations +# occurred, though not since 1982 I believe. Another note: it is always +# assumed that DST is 1 hour ahead of normal time, this need not be the +# case; at least in the Netherlands there have been times when DST was 2 hours +# in advance of normal time. +# +# ... +# dik t. winter, cwi, amsterdam, nederland +# INTERNET : dik@cwi.nl +# BITNET/EARN: dik@mcvax + +# From Bob Devine (January 28, 1988): +# ... +# Greece: Last Sunday in April to last Sunday in September (iffy on dates). +# Since 1978. Change at midnight. +# ... +# Monaco: has same DST as France. +# ... + +# ... +# Date: Fri, 3 Sep 93 13:43:41 BST +# From: Peter Ilieve <peter@memex.co.uk> +# ... +# Turning to Europe, I now have a copy of the `Sixth Council Directive 92/20/EEC +# of 26 March 1992 on summertime arrangements'. This only covers 1993 and +# 1994, a seventh one is in the works but I doubt that the algorithm will +# change. This says summertime starts at 01:00 GMT on the last Sunday in March +# and ends at 01:00 GMT on the last Sunday in September, except for the UK +# and Eire where it ends at 01:00 GMT on the fourth Sunday in October. +# It says the arrangements for 1995 onwards will be decided by 1 January 1994, +# but as the sixth directive was supposed to appear by 1 Jan 92 and didn't +# arrive til March I wouldn't hold your breath. +# +# The first summertime directive was adopted in 1980, although the UK didn't +# seem to use it until 1981. I suspect it would be safe to move your start +# dates for the -Eur rules back to 1981. diff --git a/time/factory b/time/factory new file mode 100644 index 0000000000..d95df23c1d --- /dev/null +++ b/time/factory @@ -0,0 +1,8 @@ +# @(#)factory 7.1 + +# For companies who don't want to put time zone specification in +# their installation procedures. When users run date, they'll get the message. +# Also useful for the "comp.sources" version. + +# Zone NAME GMTOFF RULES FORMAT +Zone Factory 0 - "Local time zone must be set--see zic manual page" diff --git a/time/gmtime.c b/time/gmtime.c new file mode 100644 index 0000000000..f09baef5f2 --- /dev/null +++ b/time/gmtime.c @@ -0,0 +1,33 @@ +/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <stddef.h> +#include <time.h> + +/* Return the `struct tm' representation of *T in UTC. */ +struct tm * +DEFUN(gmtime, (t), CONST time_t *t) +{ + struct tm *tp = __offtime (t, 0L); + + tp->tm_gmtoff = 0L; + tp->tm_zone = "GMT"; + + return tp; +} diff --git a/time/ialloc.c b/time/ialloc.c new file mode 100644 index 0000000000..d6a1b22b0e --- /dev/null +++ b/time/ialloc.c @@ -0,0 +1,103 @@ +#ifndef lint +#ifndef NOID +static char elsieid[] = "@(#)ialloc.c 8.24"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +/*LINTLIBRARY*/ + +#include "private.h" + +#ifdef MAL +#define NULLMAL(x) ((x) == NULL || (x) == MAL) +#endif /* defined MAL */ +#ifndef MAL +#define NULLMAL(x) ((x) == NULL) +#endif /* !defined MAL */ + +#define nonzero(n) (((n) == 0) ? 1 : (n)) + +char * icalloc P((int nelem, int elsize)); +char * icatalloc P((char * old, const char * new)); +char * icpyalloc P((const char * string)); +char * imalloc P((int n)); +void * irealloc P((void * pointer, int size)); +void ifree P((char * pointer)); + +char * +imalloc(n) +const int n; +{ +#ifdef MAL + register char * result; + + result = malloc((alloc_size_T) nonzero(n)); + return NULLMAL(result) ? NULL : result; +#endif /* defined MAL */ +#ifndef MAL + return malloc((alloc_size_T) nonzero(n)); +#endif /* !defined MAL */ +} + +char * +icalloc(nelem, elsize) +int nelem; +int elsize; +{ + if (nelem == 0 || elsize == 0) + nelem = elsize = 1; + return calloc((alloc_size_T) nelem, (alloc_size_T) elsize); +} + +void * +irealloc(pointer, size) +void * const pointer; +const int size; +{ + if (NULLMAL(pointer)) + return imalloc(size); + return realloc((genericptr_T) pointer, (alloc_size_T) nonzero(size)); +} + +char * +icatalloc(old, new) +char * const old; +const char * const new; +{ + register char * result; + register int oldsize, newsize; + + newsize = NULLMAL(new) ? 0 : strlen(new); + if (NULLMAL(old)) + oldsize = 0; + else if (newsize == 0) + return old; + else oldsize = strlen(old); + if ((result = irealloc(old, oldsize + newsize + 1)) != NULL) + if (!NULLMAL(new)) + (void) strcpy(result + oldsize, new); + return result; +} + +char * +icpyalloc(string) +const char * const string; +{ + return icatalloc((char *) NULL, string); +} + +void +ifree(p) +char * const p; +{ + if (!NULLMAL(p)) + (void) free(p); +} + +void +icfree(p) +char * const p; +{ + if (!NULLMAL(p)) + (void) free(p); +} diff --git a/time/leapseconds b/time/leapseconds new file mode 100644 index 0000000000..d610692f94 --- /dev/null +++ b/time/leapseconds @@ -0,0 +1,41 @@ +# @(#)leapseconds 7.7 + +# Allowance for leapseconds added to each timezone file. + +# The International Earth Rotation Service periodically uses leap seconds +# to keep UTC to within 0.9 s of TAI (atomic time); see +# Terry J Quinn, The BIPM and the accurate measure of time, +# Proc IEEE 79, 7 (July 1991), 894-905. +# There were no leap seconds before 1972, because the official mechanism +# accounting for the discrepancy between atomic time and the earth's rotation +# did not exist until the early 1970s. + +# The correction (+ or -) is made at the given time, so lines +# will typically look like: +# Leap YEAR MON DAY 23:59:60 + R/S +# or +# Leap YEAR MON DAY 23:59:59 - R/S + +# If the leapsecond is Rolling (R) the given time is local time +# If the leapsecond is Stationary (S) the given time is GMT + +# Leap YEAR MONTH DAY HH:MM:SS CORR R/S +Leap 1972 Jun 30 23:59:60 + S +Leap 1972 Dec 31 23:59:60 + S +Leap 1973 Dec 31 23:59:60 + S +Leap 1974 Dec 31 23:59:60 + S +Leap 1975 Dec 31 23:59:60 + S +Leap 1976 Dec 31 23:59:60 + S +Leap 1977 Dec 31 23:59:60 + S +Leap 1978 Dec 31 23:59:60 + S +Leap 1979 Dec 31 23:59:60 + S +Leap 1981 Jun 30 23:59:60 + S +Leap 1982 Jun 30 23:59:60 + S +Leap 1983 Jun 30 23:59:60 + S +Leap 1985 Jun 30 23:59:60 + S +Leap 1987 Dec 31 23:59:60 + S +Leap 1989 Dec 31 23:59:60 + S +Leap 1990 Dec 31 23:59:60 + S +Leap 1992 Jun 30 23:59:60 + S +Leap 1993 Jun 30 23:59:60 + S +Leap 1994 Jun 30 23:59:60 + S diff --git a/time/localtime.c b/time/localtime.c new file mode 100644 index 0000000000..3377b80197 --- /dev/null +++ b/time/localtime.c @@ -0,0 +1,84 @@ +/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <localeinfo.h> +#include <stddef.h> +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + + +#ifndef HAVE_GNU_LD +#define __tzname tzname +#define __daylight daylight +#define __timezone timezone +#endif + +/* Return the `struct tm' representation of *TIMER in the local timezone. */ +struct tm * +DEFUN(localtime, (timer), CONST time_t *timer) +{ + extern int __use_tzfile; + extern int EXFUN(__tz_compute, (time_t timer, struct tm *tp)); + extern int EXFUN(__tzfile_compute, (time_t timer, + long int *leap_correct, int *leap_hit)); + register struct tm *tp; + long int leap_correction; + int leap_extra_secs; + + if (timer == NULL) + { + errno = EINVAL; + return NULL; + } + + { + /* Make sure the database is initialized. */ + extern int __tzset_run; + if (! __tzset_run) + __tzset (); + } + + if (__use_tzfile) + { + if (! __tzfile_compute (*timer, &leap_correction, &leap_extra_secs)) + return NULL; + } + else + { + tp = gmtime (timer); + if (tp == NULL) + return NULL; + + if (! __tz_compute (*timer, tp)) + return NULL; + + leap_correction = 0L; + leap_extra_secs = 0; + } + + tp = __offtime (timer, __timezone - leap_correction); + tp->tm_sec += leap_extra_secs; + tp->tm_isdst = __daylight; + tp->tm_gmtoff = __timezone; + tp->tm_zone = __tzname[__daylight]; + return tp; +} diff --git a/time/mktime.c b/time/mktime.c new file mode 100644 index 0000000000..f86496a941 --- /dev/null +++ b/time/mktime.c @@ -0,0 +1,506 @@ +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. + Contributed by Noel Cragg (noel@cs.oberlin.edu), with fixes by + Michael E. Calwas (calwas@ttd.teradyne.com) and + Wade Hampton (tasi029@tmn.com). + +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <sys/types.h> /* Some systems define `time_t' here. */ +#include <time.h> + + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +#define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + +#ifndef __P +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __P(args) args +#else +#define __P(args) () +#endif /* GCC. */ +#endif /* Not __P. */ + +/* How many days are in each month. */ +const unsigned short int __mon_lengths[2][12] = + { + /* Normal years. */ + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + /* Leap years. */ + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } + }; + + +static int times_through_search; /* This library routine should never + hang -- make sure we always return + when we're searching for a value */ + + +#ifdef DEBUG + +#include <stdio.h> +#include <ctype.h> + +int debugging_enabled = 0; + +/* Print the values in a `struct tm'. */ +static void +printtm (it) + struct tm *it; +{ + printf ("%02d/%02d/%04d %02d:%02d:%02d (%s) yday:%03d dst:%d gmtoffset:%ld", + it->tm_mon + 1, + it->tm_mday, + it->tm_year + 1900, + it->tm_hour, + it->tm_min, + it->tm_sec, + it->tm_zone, + it->tm_yday, + it->tm_isdst, + it->tm_gmtoff); +} +#endif + + +static time_t +dist_tm (t1, t2) + struct tm *t1; + struct tm *t2; +{ + time_t distance = 0; + unsigned long int v1, v2; + int diff_flag = 0; + + v1 = v2 = 0; + +#define doit(x, secs) \ + v1 += t1->x * secs; \ + v2 += t2->x * secs; \ + if (!diff_flag) \ + { \ + if (t1->x < t2->x) \ + diff_flag = -1; \ + else if (t1->x > t2->x) \ + diff_flag = 1; \ + } + + doit (tm_year, 31536000); /* Okay, not all years have 365 days. */ + doit (tm_mon, 2592000); /* Okay, not all months have 30 days. */ + doit (tm_mday, 86400); + doit (tm_hour, 3600); + doit (tm_min, 60); + doit (tm_sec, 1); + +#undef doit + + /* We should also make sure that the sign of DISTANCE is correct -- if + DIFF_FLAG is positive, the distance should be positive and vice versa. */ + + distance = (v1 > v2) ? (v1 - v2) : (v2 - v1); + if (diff_flag < 0) + distance = -distance; + + if (times_through_search > 20) /* Arbitrary # of calls, but makes sure we + never hang if there's a problem with + this algorithm. */ + { + distance = diff_flag; + } + + /* We need this DIFF_FLAG business because it is forseeable that the + distance may be zero when, in actuality, the two structures are + different. This is usually the case when the dates are 366 days apart + and one of the years is a leap year. */ + + if (distance == 0 && diff_flag) + distance = 86400 * diff_flag; + + return distance; +} + + +/* MKTIME converts the values in a struct tm to a time_t. The values + in tm_wday and tm_yday are ignored; other values can be put outside + of legal ranges since they will be normalized. This routine takes + care of that normalization. */ + +void +do_normalization (tmptr) + struct tm *tmptr; +{ + +#define normalize(foo,x,y,bar); \ + while (tmptr->foo < x) \ + { \ + tmptr->bar--; \ + tmptr->foo = (y - (x - tmptr->foo) + 1); \ + } \ + while (tmptr->foo > y) \ + { \ + tmptr->foo = (x + (tmptr->foo - y) - 1); \ + tmptr->bar++; \ + } + + normalize (tm_sec, 0, 59, tm_min); + normalize (tm_min, 0, 59, tm_hour); + normalize (tm_hour, 0, 23, tm_mday); + + /* Do the month first, so day range can be found. */ + normalize (tm_mon, 0, 11, tm_year); + + /* Since the day range modifies the month, we should be careful how + we reference the array of month lengths -- it is possible that + the month will go negative, hence the modulo... + + Also, tm_year is the year - 1900, so we have to 1900 to have it + work correctly. */ + + normalize (tm_mday, 1, + __mon_lengths[__isleap (tmptr->tm_year + 1900)] + [((tmptr->tm_mon < 0) + ? (12 + (tmptr->tm_mon % 12)) + : (tmptr->tm_mon % 12)) ], + tm_mon); + + /* Do the month again, because the day may have pushed it out of range. */ + normalize (tm_mon, 0, 11, tm_year); + + /* Do the day again, because the month may have changed the range. */ + normalize (tm_mday, 1, + __mon_lengths[__isleap (tmptr->tm_year + 1900)] + [((tmptr->tm_mon < 0) + ? (12 + (tmptr->tm_mon % 12)) + : (tmptr->tm_mon % 12)) ], + tm_mon); + +#ifdef DEBUG + if (debugging_enabled) + { + printf (" After normalizing:\n "); + printtm (tmptr); + putchar ('\n'); + } +#endif + +} + + +/* Here's where the work gets done. */ + +#define BAD_STRUCT_TM ((time_t) -1) + +time_t +_mktime_internal (timeptr, producer) + struct tm *timeptr; + struct tm *(*producer) __P ((const time_t *)); +{ + struct tm our_tm; /* our working space */ + struct tm *me = &our_tm; /* a pointer to the above */ + time_t result; /* the value we return */ + + *me = *timeptr; /* copy the struct tm that was passed + in by the caller */ + + + /***************************/ + /* Normalize the structure */ + /***************************/ + + /* This routine assumes that the value of TM_ISDST is -1, 0, or 1. + If the user didn't pass it in that way, fix it. */ + + if (me->tm_isdst > 0) + me->tm_isdst = 1; + else if (me->tm_isdst < 0) + me->tm_isdst = -1; + + do_normalization (me); + + /* Get out of here if it's not possible to represent this struct. + If any of the values in the normalized struct tm are negative, + our algorithms won't work. Luckily, we only need to check the + year at this point; normalization guarantees that all values will + be in correct ranges EXCEPT the year. */ + + if (me->tm_year < 0) + return BAD_STRUCT_TM; + + /*************************************************/ + /* Find the appropriate time_t for the structure */ + /*************************************************/ + + /* Modified b-search -- make intelligent guesses as to where the + time might lie along the timeline, assuming that our target time + lies a linear distance (w/o considering time jumps of a + particular region). + + Assume that time does not fluctuate at all along the timeline -- + e.g., assume that a day will always take 86400 seconds, etc. -- + and come up with a hypothetical value for the time_t + representation of the struct tm TARGET, in relation to the guess + variable -- it should be pretty close! + + After testing this, the maximum number of iterations that I had + on any number that I tried was 3! Not bad. + + The reason this is not a subroutine is that we will modify some + fields in the struct tm (yday and mday). I've never felt good + about side-effects when writing structured code... */ + + { + struct tm *guess_tm; + time_t guess = 0; + time_t distance = 0; + time_t last_distance = 0; + + times_through_search = 0; + + do + { + guess += distance; + + times_through_search++; + + guess_tm = (*producer) (&guess); + +#ifdef DEBUG + if (debugging_enabled) + { + printf (" Guessing time_t == %d\n ", (int) guess); + printtm (guess_tm); + putchar ('\n'); + } +#endif + + /* How far is our guess from the desired struct tm? */ + distance = dist_tm (me, guess_tm); + + /* Handle periods of time where a period of time is skipped. + For example, 2:15 3 April 1994 does not exist, because DST + is in effect. The distance function will alternately + return values of 3600 and -3600, because it doesn't know + that the requested time doesn't exist. In these situations + (even if the skip is not exactly an hour) the distances + returned will be the same, but alternating in sign. We + want the later time, so check to see that the distance is + oscillating and we've chosen the correct of the two + possibilities. + + Useful: 3 Apr 94 765356300, 30 Oct 94 783496000 */ + + if ((distance == -last_distance) && (distance < last_distance)) + { + /* If the caller specified that the DST flag was off, it's + not possible to represent this time. */ + if (me->tm_isdst == 0) + { +#ifdef DEBUG + printf (" Distance is oscillating -- dst flag nixes struct!\n"); +#endif + return BAD_STRUCT_TM; + } + +#ifdef DEBUG + printf (" Distance is oscillating -- chose the later time.\n"); +#endif + distance = 0; + } + + if ((distance == 0) && (me->tm_isdst != -1) + && (me->tm_isdst != guess_tm->tm_isdst)) + { + /* If we're in this code, we've got the right time but the + wrong daylight savings flag. We need to move away from + the time that we have and approach the other time from + the other direction. That is, if I've requested the + non-DST version of a time and I get the DST version + instead, I want to put us forward in time and search + backwards to get the other time. I checked all of the + configuration files for the tz package -- no entry + saves more than two hours, so I think we'll be safe by + moving 24 hours in one direction. IF THE AMOUNT OF + TIME SAVED IN THE CONFIGURATION FILES CHANGES, THIS + VALUE MAY NEED TO BE ADJUSTED. Luckily, we can never + have more than one level of overlaps, or this would + never work. */ + +#define SKIP_VALUE 86400 + + if (guess_tm->tm_isdst == 0) + /* we got the later one, but want the earlier one */ + distance = -SKIP_VALUE; + else + distance = SKIP_VALUE; + +#ifdef DEBUG + printf (" Got the right time, wrong DST value -- adjusting\n"); +#endif + } + + last_distance = distance; + + } while (distance != 0); + + /* Check to see that the dst flag matches */ + + if (me->tm_isdst != -1) + { + if (me->tm_isdst != guess_tm->tm_isdst) + { +#ifdef DEBUG + printf (" DST flag doesn't match! FIXME?\n"); +#endif + return BAD_STRUCT_TM; + } + } + + result = guess; /* Success! */ + + /* On successful completion, the values of tm_wday and tm_yday + have to be set appropriately. */ + + /* me->tm_yday = guess_tm->tm_yday; + me->tm_mday = guess_tm->tm_mday; */ + + *me = *guess_tm; + } + + /* Update the caller's version of the structure */ + + *timeptr = *me; + + return result; +} + +time_t +#ifdef DEBUG /* make it work even if the system's + libc has it's own mktime routine */ +my_mktime (timeptr) +#else +mktime (timeptr) +#endif + struct tm *timeptr; +{ + return _mktime_internal (timeptr, localtime); +} + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#ifdef DEBUG +void +main (argc, argv) + int argc; + char *argv[]; +{ + int time; + int result_time; + struct tm *tmptr; + + if (argc == 1) + { + long q; + + printf ("starting long test...\n"); + + for (q = 10000000; q < 1000000000; q += 599) + { + struct tm *tm = localtime ((time_t *) &q); + if ((q % 10000) == 0) { printf ("%ld\n", q); fflush (stdout); } + if (q != my_mktime (tm)) + { printf ("failed for %ld\n", q); fflush (stdout); } + } + + printf ("test finished\n"); + + exit (0); + } + + if (argc != 2) + { + printf ("wrong # of args\n"); + exit (0); + } + + debugging_enabled = 1; /* We want to see the info */ + + ++argv; + time = atoi (*argv); + + tmptr = localtime ((time_t *) &time); + printf ("Localtime tells us that a time_t of %d represents\n ", time); + printtm (tmptr); + putchar ('\n'); + + printf (" Given localtime's return val, mktime returns %d which is\n ", + (int) my_mktime (tmptr)); + printtm (tmptr); + putchar ('\n'); + +#if 0 + tmptr->tm_sec -= 20; + tmptr->tm_min -= 20; + tmptr->tm_hour -= 20; + tmptr->tm_mday -= 20; + tmptr->tm_mon -= 20; + tmptr->tm_year -= 20; + tmptr->tm_gmtoff -= 20000; /* This has no effect! */ + tmptr->tm_zone = NULL; /* Nor does this! */ + tmptr->tm_isdst = -1; +#endif + + tmptr->tm_hour += 1; + tmptr->tm_isdst = -1; + + printf ("\n\nchanged ranges: "); + printtm (tmptr); + putchar ('\n'); + + result_time = my_mktime (tmptr); + printf ("\nmktime: %d\n", result_time); + + tmptr->tm_isdst = 0; + + printf ("\n\nchanged ranges: "); + printtm (tmptr); + putchar ('\n'); + + result_time = my_mktime (tmptr); + printf ("\nmktime: %d\n", result_time); +} +#endif /* DEBUG */ + + +/* +Local Variables: +compile-command: "gcc -g mktime.c -o mktime -DDEBUG" +End: +*/ diff --git a/time/northamerica b/time/northamerica new file mode 100644 index 0000000000..40733fddce --- /dev/null +++ b/time/northamerica @@ -0,0 +1,953 @@ +# @(#)northamerica 7.12 +# also includes Central America and the Caribbean + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (August 17, 1994): +# A reliable and entertaining source about time zones is +# Derek Howse, Greenwich time and the discovery of the longitude, +# Oxford University Press (1980). + +############################################################################### + +# United States + +# From Arthur David Olson: +# US Daylight Saving Time ended on the last Sunday of *October* in 1974. +# See, for example, the front page of the Saturday, October 26, 1974 +# and Sunday, October 27, 1974 editions of the Washington Post. + +# From seismo!munnari!kre: +# I recall also being told by someone once that Canada didn't have +# the DST variations in 74/75 that the US did, but I am not nearly +# sure enough of this to add anything. + +# From Arthur David Olson: +# The above has been confirmed by Bob Devine; we'll go with it here. + +# From Arthur David Olson: +# Before the Uniform Time Act of 1966 took effect in 1967, observance of +# Daylight Saving Time in the US was by local option, except during wartime. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule US 1918 1919 - Mar lastSun 2:00 1:00 D +Rule US 1918 1919 - Oct lastSun 2:00 0 S +Rule US 1942 only - Feb 9 2:00 1:00 W # War +Rule US 1945 only - Sep 30 2:00 0 S +Rule US 1967 max - Oct lastSun 2:00 0 S +Rule US 1967 1973 - Apr lastSun 2:00 1:00 D +Rule US 1974 only - Jan 6 2:00 1:00 D +Rule US 1975 only - Feb 23 2:00 1:00 D +Rule US 1976 1986 - Apr lastSun 2:00 1:00 D +Rule US 1987 max - Apr Sun>=1 2:00 1:00 D + +# From Bob Devine (January 28, 1988): +# ...Alaska (and Hawaii) had the timezone names changed in 1967. +# old new +# Pacific Standard Time(PST) -same- +# Yukon Standard Time(YST) -same- +# Central Alaska S.T. (CAT) Alaska-Hawaii St[an]dard Time (AHST) +# Nome Standard Time (NT) Bering Standard Time (BST) +# +# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz. +# The YST zone now covers nearly all of the state, AHST just part +# of the Aleutian islands. No DST. + +# From U. S. Naval Observatory (January 19, 1989): +# USA EASTERN 5 H BEHIND UTC NEW YORK, WASHINGTON +# USA EASTERN 4 H BEHIND UTC APR 3 - OCT 30 +# USA CENTRAL 6 H BEHIND UTC CHICAGO, HOUSTON +# USA CENTRAL 5 H BEHIND UTC APR 3 - OCT 30 +# USA MOUNTAIN 7 H BEHIND UTC DENVER +# USA MOUNTAIN 6 H BEHIND UTC APR 3 - OCT 30 +# USA PACIFIC 8 H BEHIND UTC L.A., SAN FRANCISCO +# USA PACIFIC 7 H BEHIND UTC APR 3 - OCT 30 +# USA ALASKA STD 9 H BEHIND UTC MOST OF ALASKA (AKST) +# USA ALASKA STD 8 H BEHIND UTC APR 3 - OCT 30 (AKDT) +# USA ALEUTIAN 10 H BEHIND UTC ISLANDS WEST OF 170W +# USA - " - 9 H BEHIND UTC APR 3 - OCT 30 +# USA HAWAII 10 H BEHIND UTC +# USA BERING 11 H BEHIND UTC SAMOA, MIDWAY + +# From Arthur David Olson (January 21, 1989): +# The above dates are for 1988. +# Note the "AKST" and "AKDT" abbreviations, the claim that there's +# no DST in Samoa, and the claim that there is DST in Alaska and the +# Aleutians. + +# From Arthur David Olson (February 13, 1988): +# Legal standard time zone names, from United States Code (1982 Edition and +# Supplement III), Title 15, Chapter 6, Section 260 and forward. First, names +# up to April 1, 1967 (when most provisions of the Uniform Time Act of 1966 +# took effect), as explained in sections 263 and 261: +# (none) +# United States standard eastern time +# United States standard mountain time +# United States standard central time +# United States standard Pacific time +# (none) +# United States standard Alaska time +# (none) +# Next, names from April 1, 1967 until November 30, 1983 (the date for +# public law 98-181): +# Atlantic standard time +# eastern standard time +# central standard time +# mountain standard time +# Pacific standard time +# Yukon standard time +# Alaska-Hawaii standard time +# Bering standard time +# And after November 30, 1983: +# Atlantic standard time +# eastern standard time +# central standard time +# mountain standard time +# Pacific standard time +# Alaska standard time +# Hawaii-Aleutian standard time +# Samoa standard time +# The law doesn't give abbreviations. + +# From Paul Eggert <eggert@twinsun.com> (August 16, 1994): +# Howse writes that Alaska switched from the Julian to the Gregorian calendar, +# and from east-of-GMT to west-of-GMT days, in 1867 when the US purchased it +# from Russia. We don't have this data pinned down yet, though. + +# Easy stuff first--including Alaska, where we ignore history (since we +# can't tell if we should give Yukon time or Alaska-Hawaii time for "old" +# times). + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/New_York -5:00 US E%sT +Zone America/Chicago -6:00 US C%sT +Zone America/Denver -7:00 US M%sT +Zone America/Los_Angeles -8:00 US P%sT +Zone America/Anchorage -9:00 US AK%sT + # AK%sT is the abbreviation per USNO + +# Mainland US areas that are always Standard as of 1986. + +Zone America/Fort_Wayne -5:00 US E%sT 1946 + -5:00 - EST # Always EST as of 1986 +# From Arthur David Olson (October 28, 1991): +# An article on page A3 of the Sunday, October 27, 1991 Washington Post +# notes that Starke County switched from Central time to Eastern time as of +# October 27, 1991. +Zone America/Knox_IN -6:00 US C%sT 1991 Oct 27 2:00 + -5:00 - EST # Always EST as of 1991 +Zone America/Phoenix -7:00 US M%sT 1946 + -7:00 - MST # Always MST as of 1986 + +# From Arthur David Olson (February 13, 1988): +# However. . .a writer from the Inter Tribal Council of Arizona, Inc., +# notes in private correspondence dated 12/28/87 that "Presently, only the +# Navajo Nation participates in the Daylight Saving Time policy, due to its +# large size and location in three states." (The "only" means that other +# tribal nations don't use DST.) + +Link America/Denver Navajo + +# From Bob Devine (January 28, 1988): +# Michigan didn't observe DST from 1968 to 1973. + +Zone America/Detroit -5:00 US E%sT 1968 + -5:00 - EST 1973 + -5:00 US E%sT + +# Samoa just changes names. No DST, per Naval Observatory. +# +# Howse writes that in 1879 the King of Samoa decided to change +# ``the date in his kingdom from the Antipodean to the American system, +# ordaining -- by a masterpiece of diplomatic flattery -- that +# the Fourth of July should be celebrated twice in that year.'' + +Zone Pacific/Samoa 12:37:12 - LMT 1879 Jul 5 + -11:22:48 - LMT 1911 + -11:30 - SST 1950 + -11:00 - NST 1967 Apr # N=Nome + -11:00 - BST 1983 Nov 30 # B=Bering + -11:00 - SST # S=Samoa + +Zone Pacific/Midway -11:49:28 - LMT 1901 + -11:00 - NST 1967 Apr # N=Nome + -11:00 - BST 1983 Nov 30 # B=Bering + -11:00 - SST # S=Samoa + +# Aleutian has a name change. DST, per Naval Observatory. + +Zone America/Atka -10:00 US AH%sT 1983 Nov 30 + -10:00 US HA%sT + +# From Arthur David Olson: +# And then there's Hawaii. +# DST was observed for one day in 1933; +# Standard time was change by half an hour in 1947; +# it's always standard as of 1986. + +Zone Pacific/Honolulu -10:30 US H%sT 1933 Apr 30 2:00 + -10:30 1:00 HDT 1933 May 1 2:00 + -10:30 US H%sT 1947 Jun 8 2:00 + -10:00 - HST + +# Navassa +# no information; probably like US/Eastern + + +# Old names, for S5 users + +# Link LINK-FROM LINK-TO +Link America/New_York EST5EDT +Link America/Chicago CST6CDT +Link America/Denver MST7MDT +Link America/Los_Angeles PST8PDT +Link America/Fort_Wayne EST +Link America/Phoenix MST +Link Pacific/Honolulu HST + +################################################################################ + + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where otherwise noted, it is the source for the data below. +# +# Another source occasionally used is Edward W. Whitman, World Time Differences, +# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which +# I found in the UCLA library. +# +# I invented the abbreviation SPST for St Pierre Standard Time; SPDT likewise. +# Corrections are welcome! +# +# See the `europe' file for Greenland. +# +# See the `africa' file for Zone naming conventions. + + + +# Canada + +# Canada is reportedly lots easier than the US--leastways since 1951. +# I don't know what they did before then. +# 4.3BSD claims that it's perfectly regular. +# According to a posting in "comp.bugs.misc", "comp.unix.wizards", etc. +# on February 8, 1987, by Dave Sherman of the Law Society of Upper Canada, +# "...Canada (well, Ontario and at least some of the other provinces) are +# adopting the new daylight savings time rules...". We assume all of +# Canada is doing so. + +# From Bob Devine (January 28, 1988): +# All of Canada did have DST from your first rule except Saskatchewan. +# Which parts did not observe DST is hard to pinpoint but most of the +# province follows the rules. +# NOTE: those that didn't have DST for that rule, also +# probably did not have it for several years previous. + +# From U. S. Naval Observatory (January 19, 1989): +# CANADA NEW FDL 3.5H BEHIND UTC ST.JOHN'S +# CANADA NEW FDL 1.5H BEHIND UTC APR 3 - OCT 29 +# CANADA ATLANTIC 4 H BEHIND UTC HALIFAX +# CANADA ATLANTIC 3 H BEHIND UTC APR 3 - OCT 29 +# CANADA EASTERN 5 H BEHIND UTC TORONTO, MONTREAL, OTTAWA +# CANADA EASTERN 4 H BEHIND UTC APR 3 - OCT 29 +# CANADA CENTRAL 6 H BEHIND UTC REGINA, WINNIPEG +# CANADA CENTRAL 5 H BEHIND UTC APR 3 - OCT 29 +# CANADA MOUNTAIN 7 H BEHIND UTC CALGARY, EDMONTON +# CANADA MOUNTAIN 6 H BEHIND UTC APR 3 - OCT 29 +# CANADA PACIFIC 8 H BEHIND UTC VANCOUVER +# CANADA PACIFIC 7 H BEHIND UTC APR 3 - OCT 29 +# CANADA YUKON SAME AS PACIFIC DAWSON + +# From Arthur David Olson (January 21, 1989): +# April 3 fell on a Sunday in 1988; October 29 fell on a Sunday in 1989. Ahem. +# Note claim that there's double DST in Newfoundland and that Yukon should +# be same as Pacific. + +# From W. Jones (jones@skdad.usask.ca) (November 6, 1992): +# The. . .below is based on information I got from our law library, the +# provincial archives, and the provincial Community Services department. +# A precise history would require digging through newspaper archives, and +# since you didn't say what you wanted, I didn't bother. +# +# Saskatchewan is split by a time zone meridian (105W) and over the years +# the boundary became pretty ragged as communities near it reevaluated +# their affiliations in one direction or the other. In 1965 a provincial +# referendum favoured legislating common time practices. +# +# On 15 April 1966 the Time Act (c. T-14, Revised Statutes of +# Saskatchewan 1978) was proclaimed, and established that the eastern +# part of Saskatchewan would use CST year round, that districts in +# northwest Saskatchewan would by default follow CST but could opt to +# follow Mountain Time rules (thus 1 hour difference in the winter and +# zero in the summer), and that districts in southwest Saskatchewan would +# by default follow MT but could opt to follow CST. +# +# It took a few years for the dust to settle (I know one story of a town +# on one time zone having its school in another, such that a mom had to +# serve her family lunch in two shifts), but presently it seems that only +# a few towns on the border with Alberta (e.g. Lloydminster) follow MT +# rules any more; all other districts appear to have used CST year round +# since sometime in the 1960s. +# +# Here's how I would summarize things. Establish a "Saskatchewan" CST +# time zone, and note that it officially exists as of 15 April 1966. Any +# current exceptions can put themselves in the "Mountain" zone, since +# those are the rules they follow. Any past exceptions can be forgotten, +# since that's what those who live here have done. + +# From Arthur David Olson (November 21, 1992): +# East-Saskatchewan kept to avoid problems for folks using that zone by name; +# plain Saskatchewan added. + +# From Alain LaBont<e'> <ALB@immedia.ca> (1994-11-14): +# I post here the time zone abbreviations standardized in Canada +# for both English and French in the CAN/CSA-Z234.4-89 standard.... +# +# UTC Standard time Daylight savings time +# offset French English French English +# -2:30 - - HAT NDT +# -3 - - HAA ADT +# -3:30 HNT NST - - +# -4 HNA AST HAE EDT +# -5 HNE EST HAC CDT +# -6 HNC CST HAR MDT +# -7 HNR MST HAP PDT +# -8 HNP PST HAY YDT +# -9 HNY YST - - +# +# HN: Heure Normale ST: Standard Time +# HA: Heure Avanc<e'>e DT: Daylight saving Time +# +# A: de l'Atlantique Atlantic +# C: du Centre Central +# E: de l'Est Eastern +# M: Mountain +# N: Newfoundland +# P: du Pacifique Pacific +# R: des Rocheuses +# T: de Terre-Neuve +# Y: du Yukon Yukon +# +# From Paul Eggert <eggert@twinsun.com> (1994-11-22): +# Alas, this sort of thing must be handled by localization software. + + + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule StJohns 1884 only - Jan 1 0:00 0 S +Rule StJohns 1917 1918 - Apr Sun>=8 2:00 1:00 D +Rule StJohns 1917 only - Sep 17 2:00 0 S +Rule StJohns 1918 only - Oct 31 2:00 0 S +# Whitman gives 1919 Apr 5 and 1920 Apr 5; go with Shanks. +Rule StJohns 1919 only - May 5 23:00 1:00 D +Rule StJohns 1919 only - Aug 12 23:00 0 S +# For 1931-1935 Whitman gives Apr same date; go with Shanks. +Rule StJohns 1920 1935 - May Sun>=1 23:00 1:00 D +Rule StJohns 1920 1935 - Oct lastSun 23:00 0 S +# For 1936-1941 Shanks gives May Mon>=9 and Oct Mon>=2; go with Whitman. +Rule StJohns 1936 1941 - May Sun>=8 0:00 1:00 D +Rule StJohns 1936 1941 - Oct Sun>=1 0:00 0 S +# Shanks gives 1942 May 11 - 1945 Sep 30; go with Whitman. +Rule StJohns 1942 only - Mar 1 0:00 1:00 D +Rule StJohns 1942 only - Dec 31 0:00 0 S +Rule StJohns 1943 only - May 30 0:00 1:00 D +Rule StJohns 1943 only - Sep 5 0:00 0 S +Rule StJohns 1944 only - Jul 10 0:00 1:00 D +Rule StJohns 1944 only - Sep 2 0:00 0 S +Rule StJohns 1945 only - Jan 1 0:00 1:00 D +Rule StJohns 1945 only - Oct 7 2:00 0 S +# For 1946-9 Whitman gives May 5,4,9,1 - Oct 1,5,3,2, and for 1950 he gives +# Apr 30 - Sep 24; go with Shanks. +Rule StJohns 1946 1950 - May Sun>=8 2:00 1:00 D +Rule StJohns 1946 1950 - Oct Sun>=2 2:00 0 S +Rule StJohns 1951 1986 - Apr lastSun 2:00 1:00 D +Rule StJohns 1951 1959 - Sep lastSun 2:00 0 S +Rule StJohns 1960 max - Oct lastSun 2:00 0 S +Rule StJohns 1987 only - Apr Sun>=1 2:00 1:00 D +Rule StJohns 1988 only - Apr Sun>=1 2:00 2:00 D +Rule StJohns 1989 max - Apr Sun>=1 2:00 1:00 D +# St John's has an apostrophe, but Posix file names can't have apostrophes. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/St_Johns -3:30:52 - LMT 1884 + -3:31 StJohns N%sT 1935 Mar 30 + -3:30 StJohns N%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Halifax 1902 only - Jun 15 0:00 0 S +Rule Halifax 1916 only - Apr 1 0:00 1:00 D +Rule Halifax 1916 only - Oct 1 0:00 0 S +Rule Halifax 1918 only - Apr 14 2:00 1:00 D +Rule Halifax 1918 only - Oct 31 2:00 0 S +Rule Halifax 1920 only - May 9 0:00 1:00 D +Rule Halifax 1920 only - Aug 29 0:00 0 S +Rule Halifax 1921 only - May 6 0:00 1:00 D +Rule Halifax 1921 1922 - Sep 5 0:00 0 S +Rule Halifax 1922 only - Apr 30 0:00 1:00 D +Rule Halifax 1923 1925 - May Sun>=1 0:00 1:00 D +Rule Halifax 1923 only - Sep 4 0:00 0 S +Rule Halifax 1924 only - Sep 15 0:00 0 S +Rule Halifax 1925 only - Sep 28 0:00 0 S +Rule Halifax 1926 only - May 16 0:00 1:00 D +Rule Halifax 1926 only - Sep 13 0:00 0 S +Rule Halifax 1927 only - May 1 0:00 1:00 D +Rule Halifax 1927 only - Sep 26 0:00 0 S +Rule Halifax 1928 1931 - May Sun>=8 0:00 1:00 D +Rule Halifax 1928 only - Sep 9 0:00 0 S +Rule Halifax 1929 only - Sep 3 0:00 0 S +Rule Halifax 1930 only - Sep 15 0:00 0 S +Rule Halifax 1931 1932 - Sep Mon>=24 0:00 0 S +Rule Halifax 1933 only - Apr 30 0:00 1:00 D +Rule Halifax 1933 only - Oct 2 0:00 0 S +Rule Halifax 1934 only - May 20 0:00 1:00 D +Rule Halifax 1934 only - Sep 16 0:00 0 S +Rule Halifax 1935 only - Jun 2 0:00 1:00 D +Rule Halifax 1935 only - Sep 30 0:00 0 S +Rule Halifax 1936 only - Jun 1 0:00 1:00 D +Rule Halifax 1936 only - Sep 14 0:00 0 S +Rule Halifax 1937 1938 - May Sun>=1 0:00 1:00 D +Rule Halifax 1937 1941 - Sep Mon>=24 0:00 0 S +Rule Halifax 1939 only - May 28 0:00 1:00 D +Rule Halifax 1940 1941 - May Sun>=1 0:00 1:00 D +Rule Halifax 1942 only - Feb 9 2:00 1:00 D +Rule Halifax 1945 1959 - Sep lastSun 2:00 0 S +Rule Halifax 1946 1959 - Apr lastSun 2:00 1:00 D +Rule Halifax 1962 1986 - Apr lastSun 2:00 1:00 D +Rule Halifax 1962 max - Oct lastSun 2:00 0 S +Rule Halifax 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Halifax -4:14:24 - LMT 1902 Jun 15 + -4:00 Halifax A%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Mont 1884 only - Jan 1 0:00 0 S +Rule Mont 1917 only - Mar 25 2:00 1:00 D +Rule Mont 1917 only - Apr 24 0:00 0 S +Rule Mont 1918 only - Apr 14 2:00 1:00 D +Rule Mont 1918 only - Oct 31 2:00 0 S +Rule Mont 1919 only - Mar 31 2:30 1:00 D +Rule Mont 1919 only - Oct 25 2:30 0 S +Rule Mont 1920 only - May 2 2:30 1:00 D +Rule Mont 1920 only - Oct 3 2:30 0 S +Rule Mont 1921 only - May 1 2:00 1:00 D +Rule Mont 1921 only - Oct 2 2:30 0 S +Rule Mont 1922 only - Apr 30 2:00 1:00 D +Rule Mont 1922 only - Oct 1 2:30 0 S +Rule Mont 1924 only - May 17 2:00 1:00 D +Rule Mont 1924 1926 - Sep lastSun 2:30 0 S +Rule Mont 1925 1926 - May Sun>=1 2:00 1:00 D +Rule Mont 1927 only - May 1 0:00 1:00 D +Rule Mont 1927 1932 - Sep Sun>=25 0:00 0 S +Rule Mont 1928 1931 - Apr Sun>=25 0:00 1:00 D +Rule Mont 1932 only - May 1 0:00 1:00 D +Rule Mont 1933 1940 - Apr Sun>=24 0:00 1:00 D +Rule Mont 1933 only - Oct 1 0:00 0 S +Rule Mont 1934 1939 - Sep Sun>=24 0:00 0 S +Rule Mont 1945 1948 - Sep lastSun 2:00 0 S +Rule Mont 1946 1986 - Apr lastSun 2:00 1:00 D +Rule Mont 1949 1950 - Oct lastSun 2:00 0 S +Rule Mont 1951 1956 - Sep lastSun 2:00 0 S +Rule Mont 1957 max - Oct lastSun 2:00 0 S +Rule Mont 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Montreal -4:54:16 - LMT 1884 + -5:00 Mont E%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Winn 1887 only - Jul 16 0:00 0 S +Rule Winn 1916 only - Apr 23 0:00 1:00 D +Rule Winn 1916 only - Sep 17 0:00 0 S +Rule Winn 1918 only - Apr 14 2:00 1:00 D +Rule Winn 1918 only - Oct 31 2:00 0 S +Rule Winn 1937 only - May 16 2:00 1:00 D +Rule Winn 1937 only - Sep 23 2:00 0 S +Rule Winn 1942 only - Feb 9 2:00 1:00 D +Rule Winn 1945 only - Sep lastSun 2:00 0 S +Rule Winn 1946 only - May 12 2:00 1:00 D +Rule Winn 1946 only - Oct 13 2:00 0 S +Rule Winn 1947 1949 - Apr lastSun 2:00 1:00 D +Rule Winn 1947 1958 - Sep lastSun 2:00 0 S +Rule Winn 1948 only - May 1 2:00 1:00 D +Rule Winn 1948 1960 - Apr lastSun 2:00 1:00 D +Rule Winn 1959 only - Oct lastSun 2:00 0 S +Rule Winn 1960 only - Sep lastSun 2:00 0 S +Rule Winn 1963 only - Apr lastSun 2:00 1:00 D +Rule Winn 1963 only - Sep lastSun 2:00 0 S +Rule Winn 1966 1986 - Apr lastSun 2:00 1:00 D +Rule Winn 1966 max - Sep lastSun 2:00 0 S +Rule Winn 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Winnipeg -6:28:36 - LMT 1887 Jul 16 + -6:00 Winn C%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Regina 1905 only - Sep 1 0:00 0 S +Rule Regina 1918 only - Apr 14 2:00 1:00 D +Rule Regina 1918 only - Oct 31 2:00 0 S +Rule Regina 1930 1934 - May Sun>=1 0:00 1:00 D +Rule Regina 1930 1934 - Oct Sun>=1 0:00 0 S +Rule Regina 1937 1941 - Apr Sun>=8 0:00 1:00 D +Rule Regina 1937 only - Oct Sun>=8 0:00 0 S +Rule Regina 1938 only - Oct Sun>=1 0:00 0 S +Rule Regina 1939 1941 - Oct Sun>=8 0:00 0 S +Rule Regina 1942 only - Feb 9 2:00 1:00 D +Rule Regina 1945 only - Sep lastSun 2:00 0 S +Rule Regina 1946 only - Apr 14 2:00 1:00 D +Rule Regina 1946 only - Oct 13 2:00 0 S +Rule Regina 1947 1960 - Apr lastSun 2:00 1:00 D +Rule Regina 1947 1959 - Sep lastSun 2:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Regina -6:58:36 - LMT 1905 Sep + -7:00 Regina M%sT 1966 Apr 15 + -6:00 - CST + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Edm 1906 only - Sep 1 0:00 0 S +Rule Edm 1918 1919 - Apr Sun>=8 2:00 1:00 D +Rule Edm 1918 only - Oct 31 2:00 0 S +Rule Edm 1919 only - May 27 2:00 0 S +Rule Edm 1920 1923 - Apr lastSun 2:00 1:00 D +Rule Edm 1920 only - Oct lastSun 2:00 0 S +Rule Edm 1921 1923 - Sep lastSun 2:00 0 S +Rule Edm 1942 only - Feb 9 2:00 1:00 D +Rule Edm 1945 only - Sep lastSun 2:00 0 S +Rule Edm 1947 only - Apr lastSun 2:00 1:00 D +Rule Edm 1947 only - Sep lastSun 2:00 0 S +Rule Edm 1967 only - Apr lastSun 2:00 1:00 D +Rule Edm 1967 only - Oct lastSun 2:00 0 S +Rule Edm 1969 only - Apr lastSun 2:00 1:00 D +Rule Edm 1969 only - Oct lastSun 2:00 0 S +Rule Edm 1972 1986 - Apr lastSun 2:00 1:00 D +Rule Edm 1972 max - Oct lastSun 2:00 0 S +Rule Edm 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Edmonton -7:33:52 - LMT 1906 Sep + -7:00 Edm M%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Vanc 1884 only - Jan 1 0:00 0 S +Rule Vanc 1918 only - Apr 14 2:00 1:00 D +Rule Vanc 1918 only - Oct 31 2:00 0 S +Rule Vanc 1942 only - Feb 9 2:00 1:00 D +Rule Vanc 1945 only - Sep 30 2:00 0 S +Rule Vanc 1946 1986 - Apr lastSun 2:00 1:00 D +Rule Vanc 1946 only - Oct 13 2:00 0 S +Rule Vanc 1947 1961 - Sep lastSun 2:00 0 S +Rule Vanc 1962 max - Oct lastSun 2:00 0 S +Rule Vanc 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Vancouver -8:12:28 - LMT 1884 + -8:00 Vanc P%sT + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Yukon 1900 only - Jan 1 0:00 0 S +Rule Yukon 1918 only - Apr 14 2:00 1:00 D +Rule Yukon 1918 only - Oct 27 2:00 0 S +Rule Yukon 1919 only - May 25 2:00 1:00 D +Rule Yukon 1919 only - Nov 1 0:00 0 S +Rule Yukon 1942 only - Feb 9 2:00 1:00 D +Rule Yukon 1965 only - Apr 25 0:00 1:00 D +Rule Yukon 1965 only - Oct 31 2:00 0 S +Rule Yukon 1980 1986 - Apr lastSun 2:00 1:00 D +Rule Yukon 1980 max - Oct lastSun 2:00 0 S +Rule Yukon 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 + -9:00 Yukon Y%sT 1966 Jul + -8:00 Yukon P%sT +# Parts of Yukon (e.g. Dawson) didn't switch to -8:00 until 1973 Oct 28. + +############################################################################### + +# Mexico + +# From Guy Harris: +# Rules are from the Official Airline Guide, Worldwide Edition, for 1987. +# Rules prior to 1987 are unknown. +# The comments in the OAG say "Only Ensenada, Mexicale, San Felipe and Tijuana +# observe DST." This is presumably Baja California Norte, above 28th parallel, +# as listed there; Mexico/BajaSur is for "Baja California Sur and N. Pacific +# Coast (States of Sinaloa and Sonora)." + +# From Bob Devine (January 28, 1988): +# The Federal District (where Mexico City is) has observed [DST] several +# times but not recently. +# +# I don't where to drawn the line in the North Baja area. 28th latitude +# sounds good -- but it may be higher (how far [d]o radio stations from +# San Diego affect culture?). +# +# The dates of DST probably go back to 1981. The rules are the same as +# US's. This is going to be a headache for US presidential electi[o]n years! + +# From Arthur David Olson (February 13, 1988) +# Since the 1981 starting date is only "probable," we'll keep the 1987 +# starting date below. + +# From U. S. Naval Observatory (January 19, 1989): +# MEXICO BAJA CAL N 7 H BEHIND UTC BAJA CALIFORNIA SUR AND +# MEXICO BAJA CAL N N. PACIFIC COAST (STATES +# MEXICO BAJA CAL N OF SINALOA AND SONORA) +# MEXICO BAJA CAL N 8 H BEHIND UTC ABOVE 28TH PARALLAL APR 3 +# MEXICO BAJA CAL N - OCT 29 +# MEXICO BAJA CAL N 7 H BEHIND UTC ABOVE 28TH PARALLAL APR 3 +# MEXICO BAJA CAL N - 0CT 29 +# MEXICO 6 H BEHIND UTC STATES OF DURANGO, +# MEXICO COAHUILA, NUEVO LEON, +# MEXICO TAMAULIPAS +# MEXICO 5 H BEHIND UTC STATES OF DURANGO, +# MEXICO COAHUILA, NUEVO LEON, +# MEXICO TAMAULIPAS APR 3 - OCT 29 +# MEXICO 6 H BEHIND UTC GENERAL MEXICO, STATES OF +# MEXICO CAMPECHE, QUINTANA ROO AND +# MEXICO YUCATAN + +# From Arthur David Olson (January 21, 1989): +# April 3 fell on a Sunday in 1988; October 29 fell on a Sunday in 1989. Ahem. +# USNO claims there should be four Mexican zones rather than three: +# a zone that's GMT-8 with DST; a zone that's always GMT-7; +# a zone that's GMT-6 with DST; and a zone that's always GMT-6. + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Shanks also says there are four zones, but disagrees about the fourth. +# Instead of GMT-6 with DST, he says there's GMT-8 without DST. + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Mexico 1922 only - Jan 1 0:00 0 S +Rule Mexico 1939 only - Feb 5 0:00 1:00 D +Rule Mexico 1939 only - Jun 25 0:00 0 S +Rule Mexico 1940 only - Dec 9 0:00 1:00 D +Rule Mexico 1941 only - Apr 1 0:00 0 S +Rule Mexico 1943 only - Dec 16 0:00 1:00 D +Rule Mexico 1944 only - May 1 0:00 0 S +Rule Mexico 1950 only - Feb 12 0:00 1:00 D +Rule Mexico 1950 only - Jul 30 0:00 0 S +Rule BajaN 1950 1966 - Apr lastSun 2:00 1:00 D +Rule BajaN 1950 1961 - Sep lastSun 2:00 0 S +Rule BajaN 1961 1966 - Oct lastSun 2:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24 + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 - MST 1931 May 1 23:00 + -6:00 - CST 1931 Oct + -7:00 - MST 1932 Mar 30 23:00 + -6:00 Mexico C%sT +Zone America/Mazatlan -7:05:40 - LMT 1921 Dec 31 23:54:20 + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 - MST 1931 May 1 23:00 + -6:00 - CST 1931 Oct + -7:00 - MST 1932 Mar 30 23:00 + -6:00 - CST 1942 Apr + -7:00 - MST 1949 Jan 14 + -8:00 - PST 1970 + -7:00 - MST +Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56 + -8:00 - PST 1927 Jun 10 23:00 + -7:00 - MST 1930 Nov 16 + -8:00 - PST 1942 Apr + -7:00 - MST 1949 Jan 14 + -8:00 BajaN P%sT 1967 Apr lastSun 2:00 + -8:00 US P%sT +Zone America/Ensenada -7:46:28 - LMT 1922 Jan 1 0:13:32 + -8:00 - PST 1927 Jun 10 23:00 + -7:00 - MST 1930 Nov 16 + -8:00 - PST 1942 Apr + -7:00 - MST 1949 Jan 14 + -8:00 - PST +# +# Revillagigedo Is +# no information + +############################################################################### + +# Anguilla +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Anguilla -4:12:16 - LMT 1912 Mar 2 + -4:00 - AST + +# Antigua and Barbuda +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Antigua -4:07:12 - LMT 1912 Mar 2 + -5:00 - EST 1951 + -4:00 - AST + +# Bahamas +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Bahamas 1912 only - Mar 2 0:00 0 S +Rule Bahamas 1964 max - Oct lastSun 2:00 0 S +Rule Bahamas 1964 1986 - Apr lastSun 2:00 1:00 D +Rule Bahamas 1987 max - Apr Sun>=1 2:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Nassau -5:09:24 - LMT 1912 Mar 2 + -5:00 Bahamas E%sT + +# Barbados +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Barb 1932 only - Jan 1 0:00 0 S +Rule Barb 1977 only - Jun 12 2:00 1:00 D +Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S +Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D +Rule Barb 1979 only - Sep 30 2:00 0 S +Rule Barb 1980 only - Sep 25 2:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Barbados -3:58:28 - LMT 1924 # Bridgetown + -3:58 - BMT 1932 # Bridgetown Mean Time + -4:00 Barb A%sT + +# Belize +# Whitman entirely disagrees with Shanks; go with Shanks. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Belize 1912 only - Apr 1 0:00 0 S +Rule Belize 1918 1942 - Oct Sun>=2 0:00 0:30 HD +Rule Belize 1919 1943 - Feb Sun>=9 0:00 0 S +Rule Belize 1973 only - Dec 5 0:00 1:00 D +Rule Belize 1974 only - Feb 9 0:00 0 S +Rule Belize 1982 only - Dec 18 0:00 1:00 D +Rule Belize 1983 only - Feb 12 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Belize -5:52:48 - LMT 1912 Apr + -6:00 Belize C%sT + +# Bermuda +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Bermuda -4:19:04 - LMT 1930 Jan 1 2:00 # Hamilton + -4:00 - AST 1974 Apr 28 2:00 + -4:00 Bahamas A%sT + +# Cayman Is +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown + -5:07 - KMT 1912 Feb # Kingston Mean Time + -5:00 - EST + +# Clipperton +# no information + +# Costa Rica +# Shanks gives some very odd dates for 1991, and stops there. +# For now, we won't guess further. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule CR 1921 only - Jan 15 0:00 0 S +Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D +Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S +Rule CR 1991 only - Jan 19 0:00 1:00 D +Rule CR 1991 only - Jul 1 0:00 0 S +# There are too many San Joses elsewhere, so we'll use `Costa Rica'. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose + -5:36 - SJMT 1921 Jan 15 # San Jose Mean Time + -6:00 CR C%sT +# Coco +# no information; probably like America/Costa_Rica + +# Cuba + +# From Bob Devine (January 28, 1988): +# . . .DST is from 2nd Sunday in May to 2nd Sunday in October since 1981. +# Change at midnight. In 1979 & 1980, started at 3rd Sunday in March +# (I think). + +# From U. S. Naval Observatory (January 19, 1989): +# CUBA 5 H BEHIND UTC +# CUBA 4 H BEHIND UTC MAR 20 - OCT 8 + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Cuba 1925 only - Jul 19 12:00 0 S +Rule Cuba 1928 only - Jun 10 0:00 1:00 D +Rule Cuba 1928 only - Oct 10 0:00 0 S +Rule Cuba 1940 1942 - Jun Sun>=1 0:00 1:00 D +Rule Cuba 1940 1942 - Sep Sun>=1 0:00 0 S +Rule Cuba 1945 1946 - Jun Sun>=1 0:00 1:00 D +Rule Cuba 1945 1946 - Sep Sun>=1 0:00 0 S +Rule Cuba 1965 only - Jun 1 0:00 1:00 D +Rule Cuba 1965 only - Sep 30 0:00 0 S +Rule Cuba 1966 only - May 29 0:00 1:00 D +Rule Cuba 1966 only - Oct 2 0:00 0 S +Rule Cuba 1967 only - Apr 8 0:00 1:00 D +Rule Cuba 1967 1968 - Sep Sun>=8 0:00 0 S +Rule Cuba 1968 only - Apr 14 0:00 1:00 D +Rule Cuba 1969 1977 - Apr lastSun 0:00 1:00 D +Rule Cuba 1969 1971 - Oct lastSun 0:00 0 S +Rule Cuba 1972 1974 - Oct 8 0:00 0 S +Rule Cuba 1975 1977 - Oct lastSun 0:00 0 S +Rule Cuba 1978 only - May 7 0:00 1:00 D +Rule Cuba 1978 1980 - Oct Sun>=8 0:00 0 S +Rule Cuba 1979 1980 - Mar Sun>=15 0:00 1:00 D +Rule Cuba 1981 1985 - May Sun>=5 0:00 1:00 D +Rule Cuba 1981 max - Oct Sun>=8 0:00 0 S +Rule Cuba 1986 1989 - Mar Sun>=14 0:00 1:00 D +Rule Cuba 1990 only - Apr 1 0:00 1:00 D +Rule Cuba 1991 max - Mar Sun>=14 0:00 1:00 D + +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Havana -5:29:28 - LMT 1890 + -5:30 - HMT 1925 Jul 19 12:00 # Havana MT + -5:00 Cuba C%sT + +# Dominica +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Dominica -4:05:36 - LMT 1911 Jul 1 0:01 # Roseau + -4:00 - AST + +# Dominican Republic +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule DR 1933 only - Apr 1 12:00 0 S +Rule DR 1966 only - Oct 30 0:00 1:00 D +Rule DR 1967 only - Feb 28 0:00 0 S +Rule DR 1969 1973 - Oct lastSun 0:00 0:30 HD +Rule DR 1970 only - Feb 21 0:00 0 S +Rule DR 1971 only - Jan 20 0:00 0 S +Rule DR 1972 1974 - Jan 21 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Santo_Domingo -4:39:36 - LMT 1890 + -4:40 - SDMT 1933 Apr 1 12:00 # S. Dom. MT + -5:00 DR E%sT 1974 Oct 27 + -4:00 - AST + +# El Salvador +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Salv 1921 only - Jan 1 0:00 0 S +Rule Salv 1987 1988 - May Sun>=1 0:00 1:00 D +Rule Salv 1987 1988 - Sep lastSun 0:00 0 S +# There are too many San Salvadors elsewhere, so we'll use `El Salvador'. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/El_Salvador -5:56:48 - LMT 1921 # San Salvador + -6:00 Salv C%sT + +# Grenada +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Grenada -4:07:00 - LMT 1911 Jul + -4:00 - AST + +# Guadeloupe +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe a Pitre + -4:00 - AST + +# Guatemala +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Guat 1918 only - Oct 5 0:00 0 S +Rule Guat 1973 only - Nov 25 0:00 1:00 D +Rule Guat 1974 only - Feb 24 0:00 0 S +Rule Guat 1983 only - May 21 0:00 1:00 D +Rule Guat 1983 only - Sep 22 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5 + -6:00 Guat C%sT + +# Haiti +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Haiti 1917 only - Jan 24 12:00 0 S +Rule Haiti 1983 only - May 8 0:00 1:00 D +Rule Haiti 1984 1987 - Apr lastSun 0:00 1:00 D +Rule Haiti 1983 1987 - Oct lastSun 0:00 0 S +Rule Haiti 1988 max - Apr Sun>=1 2:00 1:00 D +Rule Haiti 1988 max - Oct lastSun 2:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Port-au-Prince -4:49:20 - LMT 1890 + -4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT + -5:00 Haiti E%sT + +# Honduras +# Shanks says 1921 Jan 1; go with Whitman's more precise Apr 1. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr + -6:00 Salv C%sT + +# Jamaica + +# From Bob Devine (January 28, 1988): +# Follows US rules. + +# From U. S. Naval Observatory (January 19, 1989): +# JAMAICA 5 H BEHIND UTC + +# From Shanks (1991): +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Jamaica -5:07:12 - LMT 1890 # Kingston + -5:07 - KMT 1912 Feb # Kingston Mean Time + -5:00 - EST 1974 Jan 6 2:00 + -5:00 US E%sT + +# Martinique +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France + -4:04 - FFMT 1911 May # Fort-de-France MT + -4:00 - AST 1980 Apr 6 + -4:00 1:00 ADT 1980 Sep 28 + -4:00 - AST + +# Montserrat +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Montserrat -4:08:52 - LMT 1911 Jul 1 0:01 # Plymouth + -4:00 - AST + +# Nicaragua +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Nic 1975 only - Feb 16 0:00 0 S +Rule Nic 1979 1980 - Mar Sun>=16 0:00 1:00 D +Rule Nic 1979 1980 - Jun Mon>=23 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Managua -5:45:08 - LMT 1890 + -5:45 - MMT 1934 Jun 23 # Managua Mean Time + -6:00 - CST 1973 May + -5:00 - EST 1975 Feb 16 + -6:00 Nic C%sT + +# Panama +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Panama -5:18:08 - LMT 1890 + -5:20 - PMT 1908 Apr 22 # Panama Mean Time + -5:00 - EST + +# Puerto Rico +# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Puerto_Rico -4:24:28 - LMT 1899 Mar 28 12:00 # San Juan + -4:00 - AST 1942 May 3 + -4:00 1:00 ADT 1945 Sep 30 2:00 + -4:00 - AST + +# St Kitts-Nevis +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/St_Kitts -4:10:52 - LMT 1912 Mar 2 # Basseterre + -4:00 - AST + +# St Lucia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/St_Lucia -4:04:00 - LMT 1890 # Castries + -4:04 - CMT 1912 # Castries Mean Time + -4:00 - AST + +# St Pierre and Miquelon +# There are too many St Pierres elsewhere, so we'll use `Miquelon'. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre + -4:00 - AST 1980 May + -3:00 Mont SP%sT + +# St Vincent and the Grenadines +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown + -4:05 - KMT 1912 # Kingstown Mean Time + -4:00 - AST + +# Turks and Caicos +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Grand_Turk -4:44:32 - LMT 1890 + -5:07 - KMT 1912 Feb # Kingston Mean Time + -5:00 - EST 1979 Apr 29 2:00 + -5:00 US E%sT + +# Virgin Is (British and US) +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Virgin -4:19:44 - LMT 1911 Jul # Charlotte Amalie + -4:00 - AST diff --git a/time/offtime.c b/time/offtime.c new file mode 100644 index 0000000000..a392a47e89 --- /dev/null +++ b/time/offtime.c @@ -0,0 +1,84 @@ +/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <time.h> + + +/* Defined in mktime.c. */ +extern CONST unsigned short int __mon_lengths[2][12]; + +#define SECS_PER_HOUR (60 * 60) +#define SECS_PER_DAY (SECS_PER_HOUR * 24) + +/* Returns the `struct tm' representation of *T, + offset OFFSET seconds east of UCT. */ +struct tm * +DEFUN(__offtime, (t, offset), CONST time_t *t AND long int offset) +{ + static struct tm tbuf; + register long int days, rem; + register int y; + register CONST unsigned short int *ip; + + if (t == NULL) + return NULL; + + days = *t / SECS_PER_DAY; + rem = *t % SECS_PER_DAY; + rem += offset; + while (rem < 0) + { + rem += SECS_PER_DAY; + --days; + } + while (rem >= SECS_PER_DAY) + { + rem -= SECS_PER_DAY; + ++days; + } + tbuf.tm_hour = rem / SECS_PER_HOUR; + rem %= SECS_PER_HOUR; + tbuf.tm_min = rem / 60; + tbuf.tm_sec = rem % 60; + /* January 1, 1970 was a Thursday. */ + tbuf.tm_wday = (4 + days) % 7; + if (tbuf.tm_wday < 0) + tbuf.tm_wday += 7; + y = 1970; + while (days >= (rem = __isleap(y) ? 366 : 365)) + { + ++y; + days -= rem; + } + while (days < 0) + { + --y; + days += __isleap(y) ? 366 : 365; + } + tbuf.tm_year = y - 1900; + tbuf.tm_yday = days; + ip = __mon_lengths[__isleap(y)]; + for (y = 0; days >= ip[y]; ++y) + days -= ip[y]; + tbuf.tm_mon = y; + tbuf.tm_mday = days + 1; + tbuf.tm_isdst = -1; + + return &tbuf; +} diff --git a/time/pacificnew b/time/pacificnew new file mode 100644 index 0000000000..cd1477cc71 --- /dev/null +++ b/time/pacificnew @@ -0,0 +1,26 @@ +# @(#)pacificnew 7.6 + +# From Arthur David Olson (April 5, 1989): +# On April 5, 1989, the U. S. House of Representatives passed (238-154) a bill +# establishing "Pacific Presidential Election Time"; it was not acted on +# by the Senate or signed into law by the President. +# You might want to change the "PE" (Presidential Election) below to +# "Q" (Quadrennial) to maintain three-character zone abbreviations. +# If you're really conservative, you might want to change it to "D". +# Avoid "L" (Leap Year), which won't be true in 2100. + +# If Presidential Election Time is ever established, replace "XXXX" below +# with the year the law takes effect and uncomment the "##" lines. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +## Rule Twilite XXXX max - Apr Sun>=1 2:00 1:00 D +## Rule Twilite XXXX max uspres Oct lastSun 2:00 1:00 PE +## Rule Twilite XXXX max uspres Nov Sun>=7 2:00 0 S +## Rule Twilite XXXX max nonpres Oct lastSun 2:00 0 S + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +## Zone US/Pacific-PET -8:00 US P%sT XXXX +## -8:00 Twilite P%sT + +# For now... +Link America/Los_Angeles US/Pacific-New ## diff --git a/time/private.h b/time/private.h new file mode 100644 index 0000000000..8852b8337b --- /dev/null +++ b/time/private.h @@ -0,0 +1,210 @@ +#ifndef PRIVATE_H + +#define PRIVATE_H + +/* +** This header is for use ONLY with the time conversion code. +** There is no guarantee that it will remain unchanged, +** or that it will remain at all. +** Do NOT copy it to any system include directory. +** Thank you! +*/ + +/* +** ID +*/ + +#ifndef lint +#ifndef NOID +static char privatehid[] = "@(#)private.h 7.10"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +/* +** const +*/ + +#ifndef const +#ifndef __STDC__ +#define const +#endif /* !defined __STDC__ */ +#endif /* !defined const */ + +/* +** void +*/ + +#ifndef void +#ifndef __STDC__ +#ifndef vax +#ifndef sun +#define void char +#endif /* !defined sun */ +#endif /* !defined vax */ +#endif /* !defined __STDC__ */ +#endif /* !defined void */ + +/* +** INITIALIZE +*/ + +#ifndef GNUC_or_lint +#ifdef lint +#define GNUC_or_lint +#endif /* defined lint */ +#ifdef __GNUC__ +#define GNUC_or_lint +#endif /* defined __GNUC__ */ +#endif /* !defined GNUC_or_lint */ + +#ifndef INITIALIZE +#ifdef GNUC_or_lint +#define INITIALIZE(x) ((x) = 0) +#endif /* defined GNUC_or_lint */ +#ifndef GNUC_or_lint +#define INITIALIZE(x) +#endif /* !defined GNUC_or_lint */ +#endif /* !defined INITIALIZE */ + +/* +** P((args)) +*/ + +#ifndef P +#ifdef __STDC__ +#define P(x) x +#endif /* defined __STDC__ */ +#ifndef __STDC__ +#define P(x) () +#endif /* !defined __STDC__ */ +#endif /* !defined P */ + +/* +** genericptr_T +*/ + +#ifdef __STDC__ +typedef void * genericptr_T; +#endif /* defined __STDC__ */ +#ifndef __STDC__ +typedef char * genericptr_T; +#endif /* !defined __STDC__ */ + +#include "sys/types.h" /* for time_t */ +#include "stdio.h" +#include "ctype.h" +#include "errno.h" +#include "string.h" +#include "limits.h" /* for CHAR_BIT */ +#ifndef _TIME_ +#include "time.h" +#endif /* !defined _TIME_ */ + +#ifndef remove +extern int unlink P((const char * filename)); +#define remove unlink +#endif /* !defined remove */ + +#ifndef FILENAME_MAX + +#ifndef MAXPATHLEN +#ifdef unix +#include "sys/param.h" +#endif /* defined unix */ +#endif /* !defined MAXPATHLEN */ + +#ifdef MAXPATHLEN +#define FILENAME_MAX MAXPATHLEN +#endif /* defined MAXPATHLEN */ +#ifndef MAXPATHLEN +#define FILENAME_MAX 1024 /* Pure guesswork */ +#endif /* !defined MAXPATHLEN */ + +#endif /* !defined FILENAME_MAX */ + +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif /* !defined EXIT_SUCCESS */ + +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif /* !defined EXIT_FAILURE */ + +#ifdef __STDC__ + +#define alloc_size_T size_t +#define qsort_size_T size_t +#define fwrite_size_T size_t + +#endif /* defined __STDC__ */ +#ifndef __STDC__ + +#ifndef alloc_size_T +#define alloc_size_T unsigned +#endif /* !defined alloc_size_T */ + +#ifndef qsort_size_T +#ifdef USG +#define qsort_size_T unsigned +#endif /* defined USG */ +#ifndef USG +#define qsort_size_T int +#endif /* !defined USG */ +#endif /* !defined qsort_size_T */ + +#ifndef fwrite_size_T +#define fwrite_size_T int +#endif /* !defined fwrite_size_T */ + +#ifndef USG +extern char * sprintf P((char * buf, const char * format, ...)); +#endif /* !defined USG */ + +#endif /* !defined __STDC__ */ + +/* +** Ensure that these are declared--redundantly declaring them shouldn't hurt. +*/ + +extern char * getenv P((const char * name)); +extern genericptr_T malloc P((alloc_size_T size)); +extern genericptr_T calloc P((alloc_size_T nelem, alloc_size_T elsize)); +extern genericptr_T realloc P((genericptr_T oldptr, alloc_size_T newsize)); + +#ifdef USG +extern void exit P((int s)); +extern void qsort P((genericptr_T base, qsort_size_T nelem, + qsort_size_T elsize, int (*comp)())); +extern void perror P((const char * string)); +extern void free P((char * buf)); +#endif /* defined USG */ + +#ifndef TRUE +#define TRUE 1 +#endif /* !defined TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* !defined FALSE */ + +#ifndef INT_STRLEN_MAXIMUM +/* +** 302 / 1000 is log10(2.0) rounded up. +** Subtract one for the sign bit; +** add one for integer division truncation; +** add one more for a minus sign. +*/ +#define INT_STRLEN_MAXIMUM(type) \ + ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2) +#endif /* !defined INT_STRLEN_MAXIMUM */ + +#ifndef LOCALE_HOME +#define LOCALE_HOME "/usr/lib/locale" +#endif /* !defined LOCALE_HOME */ + +/* +** UNIX was a registered trademark of UNIX System Laboratories in 1993. +** VAX is a trademark of Digital Equipment Corporation. +*/ + +#endif /* !defined PRIVATE_H */ diff --git a/time/scheck.c b/time/scheck.c new file mode 100644 index 0000000000..404c6b2111 --- /dev/null +++ b/time/scheck.c @@ -0,0 +1,62 @@ +#ifndef lint +#ifndef NOID +static char elsieid[] = "@(#)scheck.c 8.12"; +#endif /* !defined lint */ +#endif /* !defined NOID */ + +/*LINTLIBRARY*/ + +#include "private.h" + +extern char * imalloc P((int n)); +extern void ifree P((char * p)); + +char * +scheck(string, format) +const char * const string; +char * const format; +{ + register char * fbuf; + register const char * fp; + register char * tp; + register int c; + register char * result; + char dummy; + static char nada; + + result = &nada; + if (string == NULL || format == NULL) + return result; + fbuf = imalloc((int) (2 * strlen(format) + 4)); + if (fbuf == NULL) + return result; + fp = format; + tp = fbuf; + while ((*tp++ = c = *fp++) != '\0') { + if (c != '%') + continue; + if (*fp == '%') { + *tp++ = *fp++; + continue; + } + *tp++ = '*'; + if (*fp == '*') + ++fp; + while (isascii(*fp) && isdigit(*fp)) + *tp++ = *fp++; + if (*fp == 'l' || *fp == 'h') + *tp++ = *fp++; + else if (*fp == '[') + do *tp++ = *fp++; + while (*fp != '\0' && *fp != ']'); + if ((*tp++ = *fp++) == '\0') + break; + } + *(tp - 1) = '%'; + *tp++ = 'c'; + *tp = '\0'; + if (sscanf(string, fbuf, &dummy) != 1) + result = (char *) format; + ifree(fbuf); + return result; +} diff --git a/time/solar87 b/time/solar87 new file mode 100644 index 0000000000..a4e2f39df9 --- /dev/null +++ b/time/solar87 @@ -0,0 +1,386 @@ +# @(#)solar87 7.2 + +# So much for footnotes about Saudi Arabia. +# Apparent noon times below are for Riyadh; your mileage will vary. +# Times were computed using formulas in the U.S. Naval Observatory's +# Almanac for Computers 1987; the formulas "will give EqT to an accuracy of +# [plus or minus two] seconds during the current year." +# +# Rounding to the nearest five seconds results in fewer than +# 256 different "time types"--a limit that's faced because time types are +# stored on disk as unsigned chars. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule sol87 1987 only - Jan 1 12:03:20s -0:03:20 - +Rule sol87 1987 only - Jan 2 12:03:50s -0:03:50 - +Rule sol87 1987 only - Jan 3 12:04:15s -0:04:15 - +Rule sol87 1987 only - Jan 4 12:04:45s -0:04:45 - +Rule sol87 1987 only - Jan 5 12:05:10s -0:05:10 - +Rule sol87 1987 only - Jan 6 12:05:40s -0:05:40 - +Rule sol87 1987 only - Jan 7 12:06:05s -0:06:05 - +Rule sol87 1987 only - Jan 8 12:06:30s -0:06:30 - +Rule sol87 1987 only - Jan 9 12:06:55s -0:06:55 - +Rule sol87 1987 only - Jan 10 12:07:20s -0:07:20 - +Rule sol87 1987 only - Jan 11 12:07:45s -0:07:45 - +Rule sol87 1987 only - Jan 12 12:08:10s -0:08:10 - +Rule sol87 1987 only - Jan 13 12:08:30s -0:08:30 - +Rule sol87 1987 only - Jan 14 12:08:55s -0:08:55 - +Rule sol87 1987 only - Jan 15 12:09:15s -0:09:15 - +Rule sol87 1987 only - Jan 16 12:09:35s -0:09:35 - +Rule sol87 1987 only - Jan 17 12:09:55s -0:09:55 - +Rule sol87 1987 only - Jan 18 12:10:15s -0:10:15 - +Rule sol87 1987 only - Jan 19 12:10:35s -0:10:35 - +Rule sol87 1987 only - Jan 20 12:10:55s -0:10:55 - +Rule sol87 1987 only - Jan 21 12:11:10s -0:11:10 - +Rule sol87 1987 only - Jan 22 12:11:30s -0:11:30 - +Rule sol87 1987 only - Jan 23 12:11:45s -0:11:45 - +Rule sol87 1987 only - Jan 24 12:12:00s -0:12:00 - +Rule sol87 1987 only - Jan 25 12:12:15s -0:12:15 - +Rule sol87 1987 only - Jan 26 12:12:30s -0:12:30 - +Rule sol87 1987 only - Jan 27 12:12:40s -0:12:40 - +Rule sol87 1987 only - Jan 28 12:12:55s -0:12:55 - +Rule sol87 1987 only - Jan 29 12:13:05s -0:13:05 - +Rule sol87 1987 only - Jan 30 12:13:15s -0:13:15 - +Rule sol87 1987 only - Jan 31 12:13:25s -0:13:25 - +Rule sol87 1987 only - Feb 1 12:13:35s -0:13:35 - +Rule sol87 1987 only - Feb 2 12:13:40s -0:13:40 - +Rule sol87 1987 only - Feb 3 12:13:50s -0:13:50 - +Rule sol87 1987 only - Feb 4 12:13:55s -0:13:55 - +Rule sol87 1987 only - Feb 5 12:14:00s -0:14:00 - +Rule sol87 1987 only - Feb 6 12:14:05s -0:14:05 - +Rule sol87 1987 only - Feb 7 12:14:10s -0:14:10 - +Rule sol87 1987 only - Feb 8 12:14:10s -0:14:10 - +Rule sol87 1987 only - Feb 9 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 10 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 11 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 12 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 13 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 14 12:14:15s -0:14:15 - +Rule sol87 1987 only - Feb 15 12:14:10s -0:14:10 - +Rule sol87 1987 only - Feb 16 12:14:10s -0:14:10 - +Rule sol87 1987 only - Feb 17 12:14:05s -0:14:05 - +Rule sol87 1987 only - Feb 18 12:14:00s -0:14:00 - +Rule sol87 1987 only - Feb 19 12:13:55s -0:13:55 - +Rule sol87 1987 only - Feb 20 12:13:50s -0:13:50 - +Rule sol87 1987 only - Feb 21 12:13:45s -0:13:45 - +Rule sol87 1987 only - Feb 22 12:13:35s -0:13:35 - +Rule sol87 1987 only - Feb 23 12:13:30s -0:13:30 - +Rule sol87 1987 only - Feb 24 12:13:20s -0:13:20 - +Rule sol87 1987 only - Feb 25 12:13:10s -0:13:10 - +Rule sol87 1987 only - Feb 26 12:13:00s -0:13:00 - +Rule sol87 1987 only - Feb 27 12:12:50s -0:12:50 - +Rule sol87 1987 only - Feb 28 12:12:40s -0:12:40 - +Rule sol87 1987 only - Mar 1 12:12:30s -0:12:30 - +Rule sol87 1987 only - Mar 2 12:12:20s -0:12:20 - +Rule sol87 1987 only - Mar 3 12:12:05s -0:12:05 - +Rule sol87 1987 only - Mar 4 12:11:55s -0:11:55 - +Rule sol87 1987 only - Mar 5 12:11:40s -0:11:40 - +Rule sol87 1987 only - Mar 6 12:11:25s -0:11:25 - +Rule sol87 1987 only - Mar 7 12:11:15s -0:11:15 - +Rule sol87 1987 only - Mar 8 12:11:00s -0:11:00 - +Rule sol87 1987 only - Mar 9 12:10:45s -0:10:45 - +Rule sol87 1987 only - Mar 10 12:10:30s -0:10:30 - +Rule sol87 1987 only - Mar 11 12:10:15s -0:10:15 - +Rule sol87 1987 only - Mar 12 12:09:55s -0:09:55 - +Rule sol87 1987 only - Mar 13 12:09:40s -0:09:40 - +Rule sol87 1987 only - Mar 14 12:09:25s -0:09:25 - +Rule sol87 1987 only - Mar 15 12:09:10s -0:09:10 - +Rule sol87 1987 only - Mar 16 12:08:50s -0:08:50 - +Rule sol87 1987 only - Mar 17 12:08:35s -0:08:35 - +Rule sol87 1987 only - Mar 18 12:08:15s -0:08:15 - +Rule sol87 1987 only - Mar 19 12:08:00s -0:08:00 - +Rule sol87 1987 only - Mar 20 12:07:40s -0:07:40 - +Rule sol87 1987 only - Mar 21 12:07:25s -0:07:25 - +Rule sol87 1987 only - Mar 22 12:07:05s -0:07:05 - +Rule sol87 1987 only - Mar 23 12:06:50s -0:06:50 - +Rule sol87 1987 only - Mar 24 12:06:30s -0:06:30 - +Rule sol87 1987 only - Mar 25 12:06:10s -0:06:10 - +Rule sol87 1987 only - Mar 26 12:05:55s -0:05:55 - +Rule sol87 1987 only - Mar 27 12:05:35s -0:05:35 - +Rule sol87 1987 only - Mar 28 12:05:15s -0:05:15 - +Rule sol87 1987 only - Mar 29 12:05:00s -0:05:00 - +Rule sol87 1987 only - Mar 30 12:04:40s -0:04:40 - +Rule sol87 1987 only - Mar 31 12:04:25s -0:04:25 - +Rule sol87 1987 only - Apr 1 12:04:05s -0:04:05 - +Rule sol87 1987 only - Apr 2 12:03:45s -0:03:45 - +Rule sol87 1987 only - Apr 3 12:03:30s -0:03:30 - +Rule sol87 1987 only - Apr 4 12:03:10s -0:03:10 - +Rule sol87 1987 only - Apr 5 12:02:55s -0:02:55 - +Rule sol87 1987 only - Apr 6 12:02:35s -0:02:35 - +Rule sol87 1987 only - Apr 7 12:02:20s -0:02:20 - +Rule sol87 1987 only - Apr 8 12:02:05s -0:02:05 - +Rule sol87 1987 only - Apr 9 12:01:45s -0:01:45 - +Rule sol87 1987 only - Apr 10 12:01:30s -0:01:30 - +Rule sol87 1987 only - Apr 11 12:01:15s -0:01:15 - +Rule sol87 1987 only - Apr 12 12:00:55s -0:00:55 - +Rule sol87 1987 only - Apr 13 12:00:40s -0:00:40 - +Rule sol87 1987 only - Apr 14 12:00:25s -0:00:25 - +Rule sol87 1987 only - Apr 15 12:00:10s -0:00:10 - +Rule sol87 1987 only - Apr 16 11:59:55s 0:00:05 - +Rule sol87 1987 only - Apr 17 11:59:45s 0:00:15 - +Rule sol87 1987 only - Apr 18 11:59:30s 0:00:30 - +Rule sol87 1987 only - Apr 19 11:59:15s 0:00:45 - +Rule sol87 1987 only - Apr 20 11:59:05s 0:00:55 - +Rule sol87 1987 only - Apr 21 11:58:50s 0:01:10 - +Rule sol87 1987 only - Apr 22 11:58:40s 0:01:20 - +Rule sol87 1987 only - Apr 23 11:58:25s 0:01:35 - +Rule sol87 1987 only - Apr 24 11:58:15s 0:01:45 - +Rule sol87 1987 only - Apr 25 11:58:05s 0:01:55 - +Rule sol87 1987 only - Apr 26 11:57:55s 0:02:05 - +Rule sol87 1987 only - Apr 27 11:57:45s 0:02:15 - +Rule sol87 1987 only - Apr 28 11:57:35s 0:02:25 - +Rule sol87 1987 only - Apr 29 11:57:25s 0:02:35 - +Rule sol87 1987 only - Apr 30 11:57:15s 0:02:45 - +Rule sol87 1987 only - May 1 11:57:10s 0:02:50 - +Rule sol87 1987 only - May 2 11:57:00s 0:03:00 - +Rule sol87 1987 only - May 3 11:56:55s 0:03:05 - +Rule sol87 1987 only - May 4 11:56:50s 0:03:10 - +Rule sol87 1987 only - May 5 11:56:45s 0:03:15 - +Rule sol87 1987 only - May 6 11:56:40s 0:03:20 - +Rule sol87 1987 only - May 7 11:56:35s 0:03:25 - +Rule sol87 1987 only - May 8 11:56:30s 0:03:30 - +Rule sol87 1987 only - May 9 11:56:25s 0:03:35 - +Rule sol87 1987 only - May 10 11:56:25s 0:03:35 - +Rule sol87 1987 only - May 11 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 12 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 13 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 14 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 15 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 16 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 17 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 18 11:56:20s 0:03:40 - +Rule sol87 1987 only - May 19 11:56:25s 0:03:35 - +Rule sol87 1987 only - May 20 11:56:25s 0:03:35 - +Rule sol87 1987 only - May 21 11:56:30s 0:03:30 - +Rule sol87 1987 only - May 22 11:56:35s 0:03:25 - +Rule sol87 1987 only - May 23 11:56:40s 0:03:20 - +Rule sol87 1987 only - May 24 11:56:45s 0:03:15 - +Rule sol87 1987 only - May 25 11:56:50s 0:03:10 - +Rule sol87 1987 only - May 26 11:56:55s 0:03:05 - +Rule sol87 1987 only - May 27 11:57:00s 0:03:00 - +Rule sol87 1987 only - May 28 11:57:10s 0:02:50 - +Rule sol87 1987 only - May 29 11:57:15s 0:02:45 - +Rule sol87 1987 only - May 30 11:57:25s 0:02:35 - +Rule sol87 1987 only - May 31 11:57:30s 0:02:30 - +Rule sol87 1987 only - Jun 1 11:57:40s 0:02:20 - +Rule sol87 1987 only - Jun 2 11:57:50s 0:02:10 - +Rule sol87 1987 only - Jun 3 11:58:00s 0:02:00 - +Rule sol87 1987 only - Jun 4 11:58:10s 0:01:50 - +Rule sol87 1987 only - Jun 5 11:58:20s 0:01:40 - +Rule sol87 1987 only - Jun 6 11:58:30s 0:01:30 - +Rule sol87 1987 only - Jun 7 11:58:40s 0:01:20 - +Rule sol87 1987 only - Jun 8 11:58:50s 0:01:10 - +Rule sol87 1987 only - Jun 9 11:59:05s 0:00:55 - +Rule sol87 1987 only - Jun 10 11:59:15s 0:00:45 - +Rule sol87 1987 only - Jun 11 11:59:30s 0:00:30 - +Rule sol87 1987 only - Jun 12 11:59:40s 0:00:20 - +Rule sol87 1987 only - Jun 13 11:59:50s 0:00:10 - +Rule sol87 1987 only - Jun 14 12:00:05s -0:00:05 - +Rule sol87 1987 only - Jun 15 12:00:15s -0:00:15 - +Rule sol87 1987 only - Jun 16 12:00:30s -0:00:30 - +Rule sol87 1987 only - Jun 17 12:00:45s -0:00:45 - +Rule sol87 1987 only - Jun 18 12:00:55s -0:00:55 - +Rule sol87 1987 only - Jun 19 12:01:10s -0:01:10 - +Rule sol87 1987 only - Jun 20 12:01:20s -0:01:20 - +Rule sol87 1987 only - Jun 21 12:01:35s -0:01:35 - +Rule sol87 1987 only - Jun 22 12:01:50s -0:01:50 - +Rule sol87 1987 only - Jun 23 12:02:00s -0:02:00 - +Rule sol87 1987 only - Jun 24 12:02:15s -0:02:15 - +Rule sol87 1987 only - Jun 25 12:02:25s -0:02:25 - +Rule sol87 1987 only - Jun 26 12:02:40s -0:02:40 - +Rule sol87 1987 only - Jun 27 12:02:50s -0:02:50 - +Rule sol87 1987 only - Jun 28 12:03:05s -0:03:05 - +Rule sol87 1987 only - Jun 29 12:03:15s -0:03:15 - +Rule sol87 1987 only - Jun 30 12:03:30s -0:03:30 - +Rule sol87 1987 only - Jul 1 12:03:40s -0:03:40 - +Rule sol87 1987 only - Jul 2 12:03:50s -0:03:50 - +Rule sol87 1987 only - Jul 3 12:04:05s -0:04:05 - +Rule sol87 1987 only - Jul 4 12:04:15s -0:04:15 - +Rule sol87 1987 only - Jul 5 12:04:25s -0:04:25 - +Rule sol87 1987 only - Jul 6 12:04:35s -0:04:35 - +Rule sol87 1987 only - Jul 7 12:04:45s -0:04:45 - +Rule sol87 1987 only - Jul 8 12:04:55s -0:04:55 - +Rule sol87 1987 only - Jul 9 12:05:05s -0:05:05 - +Rule sol87 1987 only - Jul 10 12:05:15s -0:05:15 - +Rule sol87 1987 only - Jul 11 12:05:20s -0:05:20 - +Rule sol87 1987 only - Jul 12 12:05:30s -0:05:30 - +Rule sol87 1987 only - Jul 13 12:05:40s -0:05:40 - +Rule sol87 1987 only - Jul 14 12:05:45s -0:05:45 - +Rule sol87 1987 only - Jul 15 12:05:50s -0:05:50 - +Rule sol87 1987 only - Jul 16 12:06:00s -0:06:00 - +Rule sol87 1987 only - Jul 17 12:06:05s -0:06:05 - +Rule sol87 1987 only - Jul 18 12:06:10s -0:06:10 - +Rule sol87 1987 only - Jul 19 12:06:15s -0:06:15 - +Rule sol87 1987 only - Jul 20 12:06:15s -0:06:15 - +Rule sol87 1987 only - Jul 21 12:06:20s -0:06:20 - +Rule sol87 1987 only - Jul 22 12:06:25s -0:06:25 - +Rule sol87 1987 only - Jul 23 12:06:25s -0:06:25 - +Rule sol87 1987 only - Jul 24 12:06:25s -0:06:25 - +Rule sol87 1987 only - Jul 25 12:06:30s -0:06:30 - +Rule sol87 1987 only - Jul 26 12:06:30s -0:06:30 - +Rule sol87 1987 only - Jul 27 12:06:30s -0:06:30 - +Rule sol87 1987 only - Jul 28 12:06:30s -0:06:30 - +Rule sol87 1987 only - Jul 29 12:06:25s -0:06:25 - +Rule sol87 1987 only - Jul 30 12:06:25s -0:06:25 - +Rule sol87 1987 only - Jul 31 12:06:25s -0:06:25 - +Rule sol87 1987 only - Aug 1 12:06:20s -0:06:20 - +Rule sol87 1987 only - Aug 2 12:06:15s -0:06:15 - +Rule sol87 1987 only - Aug 3 12:06:10s -0:06:10 - +Rule sol87 1987 only - Aug 4 12:06:05s -0:06:05 - +Rule sol87 1987 only - Aug 5 12:06:00s -0:06:00 - +Rule sol87 1987 only - Aug 6 12:05:55s -0:05:55 - +Rule sol87 1987 only - Aug 7 12:05:50s -0:05:50 - +Rule sol87 1987 only - Aug 8 12:05:40s -0:05:40 - +Rule sol87 1987 only - Aug 9 12:05:35s -0:05:35 - +Rule sol87 1987 only - Aug 10 12:05:25s -0:05:25 - +Rule sol87 1987 only - Aug 11 12:05:15s -0:05:15 - +Rule sol87 1987 only - Aug 12 12:05:05s -0:05:05 - +Rule sol87 1987 only - Aug 13 12:04:55s -0:04:55 - +Rule sol87 1987 only - Aug 14 12:04:45s -0:04:45 - +Rule sol87 1987 only - Aug 15 12:04:35s -0:04:35 - +Rule sol87 1987 only - Aug 16 12:04:25s -0:04:25 - +Rule sol87 1987 only - Aug 17 12:04:10s -0:04:10 - +Rule sol87 1987 only - Aug 18 12:04:00s -0:04:00 - +Rule sol87 1987 only - Aug 19 12:03:45s -0:03:45 - +Rule sol87 1987 only - Aug 20 12:03:30s -0:03:30 - +Rule sol87 1987 only - Aug 21 12:03:15s -0:03:15 - +Rule sol87 1987 only - Aug 22 12:03:00s -0:03:00 - +Rule sol87 1987 only - Aug 23 12:02:45s -0:02:45 - +Rule sol87 1987 only - Aug 24 12:02:30s -0:02:30 - +Rule sol87 1987 only - Aug 25 12:02:15s -0:02:15 - +Rule sol87 1987 only - Aug 26 12:02:00s -0:02:00 - +Rule sol87 1987 only - Aug 27 12:01:40s -0:01:40 - +Rule sol87 1987 only - Aug 28 12:01:25s -0:01:25 - +Rule sol87 1987 only - Aug 29 12:01:05s -0:01:05 - +Rule sol87 1987 only - Aug 30 12:00:50s -0:00:50 - +Rule sol87 1987 only - Aug 31 12:00:30s -0:00:30 - +Rule sol87 1987 only - Sep 1 12:00:10s -0:00:10 - +Rule sol87 1987 only - Sep 2 11:59:50s 0:00:10 - +Rule sol87 1987 only - Sep 3 11:59:35s 0:00:25 - +Rule sol87 1987 only - Sep 4 11:59:15s 0:00:45 - +Rule sol87 1987 only - Sep 5 11:58:55s 0:01:05 - +Rule sol87 1987 only - Sep 6 11:58:35s 0:01:25 - +Rule sol87 1987 only - Sep 7 11:58:15s 0:01:45 - +Rule sol87 1987 only - Sep 8 11:57:55s 0:02:05 - +Rule sol87 1987 only - Sep 9 11:57:30s 0:02:30 - +Rule sol87 1987 only - Sep 10 11:57:10s 0:02:50 - +Rule sol87 1987 only - Sep 11 11:56:50s 0:03:10 - +Rule sol87 1987 only - Sep 12 11:56:30s 0:03:30 - +Rule sol87 1987 only - Sep 13 11:56:10s 0:03:50 - +Rule sol87 1987 only - Sep 14 11:55:45s 0:04:15 - +Rule sol87 1987 only - Sep 15 11:55:25s 0:04:35 - +Rule sol87 1987 only - Sep 16 11:55:05s 0:04:55 - +Rule sol87 1987 only - Sep 17 11:54:45s 0:05:15 - +Rule sol87 1987 only - Sep 18 11:54:20s 0:05:40 - +Rule sol87 1987 only - Sep 19 11:54:00s 0:06:00 - +Rule sol87 1987 only - Sep 20 11:53:40s 0:06:20 - +Rule sol87 1987 only - Sep 21 11:53:15s 0:06:45 - +Rule sol87 1987 only - Sep 22 11:52:55s 0:07:05 - +Rule sol87 1987 only - Sep 23 11:52:35s 0:07:25 - +Rule sol87 1987 only - Sep 24 11:52:15s 0:07:45 - +Rule sol87 1987 only - Sep 25 11:51:55s 0:08:05 - +Rule sol87 1987 only - Sep 26 11:51:35s 0:08:25 - +Rule sol87 1987 only - Sep 27 11:51:10s 0:08:50 - +Rule sol87 1987 only - Sep 28 11:50:50s 0:09:10 - +Rule sol87 1987 only - Sep 29 11:50:30s 0:09:30 - +Rule sol87 1987 only - Sep 30 11:50:10s 0:09:50 - +Rule sol87 1987 only - Oct 1 11:49:50s 0:10:10 - +Rule sol87 1987 only - Oct 2 11:49:35s 0:10:25 - +Rule sol87 1987 only - Oct 3 11:49:15s 0:10:45 - +Rule sol87 1987 only - Oct 4 11:48:55s 0:11:05 - +Rule sol87 1987 only - Oct 5 11:48:35s 0:11:25 - +Rule sol87 1987 only - Oct 6 11:48:20s 0:11:40 - +Rule sol87 1987 only - Oct 7 11:48:00s 0:12:00 - +Rule sol87 1987 only - Oct 8 11:47:45s 0:12:15 - +Rule sol87 1987 only - Oct 9 11:47:25s 0:12:35 - +Rule sol87 1987 only - Oct 10 11:47:10s 0:12:50 - +Rule sol87 1987 only - Oct 11 11:46:55s 0:13:05 - +Rule sol87 1987 only - Oct 12 11:46:40s 0:13:20 - +Rule sol87 1987 only - Oct 13 11:46:25s 0:13:35 - +Rule sol87 1987 only - Oct 14 11:46:10s 0:13:50 - +Rule sol87 1987 only - Oct 15 11:45:55s 0:14:05 - +Rule sol87 1987 only - Oct 16 11:45:45s 0:14:15 - +Rule sol87 1987 only - Oct 17 11:45:30s 0:14:30 - +Rule sol87 1987 only - Oct 18 11:45:20s 0:14:40 - +Rule sol87 1987 only - Oct 19 11:45:05s 0:14:55 - +Rule sol87 1987 only - Oct 20 11:44:55s 0:15:05 - +Rule sol87 1987 only - Oct 21 11:44:45s 0:15:15 - +Rule sol87 1987 only - Oct 22 11:44:35s 0:15:25 - +Rule sol87 1987 only - Oct 23 11:44:25s 0:15:35 - +Rule sol87 1987 only - Oct 24 11:44:20s 0:15:40 - +Rule sol87 1987 only - Oct 25 11:44:10s 0:15:50 - +Rule sol87 1987 only - Oct 26 11:44:05s 0:15:55 - +Rule sol87 1987 only - Oct 27 11:43:55s 0:16:05 - +Rule sol87 1987 only - Oct 28 11:43:50s 0:16:10 - +Rule sol87 1987 only - Oct 29 11:43:45s 0:16:15 - +Rule sol87 1987 only - Oct 30 11:43:45s 0:16:15 - +Rule sol87 1987 only - Oct 31 11:43:40s 0:16:20 - +Rule sol87 1987 only - Nov 1 11:43:40s 0:16:20 - +Rule sol87 1987 only - Nov 2 11:43:35s 0:16:25 - +Rule sol87 1987 only - Nov 3 11:43:35s 0:16:25 - +Rule sol87 1987 only - Nov 4 11:43:35s 0:16:25 - +Rule sol87 1987 only - Nov 5 11:43:35s 0:16:25 - +Rule sol87 1987 only - Nov 6 11:43:40s 0:16:20 - +Rule sol87 1987 only - Nov 7 11:43:40s 0:16:20 - +Rule sol87 1987 only - Nov 8 11:43:45s 0:16:15 - +Rule sol87 1987 only - Nov 9 11:43:50s 0:16:10 - +Rule sol87 1987 only - Nov 10 11:43:55s 0:16:05 - +Rule sol87 1987 only - Nov 11 11:44:00s 0:16:00 - +Rule sol87 1987 only - Nov 12 11:44:05s 0:15:55 - +Rule sol87 1987 only - Nov 13 11:44:15s 0:15:45 - +Rule sol87 1987 only - Nov 14 11:44:20s 0:15:40 - +Rule sol87 1987 only - Nov 15 11:44:30s 0:15:30 - +Rule sol87 1987 only - Nov 16 11:44:40s 0:15:20 - +Rule sol87 1987 only - Nov 17 11:44:50s 0:15:10 - +Rule sol87 1987 only - Nov 18 11:45:05s 0:14:55 - +Rule sol87 1987 only - Nov 19 11:45:15s 0:14:45 - +Rule sol87 1987 only - Nov 20 11:45:30s 0:14:30 - +Rule sol87 1987 only - Nov 21 11:45:45s 0:14:15 - +Rule sol87 1987 only - Nov 22 11:46:00s 0:14:00 - +Rule sol87 1987 only - Nov 23 11:46:15s 0:13:45 - +Rule sol87 1987 only - Nov 24 11:46:30s 0:13:30 - +Rule sol87 1987 only - Nov 25 11:46:50s 0:13:10 - +Rule sol87 1987 only - Nov 26 11:47:10s 0:12:50 - +Rule sol87 1987 only - Nov 27 11:47:25s 0:12:35 - +Rule sol87 1987 only - Nov 28 11:47:45s 0:12:15 - +Rule sol87 1987 only - Nov 29 11:48:05s 0:11:55 - +Rule sol87 1987 only - Nov 30 11:48:30s 0:11:30 - +Rule sol87 1987 only - Dec 1 11:48:50s 0:11:10 - +Rule sol87 1987 only - Dec 2 11:49:10s 0:10:50 - +Rule sol87 1987 only - Dec 3 11:49:35s 0:10:25 - +Rule sol87 1987 only - Dec 4 11:50:00s 0:10:00 - +Rule sol87 1987 only - Dec 5 11:50:25s 0:09:35 - +Rule sol87 1987 only - Dec 6 11:50:50s 0:09:10 - +Rule sol87 1987 only - Dec 7 11:51:15s 0:08:45 - +Rule sol87 1987 only - Dec 8 11:51:40s 0:08:20 - +Rule sol87 1987 only - Dec 9 11:52:05s 0:07:55 - +Rule sol87 1987 only - Dec 10 11:52:30s 0:07:30 - +Rule sol87 1987 only - Dec 11 11:53:00s 0:07:00 - +Rule sol87 1987 only - Dec 12 11:53:25s 0:06:35 - +Rule sol87 1987 only - Dec 13 11:53:55s 0:06:05 - +Rule sol87 1987 only - Dec 14 11:54:25s 0:05:35 - +Rule sol87 1987 only - Dec 15 11:54:50s 0:05:10 - +Rule sol87 1987 only - Dec 16 11:55:20s 0:04:40 - +Rule sol87 1987 only - Dec 17 11:55:50s 0:04:10 - +Rule sol87 1987 only - Dec 18 11:56:20s 0:03:40 - +Rule sol87 1987 only - Dec 19 11:56:50s 0:03:10 - +Rule sol87 1987 only - Dec 20 11:57:20s 0:02:40 - +Rule sol87 1987 only - Dec 21 11:57:50s 0:02:10 - +Rule sol87 1987 only - Dec 22 11:58:20s 0:01:40 - +Rule sol87 1987 only - Dec 23 11:58:50s 0:01:10 - +Rule sol87 1987 only - Dec 24 11:59:20s 0:00:40 - +Rule sol87 1987 only - Dec 25 11:59:50s 0:00:10 - +Rule sol87 1987 only - Dec 26 12:00:20s -0:00:20 - +Rule sol87 1987 only - Dec 27 12:00:45s -0:00:45 - +Rule sol87 1987 only - Dec 28 12:01:15s -0:01:15 - +Rule sol87 1987 only - Dec 29 12:01:45s -0:01:45 - +Rule sol87 1987 only - Dec 30 12:02:15s -0:02:15 - +Rule sol87 1987 only - Dec 31 12:02:45s -0:02:45 - + +# Riyadh is at about 46 degrees 46 minutes East: 3 hrs, 7 mins, 4 secs +# Before and after 1987, we'll operate on local mean solar time. + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +Zone Mideast/Riyadh87 3:07:04 - ?? 1987 + 3:07:04 sol87 ?? 1988 + 3:07:04 - ?? diff --git a/time/solar88 b/time/solar88 new file mode 100644 index 0000000000..0384b17a07 --- /dev/null +++ b/time/solar88 @@ -0,0 +1,386 @@ +# @(#)solar88 7.2 + +# Apparent noon times below are for Riyadh; they're a bit off for other places. +# Times were computed using formulas in the U.S. Naval Observatory's +# Almanac for Computers 1988; the formulas "will give EqT to an accuracy of +# [plus or minus two] seconds during the current year." +# +# Rounding to the nearest five seconds results in fewer than +# 256 different "time types"--a limit that's faced because time types are +# stored on disk as unsigned chars. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule sol88 1988 only - Jan 1 12:03:15s -0:03:15 - +Rule sol88 1988 only - Jan 2 12:03:40s -0:03:40 - +Rule sol88 1988 only - Jan 3 12:04:10s -0:04:10 - +Rule sol88 1988 only - Jan 4 12:04:40s -0:04:40 - +Rule sol88 1988 only - Jan 5 12:05:05s -0:05:05 - +Rule sol88 1988 only - Jan 6 12:05:30s -0:05:30 - +Rule sol88 1988 only - Jan 7 12:06:00s -0:06:00 - +Rule sol88 1988 only - Jan 8 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jan 9 12:06:50s -0:06:50 - +Rule sol88 1988 only - Jan 10 12:07:15s -0:07:15 - +Rule sol88 1988 only - Jan 11 12:07:40s -0:07:40 - +Rule sol88 1988 only - Jan 12 12:08:05s -0:08:05 - +Rule sol88 1988 only - Jan 13 12:08:25s -0:08:25 - +Rule sol88 1988 only - Jan 14 12:08:50s -0:08:50 - +Rule sol88 1988 only - Jan 15 12:09:10s -0:09:10 - +Rule sol88 1988 only - Jan 16 12:09:30s -0:09:30 - +Rule sol88 1988 only - Jan 17 12:09:50s -0:09:50 - +Rule sol88 1988 only - Jan 18 12:10:10s -0:10:10 - +Rule sol88 1988 only - Jan 19 12:10:30s -0:10:30 - +Rule sol88 1988 only - Jan 20 12:10:50s -0:10:50 - +Rule sol88 1988 only - Jan 21 12:11:05s -0:11:05 - +Rule sol88 1988 only - Jan 22 12:11:25s -0:11:25 - +Rule sol88 1988 only - Jan 23 12:11:40s -0:11:40 - +Rule sol88 1988 only - Jan 24 12:11:55s -0:11:55 - +Rule sol88 1988 only - Jan 25 12:12:10s -0:12:10 - +Rule sol88 1988 only - Jan 26 12:12:25s -0:12:25 - +Rule sol88 1988 only - Jan 27 12:12:40s -0:12:40 - +Rule sol88 1988 only - Jan 28 12:12:50s -0:12:50 - +Rule sol88 1988 only - Jan 29 12:13:00s -0:13:00 - +Rule sol88 1988 only - Jan 30 12:13:10s -0:13:10 - +Rule sol88 1988 only - Jan 31 12:13:20s -0:13:20 - +Rule sol88 1988 only - Feb 1 12:13:30s -0:13:30 - +Rule sol88 1988 only - Feb 2 12:13:40s -0:13:40 - +Rule sol88 1988 only - Feb 3 12:13:45s -0:13:45 - +Rule sol88 1988 only - Feb 4 12:13:55s -0:13:55 - +Rule sol88 1988 only - Feb 5 12:14:00s -0:14:00 - +Rule sol88 1988 only - Feb 6 12:14:05s -0:14:05 - +Rule sol88 1988 only - Feb 7 12:14:10s -0:14:10 - +Rule sol88 1988 only - Feb 8 12:14:10s -0:14:10 - +Rule sol88 1988 only - Feb 9 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 10 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 11 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 12 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 13 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 14 12:14:15s -0:14:15 - +Rule sol88 1988 only - Feb 15 12:14:10s -0:14:10 - +Rule sol88 1988 only - Feb 16 12:14:10s -0:14:10 - +Rule sol88 1988 only - Feb 17 12:14:05s -0:14:05 - +Rule sol88 1988 only - Feb 18 12:14:00s -0:14:00 - +Rule sol88 1988 only - Feb 19 12:13:55s -0:13:55 - +Rule sol88 1988 only - Feb 20 12:13:50s -0:13:50 - +Rule sol88 1988 only - Feb 21 12:13:45s -0:13:45 - +Rule sol88 1988 only - Feb 22 12:13:40s -0:13:40 - +Rule sol88 1988 only - Feb 23 12:13:30s -0:13:30 - +Rule sol88 1988 only - Feb 24 12:13:20s -0:13:20 - +Rule sol88 1988 only - Feb 25 12:13:15s -0:13:15 - +Rule sol88 1988 only - Feb 26 12:13:05s -0:13:05 - +Rule sol88 1988 only - Feb 27 12:12:55s -0:12:55 - +Rule sol88 1988 only - Feb 28 12:12:45s -0:12:45 - +Rule sol88 1988 only - Feb 29 12:12:30s -0:12:30 - +Rule sol88 1988 only - Mar 1 12:12:20s -0:12:20 - +Rule sol88 1988 only - Mar 2 12:12:10s -0:12:10 - +Rule sol88 1988 only - Mar 3 12:11:55s -0:11:55 - +Rule sol88 1988 only - Mar 4 12:11:45s -0:11:45 - +Rule sol88 1988 only - Mar 5 12:11:30s -0:11:30 - +Rule sol88 1988 only - Mar 6 12:11:15s -0:11:15 - +Rule sol88 1988 only - Mar 7 12:11:00s -0:11:00 - +Rule sol88 1988 only - Mar 8 12:10:45s -0:10:45 - +Rule sol88 1988 only - Mar 9 12:10:30s -0:10:30 - +Rule sol88 1988 only - Mar 10 12:10:15s -0:10:15 - +Rule sol88 1988 only - Mar 11 12:10:00s -0:10:00 - +Rule sol88 1988 only - Mar 12 12:09:45s -0:09:45 - +Rule sol88 1988 only - Mar 13 12:09:30s -0:09:30 - +Rule sol88 1988 only - Mar 14 12:09:10s -0:09:10 - +Rule sol88 1988 only - Mar 15 12:08:55s -0:08:55 - +Rule sol88 1988 only - Mar 16 12:08:40s -0:08:40 - +Rule sol88 1988 only - Mar 17 12:08:20s -0:08:20 - +Rule sol88 1988 only - Mar 18 12:08:05s -0:08:05 - +Rule sol88 1988 only - Mar 19 12:07:45s -0:07:45 - +Rule sol88 1988 only - Mar 20 12:07:30s -0:07:30 - +Rule sol88 1988 only - Mar 21 12:07:10s -0:07:10 - +Rule sol88 1988 only - Mar 22 12:06:50s -0:06:50 - +Rule sol88 1988 only - Mar 23 12:06:35s -0:06:35 - +Rule sol88 1988 only - Mar 24 12:06:15s -0:06:15 - +Rule sol88 1988 only - Mar 25 12:06:00s -0:06:00 - +Rule sol88 1988 only - Mar 26 12:05:40s -0:05:40 - +Rule sol88 1988 only - Mar 27 12:05:20s -0:05:20 - +Rule sol88 1988 only - Mar 28 12:05:05s -0:05:05 - +Rule sol88 1988 only - Mar 29 12:04:45s -0:04:45 - +Rule sol88 1988 only - Mar 30 12:04:25s -0:04:25 - +Rule sol88 1988 only - Mar 31 12:04:10s -0:04:10 - +Rule sol88 1988 only - Apr 1 12:03:50s -0:03:50 - +Rule sol88 1988 only - Apr 2 12:03:35s -0:03:35 - +Rule sol88 1988 only - Apr 3 12:03:15s -0:03:15 - +Rule sol88 1988 only - Apr 4 12:03:00s -0:03:00 - +Rule sol88 1988 only - Apr 5 12:02:40s -0:02:40 - +Rule sol88 1988 only - Apr 6 12:02:25s -0:02:25 - +Rule sol88 1988 only - Apr 7 12:02:05s -0:02:05 - +Rule sol88 1988 only - Apr 8 12:01:50s -0:01:50 - +Rule sol88 1988 only - Apr 9 12:01:35s -0:01:35 - +Rule sol88 1988 only - Apr 10 12:01:15s -0:01:15 - +Rule sol88 1988 only - Apr 11 12:01:00s -0:01:00 - +Rule sol88 1988 only - Apr 12 12:00:45s -0:00:45 - +Rule sol88 1988 only - Apr 13 12:00:30s -0:00:30 - +Rule sol88 1988 only - Apr 14 12:00:15s -0:00:15 - +Rule sol88 1988 only - Apr 15 12:00:00s 0:00:00 - +Rule sol88 1988 only - Apr 16 11:59:45s 0:00:15 - +Rule sol88 1988 only - Apr 17 11:59:30s 0:00:30 - +Rule sol88 1988 only - Apr 18 11:59:20s 0:00:40 - +Rule sol88 1988 only - Apr 19 11:59:05s 0:00:55 - +Rule sol88 1988 only - Apr 20 11:58:55s 0:01:05 - +Rule sol88 1988 only - Apr 21 11:58:40s 0:01:20 - +Rule sol88 1988 only - Apr 22 11:58:30s 0:01:30 - +Rule sol88 1988 only - Apr 23 11:58:15s 0:01:45 - +Rule sol88 1988 only - Apr 24 11:58:05s 0:01:55 - +Rule sol88 1988 only - Apr 25 11:57:55s 0:02:05 - +Rule sol88 1988 only - Apr 26 11:57:45s 0:02:15 - +Rule sol88 1988 only - Apr 27 11:57:35s 0:02:25 - +Rule sol88 1988 only - Apr 28 11:57:30s 0:02:30 - +Rule sol88 1988 only - Apr 29 11:57:20s 0:02:40 - +Rule sol88 1988 only - Apr 30 11:57:10s 0:02:50 - +Rule sol88 1988 only - May 1 11:57:05s 0:02:55 - +Rule sol88 1988 only - May 2 11:56:55s 0:03:05 - +Rule sol88 1988 only - May 3 11:56:50s 0:03:10 - +Rule sol88 1988 only - May 4 11:56:45s 0:03:15 - +Rule sol88 1988 only - May 5 11:56:40s 0:03:20 - +Rule sol88 1988 only - May 6 11:56:35s 0:03:25 - +Rule sol88 1988 only - May 7 11:56:30s 0:03:30 - +Rule sol88 1988 only - May 8 11:56:25s 0:03:35 - +Rule sol88 1988 only - May 9 11:56:25s 0:03:35 - +Rule sol88 1988 only - May 10 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 11 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 12 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 13 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 14 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 15 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 16 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 17 11:56:20s 0:03:40 - +Rule sol88 1988 only - May 18 11:56:25s 0:03:35 - +Rule sol88 1988 only - May 19 11:56:25s 0:03:35 - +Rule sol88 1988 only - May 20 11:56:30s 0:03:30 - +Rule sol88 1988 only - May 21 11:56:35s 0:03:25 - +Rule sol88 1988 only - May 22 11:56:40s 0:03:20 - +Rule sol88 1988 only - May 23 11:56:45s 0:03:15 - +Rule sol88 1988 only - May 24 11:56:50s 0:03:10 - +Rule sol88 1988 only - May 25 11:56:55s 0:03:05 - +Rule sol88 1988 only - May 26 11:57:00s 0:03:00 - +Rule sol88 1988 only - May 27 11:57:05s 0:02:55 - +Rule sol88 1988 only - May 28 11:57:15s 0:02:45 - +Rule sol88 1988 only - May 29 11:57:20s 0:02:40 - +Rule sol88 1988 only - May 30 11:57:30s 0:02:30 - +Rule sol88 1988 only - May 31 11:57:40s 0:02:20 - +Rule sol88 1988 only - Jun 1 11:57:50s 0:02:10 - +Rule sol88 1988 only - Jun 2 11:57:55s 0:02:05 - +Rule sol88 1988 only - Jun 3 11:58:05s 0:01:55 - +Rule sol88 1988 only - Jun 4 11:58:15s 0:01:45 - +Rule sol88 1988 only - Jun 5 11:58:30s 0:01:30 - +Rule sol88 1988 only - Jun 6 11:58:40s 0:01:20 - +Rule sol88 1988 only - Jun 7 11:58:50s 0:01:10 - +Rule sol88 1988 only - Jun 8 11:59:00s 0:01:00 - +Rule sol88 1988 only - Jun 9 11:59:15s 0:00:45 - +Rule sol88 1988 only - Jun 10 11:59:25s 0:00:35 - +Rule sol88 1988 only - Jun 11 11:59:35s 0:00:25 - +Rule sol88 1988 only - Jun 12 11:59:50s 0:00:10 - +Rule sol88 1988 only - Jun 13 12:00:00s 0:00:00 - +Rule sol88 1988 only - Jun 14 12:00:15s -0:00:15 - +Rule sol88 1988 only - Jun 15 12:00:25s -0:00:25 - +Rule sol88 1988 only - Jun 16 12:00:40s -0:00:40 - +Rule sol88 1988 only - Jun 17 12:00:55s -0:00:55 - +Rule sol88 1988 only - Jun 18 12:01:05s -0:01:05 - +Rule sol88 1988 only - Jun 19 12:01:20s -0:01:20 - +Rule sol88 1988 only - Jun 20 12:01:30s -0:01:30 - +Rule sol88 1988 only - Jun 21 12:01:45s -0:01:45 - +Rule sol88 1988 only - Jun 22 12:02:00s -0:02:00 - +Rule sol88 1988 only - Jun 23 12:02:10s -0:02:10 - +Rule sol88 1988 only - Jun 24 12:02:25s -0:02:25 - +Rule sol88 1988 only - Jun 25 12:02:35s -0:02:35 - +Rule sol88 1988 only - Jun 26 12:02:50s -0:02:50 - +Rule sol88 1988 only - Jun 27 12:03:00s -0:03:00 - +Rule sol88 1988 only - Jun 28 12:03:15s -0:03:15 - +Rule sol88 1988 only - Jun 29 12:03:25s -0:03:25 - +Rule sol88 1988 only - Jun 30 12:03:40s -0:03:40 - +Rule sol88 1988 only - Jul 1 12:03:50s -0:03:50 - +Rule sol88 1988 only - Jul 2 12:04:00s -0:04:00 - +Rule sol88 1988 only - Jul 3 12:04:10s -0:04:10 - +Rule sol88 1988 only - Jul 4 12:04:25s -0:04:25 - +Rule sol88 1988 only - Jul 5 12:04:35s -0:04:35 - +Rule sol88 1988 only - Jul 6 12:04:45s -0:04:45 - +Rule sol88 1988 only - Jul 7 12:04:55s -0:04:55 - +Rule sol88 1988 only - Jul 8 12:05:05s -0:05:05 - +Rule sol88 1988 only - Jul 9 12:05:10s -0:05:10 - +Rule sol88 1988 only - Jul 10 12:05:20s -0:05:20 - +Rule sol88 1988 only - Jul 11 12:05:30s -0:05:30 - +Rule sol88 1988 only - Jul 12 12:05:35s -0:05:35 - +Rule sol88 1988 only - Jul 13 12:05:45s -0:05:45 - +Rule sol88 1988 only - Jul 14 12:05:50s -0:05:50 - +Rule sol88 1988 only - Jul 15 12:05:55s -0:05:55 - +Rule sol88 1988 only - Jul 16 12:06:00s -0:06:00 - +Rule sol88 1988 only - Jul 17 12:06:05s -0:06:05 - +Rule sol88 1988 only - Jul 18 12:06:10s -0:06:10 - +Rule sol88 1988 only - Jul 19 12:06:15s -0:06:15 - +Rule sol88 1988 only - Jul 20 12:06:20s -0:06:20 - +Rule sol88 1988 only - Jul 21 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jul 22 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jul 23 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jul 24 12:06:30s -0:06:30 - +Rule sol88 1988 only - Jul 25 12:06:30s -0:06:30 - +Rule sol88 1988 only - Jul 26 12:06:30s -0:06:30 - +Rule sol88 1988 only - Jul 27 12:06:30s -0:06:30 - +Rule sol88 1988 only - Jul 28 12:06:30s -0:06:30 - +Rule sol88 1988 only - Jul 29 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jul 30 12:06:25s -0:06:25 - +Rule sol88 1988 only - Jul 31 12:06:20s -0:06:20 - +Rule sol88 1988 only - Aug 1 12:06:15s -0:06:15 - +Rule sol88 1988 only - Aug 2 12:06:15s -0:06:15 - +Rule sol88 1988 only - Aug 3 12:06:10s -0:06:10 - +Rule sol88 1988 only - Aug 4 12:06:05s -0:06:05 - +Rule sol88 1988 only - Aug 5 12:05:55s -0:05:55 - +Rule sol88 1988 only - Aug 6 12:05:50s -0:05:50 - +Rule sol88 1988 only - Aug 7 12:05:45s -0:05:45 - +Rule sol88 1988 only - Aug 8 12:05:35s -0:05:35 - +Rule sol88 1988 only - Aug 9 12:05:25s -0:05:25 - +Rule sol88 1988 only - Aug 10 12:05:20s -0:05:20 - +Rule sol88 1988 only - Aug 11 12:05:10s -0:05:10 - +Rule sol88 1988 only - Aug 12 12:05:00s -0:05:00 - +Rule sol88 1988 only - Aug 13 12:04:50s -0:04:50 - +Rule sol88 1988 only - Aug 14 12:04:35s -0:04:35 - +Rule sol88 1988 only - Aug 15 12:04:25s -0:04:25 - +Rule sol88 1988 only - Aug 16 12:04:15s -0:04:15 - +Rule sol88 1988 only - Aug 17 12:04:00s -0:04:00 - +Rule sol88 1988 only - Aug 18 12:03:50s -0:03:50 - +Rule sol88 1988 only - Aug 19 12:03:35s -0:03:35 - +Rule sol88 1988 only - Aug 20 12:03:20s -0:03:20 - +Rule sol88 1988 only - Aug 21 12:03:05s -0:03:05 - +Rule sol88 1988 only - Aug 22 12:02:50s -0:02:50 - +Rule sol88 1988 only - Aug 23 12:02:35s -0:02:35 - +Rule sol88 1988 only - Aug 24 12:02:20s -0:02:20 - +Rule sol88 1988 only - Aug 25 12:02:00s -0:02:00 - +Rule sol88 1988 only - Aug 26 12:01:45s -0:01:45 - +Rule sol88 1988 only - Aug 27 12:01:30s -0:01:30 - +Rule sol88 1988 only - Aug 28 12:01:10s -0:01:10 - +Rule sol88 1988 only - Aug 29 12:00:50s -0:00:50 - +Rule sol88 1988 only - Aug 30 12:00:35s -0:00:35 - +Rule sol88 1988 only - Aug 31 12:00:15s -0:00:15 - +Rule sol88 1988 only - Sep 1 11:59:55s 0:00:05 - +Rule sol88 1988 only - Sep 2 11:59:35s 0:00:25 - +Rule sol88 1988 only - Sep 3 11:59:20s 0:00:40 - +Rule sol88 1988 only - Sep 4 11:59:00s 0:01:00 - +Rule sol88 1988 only - Sep 5 11:58:40s 0:01:20 - +Rule sol88 1988 only - Sep 6 11:58:20s 0:01:40 - +Rule sol88 1988 only - Sep 7 11:58:00s 0:02:00 - +Rule sol88 1988 only - Sep 8 11:57:35s 0:02:25 - +Rule sol88 1988 only - Sep 9 11:57:15s 0:02:45 - +Rule sol88 1988 only - Sep 10 11:56:55s 0:03:05 - +Rule sol88 1988 only - Sep 11 11:56:35s 0:03:25 - +Rule sol88 1988 only - Sep 12 11:56:15s 0:03:45 - +Rule sol88 1988 only - Sep 13 11:55:50s 0:04:10 - +Rule sol88 1988 only - Sep 14 11:55:30s 0:04:30 - +Rule sol88 1988 only - Sep 15 11:55:10s 0:04:50 - +Rule sol88 1988 only - Sep 16 11:54:50s 0:05:10 - +Rule sol88 1988 only - Sep 17 11:54:25s 0:05:35 - +Rule sol88 1988 only - Sep 18 11:54:05s 0:05:55 - +Rule sol88 1988 only - Sep 19 11:53:45s 0:06:15 - +Rule sol88 1988 only - Sep 20 11:53:25s 0:06:35 - +Rule sol88 1988 only - Sep 21 11:53:00s 0:07:00 - +Rule sol88 1988 only - Sep 22 11:52:40s 0:07:20 - +Rule sol88 1988 only - Sep 23 11:52:20s 0:07:40 - +Rule sol88 1988 only - Sep 24 11:52:00s 0:08:00 - +Rule sol88 1988 only - Sep 25 11:51:40s 0:08:20 - +Rule sol88 1988 only - Sep 26 11:51:15s 0:08:45 - +Rule sol88 1988 only - Sep 27 11:50:55s 0:09:05 - +Rule sol88 1988 only - Sep 28 11:50:35s 0:09:25 - +Rule sol88 1988 only - Sep 29 11:50:15s 0:09:45 - +Rule sol88 1988 only - Sep 30 11:49:55s 0:10:05 - +Rule sol88 1988 only - Oct 1 11:49:35s 0:10:25 - +Rule sol88 1988 only - Oct 2 11:49:20s 0:10:40 - +Rule sol88 1988 only - Oct 3 11:49:00s 0:11:00 - +Rule sol88 1988 only - Oct 4 11:48:40s 0:11:20 - +Rule sol88 1988 only - Oct 5 11:48:25s 0:11:35 - +Rule sol88 1988 only - Oct 6 11:48:05s 0:11:55 - +Rule sol88 1988 only - Oct 7 11:47:50s 0:12:10 - +Rule sol88 1988 only - Oct 8 11:47:30s 0:12:30 - +Rule sol88 1988 only - Oct 9 11:47:15s 0:12:45 - +Rule sol88 1988 only - Oct 10 11:47:00s 0:13:00 - +Rule sol88 1988 only - Oct 11 11:46:45s 0:13:15 - +Rule sol88 1988 only - Oct 12 11:46:30s 0:13:30 - +Rule sol88 1988 only - Oct 13 11:46:15s 0:13:45 - +Rule sol88 1988 only - Oct 14 11:46:00s 0:14:00 - +Rule sol88 1988 only - Oct 15 11:45:45s 0:14:15 - +Rule sol88 1988 only - Oct 16 11:45:35s 0:14:25 - +Rule sol88 1988 only - Oct 17 11:45:20s 0:14:40 - +Rule sol88 1988 only - Oct 18 11:45:10s 0:14:50 - +Rule sol88 1988 only - Oct 19 11:45:00s 0:15:00 - +Rule sol88 1988 only - Oct 20 11:44:45s 0:15:15 - +Rule sol88 1988 only - Oct 21 11:44:40s 0:15:20 - +Rule sol88 1988 only - Oct 22 11:44:30s 0:15:30 - +Rule sol88 1988 only - Oct 23 11:44:20s 0:15:40 - +Rule sol88 1988 only - Oct 24 11:44:10s 0:15:50 - +Rule sol88 1988 only - Oct 25 11:44:05s 0:15:55 - +Rule sol88 1988 only - Oct 26 11:44:00s 0:16:00 - +Rule sol88 1988 only - Oct 27 11:43:55s 0:16:05 - +Rule sol88 1988 only - Oct 28 11:43:50s 0:16:10 - +Rule sol88 1988 only - Oct 29 11:43:45s 0:16:15 - +Rule sol88 1988 only - Oct 30 11:43:40s 0:16:20 - +Rule sol88 1988 only - Oct 31 11:43:40s 0:16:20 - +Rule sol88 1988 only - Nov 1 11:43:35s 0:16:25 - +Rule sol88 1988 only - Nov 2 11:43:35s 0:16:25 - +Rule sol88 1988 only - Nov 3 11:43:35s 0:16:25 - +Rule sol88 1988 only - Nov 4 11:43:35s 0:16:25 - +Rule sol88 1988 only - Nov 5 11:43:40s 0:16:20 - +Rule sol88 1988 only - Nov 6 11:43:40s 0:16:20 - +Rule sol88 1988 only - Nov 7 11:43:45s 0:16:15 - +Rule sol88 1988 only - Nov 8 11:43:45s 0:16:15 - +Rule sol88 1988 only - Nov 9 11:43:50s 0:16:10 - +Rule sol88 1988 only - Nov 10 11:44:00s 0:16:00 - +Rule sol88 1988 only - Nov 11 11:44:05s 0:15:55 - +Rule sol88 1988 only - Nov 12 11:44:10s 0:15:50 - +Rule sol88 1988 only - Nov 13 11:44:20s 0:15:40 - +Rule sol88 1988 only - Nov 14 11:44:30s 0:15:30 - +Rule sol88 1988 only - Nov 15 11:44:40s 0:15:20 - +Rule sol88 1988 only - Nov 16 11:44:50s 0:15:10 - +Rule sol88 1988 only - Nov 17 11:45:00s 0:15:00 - +Rule sol88 1988 only - Nov 18 11:45:15s 0:14:45 - +Rule sol88 1988 only - Nov 19 11:45:25s 0:14:35 - +Rule sol88 1988 only - Nov 20 11:45:40s 0:14:20 - +Rule sol88 1988 only - Nov 21 11:45:55s 0:14:05 - +Rule sol88 1988 only - Nov 22 11:46:10s 0:13:50 - +Rule sol88 1988 only - Nov 23 11:46:30s 0:13:30 - +Rule sol88 1988 only - Nov 24 11:46:45s 0:13:15 - +Rule sol88 1988 only - Nov 25 11:47:05s 0:12:55 - +Rule sol88 1988 only - Nov 26 11:47:20s 0:12:40 - +Rule sol88 1988 only - Nov 27 11:47:40s 0:12:20 - +Rule sol88 1988 only - Nov 28 11:48:00s 0:12:00 - +Rule sol88 1988 only - Nov 29 11:48:25s 0:11:35 - +Rule sol88 1988 only - Nov 30 11:48:45s 0:11:15 - +Rule sol88 1988 only - Dec 1 11:49:05s 0:10:55 - +Rule sol88 1988 only - Dec 2 11:49:30s 0:10:30 - +Rule sol88 1988 only - Dec 3 11:49:55s 0:10:05 - +Rule sol88 1988 only - Dec 4 11:50:15s 0:09:45 - +Rule sol88 1988 only - Dec 5 11:50:40s 0:09:20 - +Rule sol88 1988 only - Dec 6 11:51:05s 0:08:55 - +Rule sol88 1988 only - Dec 7 11:51:35s 0:08:25 - +Rule sol88 1988 only - Dec 8 11:52:00s 0:08:00 - +Rule sol88 1988 only - Dec 9 11:52:25s 0:07:35 - +Rule sol88 1988 only - Dec 10 11:52:55s 0:07:05 - +Rule sol88 1988 only - Dec 11 11:53:20s 0:06:40 - +Rule sol88 1988 only - Dec 12 11:53:50s 0:06:10 - +Rule sol88 1988 only - Dec 13 11:54:15s 0:05:45 - +Rule sol88 1988 only - Dec 14 11:54:45s 0:05:15 - +Rule sol88 1988 only - Dec 15 11:55:15s 0:04:45 - +Rule sol88 1988 only - Dec 16 11:55:45s 0:04:15 - +Rule sol88 1988 only - Dec 17 11:56:15s 0:03:45 - +Rule sol88 1988 only - Dec 18 11:56:40s 0:03:20 - +Rule sol88 1988 only - Dec 19 11:57:10s 0:02:50 - +Rule sol88 1988 only - Dec 20 11:57:40s 0:02:20 - +Rule sol88 1988 only - Dec 21 11:58:10s 0:01:50 - +Rule sol88 1988 only - Dec 22 11:58:40s 0:01:20 - +Rule sol88 1988 only - Dec 23 11:59:10s 0:00:50 - +Rule sol88 1988 only - Dec 24 11:59:40s 0:00:20 - +Rule sol88 1988 only - Dec 25 12:00:10s -0:00:10 - +Rule sol88 1988 only - Dec 26 12:00:40s -0:00:40 - +Rule sol88 1988 only - Dec 27 12:01:10s -0:01:10 - +Rule sol88 1988 only - Dec 28 12:01:40s -0:01:40 - +Rule sol88 1988 only - Dec 29 12:02:10s -0:02:10 - +Rule sol88 1988 only - Dec 30 12:02:35s -0:02:35 - +Rule sol88 1988 only - Dec 31 12:03:05s -0:03:05 - + +# Riyadh is at about 46 degrees 46 minutes East: 3 hrs, 7 mins, 4 secs +# Before and after 1988, we'll operate on local mean solar time. + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +Zone Mideast/Riyadh88 3:07:04 - ?? 1988 + 3:07:04 sol88 ?? 1989 + 3:07:04 - ?? diff --git a/time/solar89 b/time/solar89 new file mode 100644 index 0000000000..3221f976c3 --- /dev/null +++ b/time/solar89 @@ -0,0 +1,391 @@ +# @(#)solar89 7.2 + +# Apparent noon times below are for Riyadh; they're a bit off for other places. +# Times were computed using a formula provided by the U. S. Naval Observatory: +# eqt = -105.8 * sin(l) + 596.2 * sin(2 * l) + 4.4 * sin(3 * l) +# -12.7 * sin(4 * l) - 429.0 * cos(l) - 2.1 * cos (2 * l) +# + 19.3 * cos(3 * l); +# where l is the "mean longitude of the Sun" given by +# l = 279.642 degrees + 0.985647 * d +# and d is the interval in days from January 0, 0 hours Universal Time +# (equaling the day of the year plus the fraction of a day from zero hours). +# The accuracy of the formula is plus or minus three seconds. +# +# Rounding to the nearest five seconds results in fewer than +# 256 different "time types"--a limit that's faced because time types are +# stored on disk as unsigned chars. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule sol89 1989 only - Jan 1 12:03:35s -0:03:35 - +Rule sol89 1989 only - Jan 2 12:04:05s -0:04:05 - +Rule sol89 1989 only - Jan 3 12:04:30s -0:04:30 - +Rule sol89 1989 only - Jan 4 12:05:00s -0:05:00 - +Rule sol89 1989 only - Jan 5 12:05:25s -0:05:25 - +Rule sol89 1989 only - Jan 6 12:05:50s -0:05:50 - +Rule sol89 1989 only - Jan 7 12:06:15s -0:06:15 - +Rule sol89 1989 only - Jan 8 12:06:45s -0:06:45 - +Rule sol89 1989 only - Jan 9 12:07:10s -0:07:10 - +Rule sol89 1989 only - Jan 10 12:07:35s -0:07:35 - +Rule sol89 1989 only - Jan 11 12:07:55s -0:07:55 - +Rule sol89 1989 only - Jan 12 12:08:20s -0:08:20 - +Rule sol89 1989 only - Jan 13 12:08:45s -0:08:45 - +Rule sol89 1989 only - Jan 14 12:09:05s -0:09:05 - +Rule sol89 1989 only - Jan 15 12:09:25s -0:09:25 - +Rule sol89 1989 only - Jan 16 12:09:45s -0:09:45 - +Rule sol89 1989 only - Jan 17 12:10:05s -0:10:05 - +Rule sol89 1989 only - Jan 18 12:10:25s -0:10:25 - +Rule sol89 1989 only - Jan 19 12:10:45s -0:10:45 - +Rule sol89 1989 only - Jan 20 12:11:05s -0:11:05 - +Rule sol89 1989 only - Jan 21 12:11:20s -0:11:20 - +Rule sol89 1989 only - Jan 22 12:11:35s -0:11:35 - +Rule sol89 1989 only - Jan 23 12:11:55s -0:11:55 - +Rule sol89 1989 only - Jan 24 12:12:10s -0:12:10 - +Rule sol89 1989 only - Jan 25 12:12:20s -0:12:20 - +Rule sol89 1989 only - Jan 26 12:12:35s -0:12:35 - +Rule sol89 1989 only - Jan 27 12:12:50s -0:12:50 - +Rule sol89 1989 only - Jan 28 12:13:00s -0:13:00 - +Rule sol89 1989 only - Jan 29 12:13:10s -0:13:10 - +Rule sol89 1989 only - Jan 30 12:13:20s -0:13:20 - +Rule sol89 1989 only - Jan 31 12:13:30s -0:13:30 - +Rule sol89 1989 only - Feb 1 12:13:40s -0:13:40 - +Rule sol89 1989 only - Feb 2 12:13:45s -0:13:45 - +Rule sol89 1989 only - Feb 3 12:13:55s -0:13:55 - +Rule sol89 1989 only - Feb 4 12:14:00s -0:14:00 - +Rule sol89 1989 only - Feb 5 12:14:05s -0:14:05 - +Rule sol89 1989 only - Feb 6 12:14:10s -0:14:10 - +Rule sol89 1989 only - Feb 7 12:14:10s -0:14:10 - +Rule sol89 1989 only - Feb 8 12:14:15s -0:14:15 - +Rule sol89 1989 only - Feb 9 12:14:15s -0:14:15 - +Rule sol89 1989 only - Feb 10 12:14:20s -0:14:20 - +Rule sol89 1989 only - Feb 11 12:14:20s -0:14:20 - +Rule sol89 1989 only - Feb 12 12:14:20s -0:14:20 - +Rule sol89 1989 only - Feb 13 12:14:15s -0:14:15 - +Rule sol89 1989 only - Feb 14 12:14:15s -0:14:15 - +Rule sol89 1989 only - Feb 15 12:14:10s -0:14:10 - +Rule sol89 1989 only - Feb 16 12:14:10s -0:14:10 - +Rule sol89 1989 only - Feb 17 12:14:05s -0:14:05 - +Rule sol89 1989 only - Feb 18 12:14:00s -0:14:00 - +Rule sol89 1989 only - Feb 19 12:13:55s -0:13:55 - +Rule sol89 1989 only - Feb 20 12:13:50s -0:13:50 - +Rule sol89 1989 only - Feb 21 12:13:40s -0:13:40 - +Rule sol89 1989 only - Feb 22 12:13:35s -0:13:35 - +Rule sol89 1989 only - Feb 23 12:13:25s -0:13:25 - +Rule sol89 1989 only - Feb 24 12:13:15s -0:13:15 - +Rule sol89 1989 only - Feb 25 12:13:05s -0:13:05 - +Rule sol89 1989 only - Feb 26 12:12:55s -0:12:55 - +Rule sol89 1989 only - Feb 27 12:12:45s -0:12:45 - +Rule sol89 1989 only - Feb 28 12:12:35s -0:12:35 - +Rule sol89 1989 only - Mar 1 12:12:25s -0:12:25 - +Rule sol89 1989 only - Mar 2 12:12:10s -0:12:10 - +Rule sol89 1989 only - Mar 3 12:12:00s -0:12:00 - +Rule sol89 1989 only - Mar 4 12:11:45s -0:11:45 - +Rule sol89 1989 only - Mar 5 12:11:35s -0:11:35 - +Rule sol89 1989 only - Mar 6 12:11:20s -0:11:20 - +Rule sol89 1989 only - Mar 7 12:11:05s -0:11:05 - +Rule sol89 1989 only - Mar 8 12:10:50s -0:10:50 - +Rule sol89 1989 only - Mar 9 12:10:35s -0:10:35 - +Rule sol89 1989 only - Mar 10 12:10:20s -0:10:20 - +Rule sol89 1989 only - Mar 11 12:10:05s -0:10:05 - +Rule sol89 1989 only - Mar 12 12:09:50s -0:09:50 - +Rule sol89 1989 only - Mar 13 12:09:30s -0:09:30 - +Rule sol89 1989 only - Mar 14 12:09:15s -0:09:15 - +Rule sol89 1989 only - Mar 15 12:09:00s -0:09:00 - +Rule sol89 1989 only - Mar 16 12:08:40s -0:08:40 - +Rule sol89 1989 only - Mar 17 12:08:25s -0:08:25 - +Rule sol89 1989 only - Mar 18 12:08:05s -0:08:05 - +Rule sol89 1989 only - Mar 19 12:07:50s -0:07:50 - +Rule sol89 1989 only - Mar 20 12:07:30s -0:07:30 - +Rule sol89 1989 only - Mar 21 12:07:15s -0:07:15 - +Rule sol89 1989 only - Mar 22 12:06:55s -0:06:55 - +Rule sol89 1989 only - Mar 23 12:06:35s -0:06:35 - +Rule sol89 1989 only - Mar 24 12:06:20s -0:06:20 - +Rule sol89 1989 only - Mar 25 12:06:00s -0:06:00 - +Rule sol89 1989 only - Mar 26 12:05:40s -0:05:40 - +Rule sol89 1989 only - Mar 27 12:05:25s -0:05:25 - +Rule sol89 1989 only - Mar 28 12:05:05s -0:05:05 - +Rule sol89 1989 only - Mar 29 12:04:50s -0:04:50 - +Rule sol89 1989 only - Mar 30 12:04:30s -0:04:30 - +Rule sol89 1989 only - Mar 31 12:04:10s -0:04:10 - +Rule sol89 1989 only - Apr 1 12:03:55s -0:03:55 - +Rule sol89 1989 only - Apr 2 12:03:35s -0:03:35 - +Rule sol89 1989 only - Apr 3 12:03:20s -0:03:20 - +Rule sol89 1989 only - Apr 4 12:03:00s -0:03:00 - +Rule sol89 1989 only - Apr 5 12:02:45s -0:02:45 - +Rule sol89 1989 only - Apr 6 12:02:25s -0:02:25 - +Rule sol89 1989 only - Apr 7 12:02:10s -0:02:10 - +Rule sol89 1989 only - Apr 8 12:01:50s -0:01:50 - +Rule sol89 1989 only - Apr 9 12:01:35s -0:01:35 - +Rule sol89 1989 only - Apr 10 12:01:20s -0:01:20 - +Rule sol89 1989 only - Apr 11 12:01:05s -0:01:05 - +Rule sol89 1989 only - Apr 12 12:00:50s -0:00:50 - +Rule sol89 1989 only - Apr 13 12:00:35s -0:00:35 - +Rule sol89 1989 only - Apr 14 12:00:20s -0:00:20 - +Rule sol89 1989 only - Apr 15 12:00:05s -0:00:05 - +Rule sol89 1989 only - Apr 16 11:59:50s 0:00:10 - +Rule sol89 1989 only - Apr 17 11:59:35s 0:00:25 - +Rule sol89 1989 only - Apr 18 11:59:20s 0:00:40 - +Rule sol89 1989 only - Apr 19 11:59:10s 0:00:50 - +Rule sol89 1989 only - Apr 20 11:58:55s 0:01:05 - +Rule sol89 1989 only - Apr 21 11:58:45s 0:01:15 - +Rule sol89 1989 only - Apr 22 11:58:30s 0:01:30 - +Rule sol89 1989 only - Apr 23 11:58:20s 0:01:40 - +Rule sol89 1989 only - Apr 24 11:58:10s 0:01:50 - +Rule sol89 1989 only - Apr 25 11:58:00s 0:02:00 - +Rule sol89 1989 only - Apr 26 11:57:50s 0:02:10 - +Rule sol89 1989 only - Apr 27 11:57:40s 0:02:20 - +Rule sol89 1989 only - Apr 28 11:57:30s 0:02:30 - +Rule sol89 1989 only - Apr 29 11:57:20s 0:02:40 - +Rule sol89 1989 only - Apr 30 11:57:15s 0:02:45 - +Rule sol89 1989 only - May 1 11:57:05s 0:02:55 - +Rule sol89 1989 only - May 2 11:57:00s 0:03:00 - +Rule sol89 1989 only - May 3 11:56:50s 0:03:10 - +Rule sol89 1989 only - May 4 11:56:45s 0:03:15 - +Rule sol89 1989 only - May 5 11:56:40s 0:03:20 - +Rule sol89 1989 only - May 6 11:56:35s 0:03:25 - +Rule sol89 1989 only - May 7 11:56:30s 0:03:30 - +Rule sol89 1989 only - May 8 11:56:30s 0:03:30 - +Rule sol89 1989 only - May 9 11:56:25s 0:03:35 - +Rule sol89 1989 only - May 10 11:56:25s 0:03:35 - +Rule sol89 1989 only - May 11 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 12 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 13 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 14 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 15 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 16 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 17 11:56:20s 0:03:40 - +Rule sol89 1989 only - May 18 11:56:25s 0:03:35 - +Rule sol89 1989 only - May 19 11:56:25s 0:03:35 - +Rule sol89 1989 only - May 20 11:56:30s 0:03:30 - +Rule sol89 1989 only - May 21 11:56:35s 0:03:25 - +Rule sol89 1989 only - May 22 11:56:35s 0:03:25 - +Rule sol89 1989 only - May 23 11:56:40s 0:03:20 - +Rule sol89 1989 only - May 24 11:56:45s 0:03:15 - +Rule sol89 1989 only - May 25 11:56:55s 0:03:05 - +Rule sol89 1989 only - May 26 11:57:00s 0:03:00 - +Rule sol89 1989 only - May 27 11:57:05s 0:02:55 - +Rule sol89 1989 only - May 28 11:57:15s 0:02:45 - +Rule sol89 1989 only - May 29 11:57:20s 0:02:40 - +Rule sol89 1989 only - May 30 11:57:30s 0:02:30 - +Rule sol89 1989 only - May 31 11:57:35s 0:02:25 - +Rule sol89 1989 only - Jun 1 11:57:45s 0:02:15 - +Rule sol89 1989 only - Jun 2 11:57:55s 0:02:05 - +Rule sol89 1989 only - Jun 3 11:58:05s 0:01:55 - +Rule sol89 1989 only - Jun 4 11:58:15s 0:01:45 - +Rule sol89 1989 only - Jun 5 11:58:25s 0:01:35 - +Rule sol89 1989 only - Jun 6 11:58:35s 0:01:25 - +Rule sol89 1989 only - Jun 7 11:58:45s 0:01:15 - +Rule sol89 1989 only - Jun 8 11:59:00s 0:01:00 - +Rule sol89 1989 only - Jun 9 11:59:10s 0:00:50 - +Rule sol89 1989 only - Jun 10 11:59:20s 0:00:40 - +Rule sol89 1989 only - Jun 11 11:59:35s 0:00:25 - +Rule sol89 1989 only - Jun 12 11:59:45s 0:00:15 - +Rule sol89 1989 only - Jun 13 12:00:00s 0:00:00 - +Rule sol89 1989 only - Jun 14 12:00:10s -0:00:10 - +Rule sol89 1989 only - Jun 15 12:00:25s -0:00:25 - +Rule sol89 1989 only - Jun 16 12:00:35s -0:00:35 - +Rule sol89 1989 only - Jun 17 12:00:50s -0:00:50 - +Rule sol89 1989 only - Jun 18 12:01:05s -0:01:05 - +Rule sol89 1989 only - Jun 19 12:01:15s -0:01:15 - +Rule sol89 1989 only - Jun 20 12:01:30s -0:01:30 - +Rule sol89 1989 only - Jun 21 12:01:40s -0:01:40 - +Rule sol89 1989 only - Jun 22 12:01:55s -0:01:55 - +Rule sol89 1989 only - Jun 23 12:02:10s -0:02:10 - +Rule sol89 1989 only - Jun 24 12:02:20s -0:02:20 - +Rule sol89 1989 only - Jun 25 12:02:35s -0:02:35 - +Rule sol89 1989 only - Jun 26 12:02:45s -0:02:45 - +Rule sol89 1989 only - Jun 27 12:03:00s -0:03:00 - +Rule sol89 1989 only - Jun 28 12:03:10s -0:03:10 - +Rule sol89 1989 only - Jun 29 12:03:25s -0:03:25 - +Rule sol89 1989 only - Jun 30 12:03:35s -0:03:35 - +Rule sol89 1989 only - Jul 1 12:03:45s -0:03:45 - +Rule sol89 1989 only - Jul 2 12:04:00s -0:04:00 - +Rule sol89 1989 only - Jul 3 12:04:10s -0:04:10 - +Rule sol89 1989 only - Jul 4 12:04:20s -0:04:20 - +Rule sol89 1989 only - Jul 5 12:04:30s -0:04:30 - +Rule sol89 1989 only - Jul 6 12:04:40s -0:04:40 - +Rule sol89 1989 only - Jul 7 12:04:50s -0:04:50 - +Rule sol89 1989 only - Jul 8 12:05:00s -0:05:00 - +Rule sol89 1989 only - Jul 9 12:05:10s -0:05:10 - +Rule sol89 1989 only - Jul 10 12:05:20s -0:05:20 - +Rule sol89 1989 only - Jul 11 12:05:25s -0:05:25 - +Rule sol89 1989 only - Jul 12 12:05:35s -0:05:35 - +Rule sol89 1989 only - Jul 13 12:05:40s -0:05:40 - +Rule sol89 1989 only - Jul 14 12:05:50s -0:05:50 - +Rule sol89 1989 only - Jul 15 12:05:55s -0:05:55 - +Rule sol89 1989 only - Jul 16 12:06:00s -0:06:00 - +Rule sol89 1989 only - Jul 17 12:06:05s -0:06:05 - +Rule sol89 1989 only - Jul 18 12:06:10s -0:06:10 - +Rule sol89 1989 only - Jul 19 12:06:15s -0:06:15 - +Rule sol89 1989 only - Jul 20 12:06:20s -0:06:20 - +Rule sol89 1989 only - Jul 21 12:06:20s -0:06:20 - +Rule sol89 1989 only - Jul 22 12:06:25s -0:06:25 - +Rule sol89 1989 only - Jul 23 12:06:25s -0:06:25 - +Rule sol89 1989 only - Jul 24 12:06:30s -0:06:30 - +Rule sol89 1989 only - Jul 25 12:06:30s -0:06:30 - +Rule sol89 1989 only - Jul 26 12:06:30s -0:06:30 - +Rule sol89 1989 only - Jul 27 12:06:30s -0:06:30 - +Rule sol89 1989 only - Jul 28 12:06:30s -0:06:30 - +Rule sol89 1989 only - Jul 29 12:06:25s -0:06:25 - +Rule sol89 1989 only - Jul 30 12:06:25s -0:06:25 - +Rule sol89 1989 only - Jul 31 12:06:20s -0:06:20 - +Rule sol89 1989 only - Aug 1 12:06:20s -0:06:20 - +Rule sol89 1989 only - Aug 2 12:06:15s -0:06:15 - +Rule sol89 1989 only - Aug 3 12:06:10s -0:06:10 - +Rule sol89 1989 only - Aug 4 12:06:05s -0:06:05 - +Rule sol89 1989 only - Aug 5 12:06:00s -0:06:00 - +Rule sol89 1989 only - Aug 6 12:05:50s -0:05:50 - +Rule sol89 1989 only - Aug 7 12:05:45s -0:05:45 - +Rule sol89 1989 only - Aug 8 12:05:35s -0:05:35 - +Rule sol89 1989 only - Aug 9 12:05:30s -0:05:30 - +Rule sol89 1989 only - Aug 10 12:05:20s -0:05:20 - +Rule sol89 1989 only - Aug 11 12:05:10s -0:05:10 - +Rule sol89 1989 only - Aug 12 12:05:00s -0:05:00 - +Rule sol89 1989 only - Aug 13 12:04:50s -0:04:50 - +Rule sol89 1989 only - Aug 14 12:04:40s -0:04:40 - +Rule sol89 1989 only - Aug 15 12:04:30s -0:04:30 - +Rule sol89 1989 only - Aug 16 12:04:15s -0:04:15 - +Rule sol89 1989 only - Aug 17 12:04:05s -0:04:05 - +Rule sol89 1989 only - Aug 18 12:03:50s -0:03:50 - +Rule sol89 1989 only - Aug 19 12:03:35s -0:03:35 - +Rule sol89 1989 only - Aug 20 12:03:25s -0:03:25 - +Rule sol89 1989 only - Aug 21 12:03:10s -0:03:10 - +Rule sol89 1989 only - Aug 22 12:02:55s -0:02:55 - +Rule sol89 1989 only - Aug 23 12:02:40s -0:02:40 - +Rule sol89 1989 only - Aug 24 12:02:20s -0:02:20 - +Rule sol89 1989 only - Aug 25 12:02:05s -0:02:05 - +Rule sol89 1989 only - Aug 26 12:01:50s -0:01:50 - +Rule sol89 1989 only - Aug 27 12:01:30s -0:01:30 - +Rule sol89 1989 only - Aug 28 12:01:15s -0:01:15 - +Rule sol89 1989 only - Aug 29 12:00:55s -0:00:55 - +Rule sol89 1989 only - Aug 30 12:00:40s -0:00:40 - +Rule sol89 1989 only - Aug 31 12:00:20s -0:00:20 - +Rule sol89 1989 only - Sep 1 12:00:00s 0:00:00 - +Rule sol89 1989 only - Sep 2 11:59:45s 0:00:15 - +Rule sol89 1989 only - Sep 3 11:59:25s 0:00:35 - +Rule sol89 1989 only - Sep 4 11:59:05s 0:00:55 - +Rule sol89 1989 only - Sep 5 11:58:45s 0:01:15 - +Rule sol89 1989 only - Sep 6 11:58:25s 0:01:35 - +Rule sol89 1989 only - Sep 7 11:58:05s 0:01:55 - +Rule sol89 1989 only - Sep 8 11:57:45s 0:02:15 - +Rule sol89 1989 only - Sep 9 11:57:20s 0:02:40 - +Rule sol89 1989 only - Sep 10 11:57:00s 0:03:00 - +Rule sol89 1989 only - Sep 11 11:56:40s 0:03:20 - +Rule sol89 1989 only - Sep 12 11:56:20s 0:03:40 - +Rule sol89 1989 only - Sep 13 11:56:00s 0:04:00 - +Rule sol89 1989 only - Sep 14 11:55:35s 0:04:25 - +Rule sol89 1989 only - Sep 15 11:55:15s 0:04:45 - +Rule sol89 1989 only - Sep 16 11:54:55s 0:05:05 - +Rule sol89 1989 only - Sep 17 11:54:35s 0:05:25 - +Rule sol89 1989 only - Sep 18 11:54:10s 0:05:50 - +Rule sol89 1989 only - Sep 19 11:53:50s 0:06:10 - +Rule sol89 1989 only - Sep 20 11:53:30s 0:06:30 - +Rule sol89 1989 only - Sep 21 11:53:10s 0:06:50 - +Rule sol89 1989 only - Sep 22 11:52:45s 0:07:15 - +Rule sol89 1989 only - Sep 23 11:52:25s 0:07:35 - +Rule sol89 1989 only - Sep 24 11:52:05s 0:07:55 - +Rule sol89 1989 only - Sep 25 11:51:45s 0:08:15 - +Rule sol89 1989 only - Sep 26 11:51:25s 0:08:35 - +Rule sol89 1989 only - Sep 27 11:51:05s 0:08:55 - +Rule sol89 1989 only - Sep 28 11:50:40s 0:09:20 - +Rule sol89 1989 only - Sep 29 11:50:20s 0:09:40 - +Rule sol89 1989 only - Sep 30 11:50:00s 0:10:00 - +Rule sol89 1989 only - Oct 1 11:49:45s 0:10:15 - +Rule sol89 1989 only - Oct 2 11:49:25s 0:10:35 - +Rule sol89 1989 only - Oct 3 11:49:05s 0:10:55 - +Rule sol89 1989 only - Oct 4 11:48:45s 0:11:15 - +Rule sol89 1989 only - Oct 5 11:48:30s 0:11:30 - +Rule sol89 1989 only - Oct 6 11:48:10s 0:11:50 - +Rule sol89 1989 only - Oct 7 11:47:50s 0:12:10 - +Rule sol89 1989 only - Oct 8 11:47:35s 0:12:25 - +Rule sol89 1989 only - Oct 9 11:47:20s 0:12:40 - +Rule sol89 1989 only - Oct 10 11:47:00s 0:13:00 - +Rule sol89 1989 only - Oct 11 11:46:45s 0:13:15 - +Rule sol89 1989 only - Oct 12 11:46:30s 0:13:30 - +Rule sol89 1989 only - Oct 13 11:46:15s 0:13:45 - +Rule sol89 1989 only - Oct 14 11:46:00s 0:14:00 - +Rule sol89 1989 only - Oct 15 11:45:50s 0:14:10 - +Rule sol89 1989 only - Oct 16 11:45:35s 0:14:25 - +Rule sol89 1989 only - Oct 17 11:45:20s 0:14:40 - +Rule sol89 1989 only - Oct 18 11:45:10s 0:14:50 - +Rule sol89 1989 only - Oct 19 11:45:00s 0:15:00 - +Rule sol89 1989 only - Oct 20 11:44:50s 0:15:10 - +Rule sol89 1989 only - Oct 21 11:44:40s 0:15:20 - +Rule sol89 1989 only - Oct 22 11:44:30s 0:15:30 - +Rule sol89 1989 only - Oct 23 11:44:20s 0:15:40 - +Rule sol89 1989 only - Oct 24 11:44:10s 0:15:50 - +Rule sol89 1989 only - Oct 25 11:44:05s 0:15:55 - +Rule sol89 1989 only - Oct 26 11:44:00s 0:16:00 - +Rule sol89 1989 only - Oct 27 11:43:50s 0:16:10 - +Rule sol89 1989 only - Oct 28 11:43:45s 0:16:15 - +Rule sol89 1989 only - Oct 29 11:43:40s 0:16:20 - +Rule sol89 1989 only - Oct 30 11:43:40s 0:16:20 - +Rule sol89 1989 only - Oct 31 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 1 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 2 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 3 11:43:30s 0:16:30 - +Rule sol89 1989 only - Nov 4 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 5 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 6 11:43:35s 0:16:25 - +Rule sol89 1989 only - Nov 7 11:43:40s 0:16:20 - +Rule sol89 1989 only - Nov 8 11:43:45s 0:16:15 - +Rule sol89 1989 only - Nov 9 11:43:50s 0:16:10 - +Rule sol89 1989 only - Nov 10 11:43:55s 0:16:05 - +Rule sol89 1989 only - Nov 11 11:44:00s 0:16:00 - +Rule sol89 1989 only - Nov 12 11:44:05s 0:15:55 - +Rule sol89 1989 only - Nov 13 11:44:15s 0:15:45 - +Rule sol89 1989 only - Nov 14 11:44:25s 0:15:35 - +Rule sol89 1989 only - Nov 15 11:44:35s 0:15:25 - +Rule sol89 1989 only - Nov 16 11:44:45s 0:15:15 - +Rule sol89 1989 only - Nov 17 11:44:55s 0:15:05 - +Rule sol89 1989 only - Nov 18 11:45:10s 0:14:50 - +Rule sol89 1989 only - Nov 19 11:45:20s 0:14:40 - +Rule sol89 1989 only - Nov 20 11:45:35s 0:14:25 - +Rule sol89 1989 only - Nov 21 11:45:50s 0:14:10 - +Rule sol89 1989 only - Nov 22 11:46:05s 0:13:55 - +Rule sol89 1989 only - Nov 23 11:46:25s 0:13:35 - +Rule sol89 1989 only - Nov 24 11:46:40s 0:13:20 - +Rule sol89 1989 only - Nov 25 11:47:00s 0:13:00 - +Rule sol89 1989 only - Nov 26 11:47:20s 0:12:40 - +Rule sol89 1989 only - Nov 27 11:47:35s 0:12:25 - +Rule sol89 1989 only - Nov 28 11:47:55s 0:12:05 - +Rule sol89 1989 only - Nov 29 11:48:20s 0:11:40 - +Rule sol89 1989 only - Nov 30 11:48:40s 0:11:20 - +Rule sol89 1989 only - Dec 1 11:49:00s 0:11:00 - +Rule sol89 1989 only - Dec 2 11:49:25s 0:10:35 - +Rule sol89 1989 only - Dec 3 11:49:50s 0:10:10 - +Rule sol89 1989 only - Dec 4 11:50:15s 0:09:45 - +Rule sol89 1989 only - Dec 5 11:50:35s 0:09:25 - +Rule sol89 1989 only - Dec 6 11:51:00s 0:09:00 - +Rule sol89 1989 only - Dec 7 11:51:30s 0:08:30 - +Rule sol89 1989 only - Dec 8 11:51:55s 0:08:05 - +Rule sol89 1989 only - Dec 9 11:52:20s 0:07:40 - +Rule sol89 1989 only - Dec 10 11:52:50s 0:07:10 - +Rule sol89 1989 only - Dec 11 11:53:15s 0:06:45 - +Rule sol89 1989 only - Dec 12 11:53:45s 0:06:15 - +Rule sol89 1989 only - Dec 13 11:54:10s 0:05:50 - +Rule sol89 1989 only - Dec 14 11:54:40s 0:05:20 - +Rule sol89 1989 only - Dec 15 11:55:10s 0:04:50 - +Rule sol89 1989 only - Dec 16 11:55:40s 0:04:20 - +Rule sol89 1989 only - Dec 17 11:56:05s 0:03:55 - +Rule sol89 1989 only - Dec 18 11:56:35s 0:03:25 - +Rule sol89 1989 only - Dec 19 11:57:05s 0:02:55 - +Rule sol89 1989 only - Dec 20 11:57:35s 0:02:25 - +Rule sol89 1989 only - Dec 21 11:58:05s 0:01:55 - +Rule sol89 1989 only - Dec 22 11:58:35s 0:01:25 - +Rule sol89 1989 only - Dec 23 11:59:05s 0:00:55 - +Rule sol89 1989 only - Dec 24 11:59:35s 0:00:25 - +Rule sol89 1989 only - Dec 25 12:00:05s -0:00:05 - +Rule sol89 1989 only - Dec 26 12:00:35s -0:00:35 - +Rule sol89 1989 only - Dec 27 12:01:05s -0:01:05 - +Rule sol89 1989 only - Dec 28 12:01:35s -0:01:35 - +Rule sol89 1989 only - Dec 29 12:02:00s -0:02:00 - +Rule sol89 1989 only - Dec 30 12:02:30s -0:02:30 - +Rule sol89 1989 only - Dec 31 12:03:00s -0:03:00 - + +# Riyadh is at about 46 degrees 46 minutes East: 3 hrs, 7 mins, 4 secs +# Before and after 1989, we'll operate on local mean solar time. + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +Zone Mideast/Riyadh89 3:07:04 - ?? 1989 + 3:07:04 sol89 ?? 1990 + 3:07:04 - ?? diff --git a/time/southamerica b/time/southamerica new file mode 100644 index 0000000000..b40ce559a3 --- /dev/null +++ b/time/southamerica @@ -0,0 +1,397 @@ +# @(#)southamerica 7.6 + +# This data is by no means authoritative; if you think you know better, +# go ahead and edit the file (and please send any changes to +# tz@elsie.nci.nih.gov for general use in the future). + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# A good source for time zone historical data outside the U.S. is +# Thomas G. Shanks, The International Atlas (3rd edition), +# San Diego: ACS Publications, Inc. (1991). +# Except where otherwise noted, it is the source for the data below. +# +# I invented the abbreviations marked `*' in the following table; +# the rest are from earlier versions of this file, or from other sources. +# Some of these are just plausible excuses for common English abbreviations. +# Corrections are welcome! +# std dst +# LMT Local Mean Time +# -2:00 FST FDT Fernando de Noronha +# -3:00 EST EDT Eastern South America (conflicts with -5:00) +# -4:00 AST ADT Andes*, Antilles*, Asuncion*, Atlantic +# -4:00 CST CDT Chile (conflicts with -6:00) +# -4:00 WST WDT Western Brazil +# -5:00 AST ADT Acre (conflicts with -4:00) +# -5:00 EST EDT Eastern, Ecuador* +# -6:00 CST CDT Archipelago of Columbus*, Central +# -7:00 MST MDT Mataveri*, Mountain +# +# See the `africa' file for Zone naming conventions. + +# From Guy Harris: +# From Official Airline Guide - Worldwide Edition (1987). Countries not +# listed here do not observe DST, according to the OAG. Time zone names +# are pure inventions, and none are supplied for countries not observing +# DST; updates from natives would be appreciated. The times that DST +# starts and ends are based on the assumption that they switch a 2AM just +# as everybody else does. + +############################################################################### + +############################################################################### + +# Argentina + +# From Bob Devine (January 28, 1988): +# Argentina: first Sunday in October to first Sunday in April since 1976. +# Double Summer time from 1969 to 1974. Switches at midnight. + +# From U. S. Naval Observatory (January 19, 19889): +# ARGENTINA 3 H BEHIND UTC + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Arg 1930 only - Dec 1 0:00 1:00 D +Rule Arg 1931 only - Apr 1 0:00 0 S +Rule Arg 1931 only - Oct 15 0:00 1:00 D +Rule Arg 1932 1940 - Mar 1 0:00 0 S +Rule Arg 1932 1939 - Nov 1 0:00 1:00 D +Rule Arg 1940 only - Jul 1 0:00 1:00 D +Rule Arg 1941 only - Jun 15 0:00 0 S +Rule Arg 1941 only - Oct 15 0:00 1:00 D +Rule Arg 1943 only - Aug 1 0:00 0 S +Rule Arg 1943 only - Oct 15 0:00 1:00 D +Rule Arg 1946 only - Mar 1 0:00 0 S +Rule Arg 1946 only - Oct 1 0:00 1:00 D +Rule Arg 1963 only - Oct 1 0:00 0 S +Rule Arg 1963 only - Dec 15 0:00 1:00 D +Rule Arg 1964 1966 - Mar 1 0:00 0 S +Rule Arg 1964 1966 - Oct 15 0:00 1:00 D +Rule Arg 1967 only - Apr 1 0:00 0 S +Rule Arg 1967 1968 - Oct Sun<=7 0:00 1:00 D +Rule Arg 1968 1969 - Apr Sun<=7 0:00 0 S +Rule Arg 1974 only - Jan 23 0:00 1:00 D +Rule Arg 1974 only - May 1 0:00 0 S +Rule Arg 1974 1976 - Oct Sun<=7 0:00 1:00 D +Rule Arg 1975 1977 - Apr Sun<=7 0:00 0 S +Rule Arg 1985 only - Nov 2 0:00 1:00 D +Rule Arg 1986 only - Mar 14 0:00 0 S +Rule Arg 1986 1987 - Oct 25 0:00 1:00 D +Rule Arg 1987 only - Feb 13 0:00 0 S +Rule Arg 1988 only - Feb 7 0:00 0 S +Rule Arg 1988 only - Dec 1 0:00 1:00 D +Rule Arg 1989 only - Mar 16 0:00 0 S +Rule Arg 1989 only - Oct 15 0:00 1:00 D +Rule Arg 1990 only - Mar 4 0:00 0 S +# _The Economist_ (8 Jan 1994, p 42) reports that Argentina +# had DST in 1991-2 and 1992-3, but not in 1990-1 or in 1993-4. +# It has something to do with electricity companies meeting demand in summer. +# We don't know the 1991-3 transition times, unfortunately. +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Buenos_Aires -3:53:48 - LMT 1894 Nov + -4:17 - CMT 1920 May # Cordoba Mean Time + -4:00 - AST 1930 Dec + -4:00 Arg A%sT 1969 Oct 5 + -3:00 Arg E%sT + +# Bolivia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/La_Paz -4:32:36 - LMT 1890 + -4:33 - LPMT 1931 Oct 15 # La Paz Mean Time + -4:33 1:00 LPDT 1932 Mar 21 + -4:00 - AST + +# Brazil + +# From Guy Harris: +# The OAG lists October 25, 1987 and February 12, 1988 as the starting and +# ending dates, giving them as "estimated date(s) based on previous year". We +# infer a rule here from one example, always a dangerous practice.... Yes, +# they really do switch on Saturday, according to the OAG. +# "Brazil/Acre" is for the Territory of Acre; "Brazil/DeNoronha" is for +# Fernando De Noronha. + +# From Bob Devine (January 28, 1988): +# The only information I found is that there was no DST up to 1985. +# But there was some before 1952! + +# From U. S. Naval Observatory (January 16, 1989): +# BRAZIL WEST 5 H BEHIND UTC TERRITORY OF ACRE +# BRAZIL WEST 4 H BEHIND UTC ACRE OCT 23, '88-FEB 11, +# BRAZIL '89 (ESTIMATED) +# BRAZIL CENTRAL 4 H BEHIND UTC MANAUS +# BRAZIL CENTRAL 3 H BEHIND UTC MANAUS OCT 23, '88-FEB 11, +# BRAZIL CENTRAL '89 (ESTIMATED) +# BRAZIL EAST 3 H BEHIND UTC COASTAL STATES, RIO, SAO +# BRAZIL EAST PAULO, BRASILIA +# BRAZIL EAST 2 H BEHIND UTC COASTAL STATES, RIO, SAO +# BRAZIL PAULO, BRASILIA OCT 23, +# BRAZIL '88-FEB 11, '89 +# BRAZIL (ESTIMATED) +# BRAZIL 2 H BEHIND UTC ATLANTIC ISLANDS, FERNANDO +# BRAZIL DE NORONHA +# BRAZIL 1 H BEHIND UTC OCT 23, '88-FEB 11, '89 +# BRAZIL (ESTIMATED) +# BRAZIL 3 H BEHIND UTC FOR MOST MAJOR AIRPORTS. + +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# The mayor of Rio recently attempted to change the time zone rules +# just in his city, in order to leave more summer time for the tourist trade. +# The rule change lasted only part of the day; +# the federal government refused to follow the city's rules, and business +# was in a chaos, so the mayor backed down that afternoon. +# Shanks claims Acre stopped observing DST after 1988 Feb 7, but it +# could just be that his table ran out of room. We're extrapolating +# about time zone changes after 1990 Feb 11. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Brazil 1914 only - Jan 1 0:00 0 S +Rule Brazil 1931 only - Oct 3 11:00 1 D +Rule Brazil 1932 1933 - Apr 1 0:00 0 S +Rule Brazil 1932 only - Oct 3 0:00 1 D +Rule Brazil 1949 1952 - Dec 1 0:00 1 D +Rule Brazil 1950 only - Apr 16 0:00 0 S +Rule Brazil 1951 1953 - Apr 1 0:00 0 S +Rule Brazil 1963 only - Dec 9 0:00 1 D +Rule Brazil 1964 only - Mar 1 0:00 0 S +Rule Brazil 1965 only - Jan 31 0:00 1 D +Rule Brazil 1965 only - Apr 1 0:00 0 S +Rule Brazil 1965 only - Dec 1 0:00 1 D +Rule Brazil 1966 1968 - Mar 1 0:00 0 S +Rule Brazil 1966 1967 - Nov 1 0:00 1 D +Rule Brazil 1985 only - Nov 2 0:00 1 D +Rule Brazil 1986 only - Mar 15 0:00 0 S +Rule Brazil 1986 1987 - Oct Sat<=28 0:00 1 D +Rule Brazil 1987 only - Feb 14 0:00 0 S +Rule Brazil 1988 only - Feb 7 0:00 0 S +Rule Brazil 1989 only - Jan 22 0:00 0 S +Rule Brazil 1988 max - Oct Sun>=15 0:00 1 D +Rule Brazil 1990 max - Feb Sun>=8 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Noronha -2:09:40 - LMT 1914 + -2:00 - FST 1963 Dec 9 + -2:00 Brazil F%sT +Zone America/Sao_Paulo -3:06:28 - LMT 1914 + -3:00 Brazil E%sT +Zone America/Manaus -4:00:04 - LMT 1914 + -4:00 - WST 1963 Dec 9 + -4:00 Brazil W%sT +# Rio_Branco is too ambiguous, since there's a Rio Branco in Uruguay too. +Zone America/Porto_Acre -4:31:12 - LMT 1914 + -5:00 - AST 1963 Dec 9 + -5:00 Brazil A%sT +# +# Martin Vaz and Trinidade are like America/Noronha. + + +# Chile + +# From Guy Harris: +# The OAG lists October 11, 1987 and March 12, 1988 as the starting and +# ending dates, giving them as "estimated date(s) based on previous year." + +# From Bob Devine (January 28, 1988): +# Chile has had 2nd Sunday in October to 2nd Sunday in March DST since 1977. +# Switch is at midnight. OAG is right. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Chile 1918 only - Sep 1 0:00 1:00 D +Rule Chile 1919 only - Jul 2 0:00 0 S +Rule Chile 1927 1931 - Sep 1 0:00 1:00 D +Rule Chile 1928 1932 - Apr 1 0:00 0 S +Rule Chile 1969 max - Oct Sun>=8 0:00 1:00 D +Rule Chile 1970 max - Mar Sun>=8 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Santiago -4:42:40 - LMT 1890 + -4:43 - SMT 1910 # Santiago Mean Time + -5:00 Chile C%sT 1932 Sep + -4:00 Chile C%sT +Zone Pacific/Easter -7:17:28 - LMT 1890 # Mataveri + -7:17 - MMT 1932 Sep # Mataveri Mean Time + -7:00 Chile M%sT 1982 Mar 14 + -6:00 Chile C%sT +# +# Whitman says Juan Fernandez Is are like America/Santiago. +# San Ambrosio, San Felix +# no information; probably like America/Santiago + + +# Colombia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Bogota -4:56:20 - LMT 1884 Mar 13 + -4:56 - BMT 1914 Nov 23 # Bogota Mean Time + -5:00 - EST +# Malpelo, Providencia, San Andres +# no information; probably like America/Bogota + +# Curacao +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad + -4:30 - NAST 1965 # Netherlands Antilles + -4:00 - AST + +# Ecuador +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Guayaquil -5:19:20 - LMT 1890 + -5:14 - QMT 1931 # Quito Mean Time + -5:00 - EST +Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno + -5:00 - EST 1986 + -6:00 - CST + +# Falklands +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Falk 1912 only - Mar 12 0:00 0 S +Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 D +Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 S +Rule Falk 1939 only - Oct 1 0:00 1:00 D +Rule Falk 1940 1942 - Sep lastSun 0:00 1:00 D +Rule Falk 1943 only - Jan 1 0:00 0 S +Rule Falk 1983 only - Sep lastSun 0:00 1:00 D +Rule Falk 1984 1985 - Apr lastSun 0:00 0 S +Rule Falk 1984 only - Sep 16 0:00 1:00 D +Rule Falk 1985 max - Sep Sun>=9 0:00 1:00 D +Rule Falk 1986 max - Apr Sun>=16 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/Stanley -3:51:24 - LMT 1890 + -3:51 - SMT 1912 Mar 12 # Stanley Mean Time + -4:00 Falk A%sT 1983 May + -3:00 Falk E%sT 1985 Sep 15 + -4:00 Falk A%sT + +# French Guiana +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Cayenne -3:29:20 - LMT 1911 Jul + -4:00 - AST 1967 Oct + -3:00 - EST + +# Guyana +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Guyana -3:52:40 - LMT 1915 Mar # Georgetown + -3:45 - BGST 1975 Jul 31 # British Guiana ST + -3:00 - EST + + +# Paraguay + +# From Bob Devine (January 28, 1988): +# Paraguay: First day in October to last in March. Midnight switch?? +# Since 1980. + +# From U. S. Naval Observatory (January 19, 1989): +# PARAGUAY 4 H BEHIND UTC +# PARAGUAY 3 H BEHIND UTC OCT 1, '88-MAR 31, '89 + +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Para 1974 only - Apr 1 0:00 0 S +Rule Para 1975 1978 - Oct 1 0:00 1:00 D +Rule Para 1975 1978 - Mar 1 0:00 0 S +# Shanks says 1979 was all DST. +Rule Para 1980 max - Apr 1 0:00 0 S +Rule Para 1980 1988 - Oct 1 0:00 1:00 D +Rule Para 1989 only - Oct 22 0:00 1:00 D +Rule Para 1990 max - Oct 1 0:00 1:00 D +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Asuncion -3:50:40 - LMT 1890 + -3:51 - AMT 1931 Oct 10 # Asuncion Mean Time + -4:00 - AST 1972 Oct + -3:00 - EST 1974 Apr + -4:00 Para A%sT + +# Peru +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Peru 1908 only - Jul 28 0:00 0 S +Rule Peru 1938 only - Jan 1 0:00 1:00 D +Rule Peru 1938 only - Apr 1 0:00 0 S +Rule Peru 1938 1939 - Sep lastSun 0:00 1:00 D +Rule Peru 1939 1940 - Mar Sun>=24 0:00 0 S +Rule Peru 1987 only - Jan 1 0:00 1:00 D +Rule Peru 1987 only - Apr 1 0:00 0 S +Rule Peru 1990 only - Jan 1 0:00 1:00 D +Rule Peru 1990 only - Apr 1 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Lima -5:08:12 - LMT 1890 + -5:09 - LMT 1908 Jul 28 + -5:00 Peru E%sT + +# South Georgia +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Atlantic/South_Georgia -2:26:08 - LMT 1890 # Grytviken + -2:00 - FST + +# South Sandwich Is +# no information + +# Suriname +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Paramaribo -3:40:40 - LMT 1911 + -3:40:52 - PMT 1935 # Paramaribo Mean Time + -3:40:36 - PMT 1945 Oct # The capital moved? + -3:30 - DGST 1984 Oct # Dutch Guiana Std Time + -3:00 - EST + +# Trinidad and Tobago +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2 + -4:00 - AST + +# Uruguay +# From Paul Eggert <eggert@twinsun.com> (November 18, 1993): +# Uruguay wins the prize for the strangest peacetime manipulation of the rules. +# Your guess is as good as mine for what happened after 1989. +# From Shanks (1991): +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Uruguay 1920 only - May 1 0:00 0 S +# Whitman gives 1923 Oct 1; go with Shanks. +Rule Uruguay 1923 only - Oct 2 0:00 0:30 HD +Rule Uruguay 1924 1926 - Apr 1 0:00 0 S +Rule Uruguay 1924 1925 - Oct 1 0:00 0:30 HD +Rule Uruguay 1933 1935 - Oct lastSun 0:00 0:30 HD +# Shanks gives 1935 Apr 1 0:00 and 1936 Mar 30 0:00; go with Whitman. +Rule Uruguay 1934 1936 - Mar Sat>=25 23:30s 0 S +Rule Uruguay 1936 only - Nov 1 0:00 0:30 HD +Rule Uruguay 1937 1941 - Mar lastSun 0:00 0 S +# Whitman gives 1937 Oct 3; go with Shanks. +Rule Uruguay 1937 1940 - Oct lastSun 0:00 0:30 HD +# Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13, +# and 1943 Apr 13 ``to present time''; go with Shanks. +Rule Uruguay 1941 only - Aug 1 0:00 0 S +Rule Uruguay 1942 only - Jan 1 0:00 0:30 HD +Rule Uruguay 1942 only - Dec 14 0:00 1:00 D +Rule Uruguay 1943 only - Mar 14 0:00 0 S +Rule Uruguay 1959 only - May 24 0:00 1:00 D +Rule Uruguay 1959 only - Nov 15 0:00 0 S +Rule Uruguay 1960 only - Jan 17 0:00 1:00 D +Rule Uruguay 1960 only - Mar 6 0:00 0 S +Rule Uruguay 1965 1967 - Apr Sun>=1 0:00 1:00 D +Rule Uruguay 1965 only - Sep 26 0:00 0 S +Rule Uruguay 1966 1967 - Oct 31 0:00 0 S +Rule Uruguay 1968 1970 - May 27 0:00 0:30 HD +Rule Uruguay 1968 1970 - Dec 2 0:00 0 S +Rule Uruguay 1972 only - Apr 24 0:00 1:00 D +Rule Uruguay 1972 only - Aug 15 0:00 0 S +Rule Uruguay 1974 only - Mar 10 0:00 0:30 HD +Rule Uruguay 1974 only - Dec 22 0:00 1:00 D +Rule Uruguay 1976 only - Oct 1 0:00 0 S +Rule Uruguay 1977 only - Dec 4 0:00 1:00 D +Rule Uruguay 1978 only - Apr 1 0:00 0 S +Rule Uruguay 1979 only - Oct 1 0:00 1:00 D +Rule Uruguay 1980 only - May 1 0:00 0 S +Rule Uruguay 1987 only - Dec 14 0:00 1:00 D +Rule Uruguay 1988 only - Mar 14 0:00 0 S +Rule Uruguay 1988 only - Dec 11 0:00 1:00 D +Rule Uruguay 1989 only - Mar 12 0:00 0 S +Rule Uruguay 1989 only - Oct 29 0:00 1:00 D +Rule Uruguay 1990 only - Mar 4 0:00 0 S +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28 + -3:45 - MMT 1920 May 1 # Montevideo MT + -3:30 Uruguay U%sT 1942 Dec 14 # Uruguay ST + -3:00 Uruguay E%sT + +# Venezuela +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone America/Caracas -4:27:44 - LMT 1890 + -4:28 - CMT 1912 Feb 12 # Caracas Mean Time + -4:30 - VZT 1965 # Venezuela Time + -4:00 - AST diff --git a/time/strftime.c b/time/strftime.c new file mode 100644 index 0000000000..ccc19c72b0 --- /dev/null +++ b/time/strftime.c @@ -0,0 +1,296 @@ +/* Extensions for GNU date that are still missing here: + - + _ +*/ + +/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <localeinfo.h> +#include <ctype.h> +#include <limits.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#ifndef HAVE_GNU_LD +#define __tzname tzname +#define __daylight daylight +#define __timezone timezone +#endif + + +#define add(n, f) \ + do \ + { \ + i += (n); \ + if (i >= maxsize) \ + return 0; \ + else \ + if (p != NULL) \ + { \ + f; \ + p += (n); \ + } \ + } while (0) +#define cpy(n, s) add((n), memcpy((PTR) p, (PTR) (s), (n))) +#define fmt(n, args) add((n), if (sprintf args != (n)) return 0) + +/* Return the week in the year specified by TP, + with weeks starting on STARTING_DAY. */ +#ifdef __GNUC__ +inline +#endif +static unsigned int +DEFUN(week, (tp, starting_day), + CONST struct tm *CONST tp AND int starting_day) +{ + int wday, dl; + + wday = tp->tm_wday - starting_day; + if (wday < 0) + wday += 7; + + /* Set DL to the day in the year of the last day of the week previous to the + one containing the day specified in TP. If DL is negative or zero, the + day specified in TP is in the first week of the year. Otherwise, + calculate the number of complete weeks before our week (DL / 7) and + add any partial week at the start of the year (DL % 7). */ + dl = tp->tm_yday - wday; + return dl <= 0 ? 0 : ((dl / 7) + ((dl % 7) == 0 ? 0 : 1)); +} + + +/* Write information from TP into S according to the format + string FORMAT, writing no more that MAXSIZE characters + (including the terminating '\0') and returning number of + characters written. If S is NULL, nothing will be written + anywhere, so to determine how many characters would be + written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */ +size_t +DEFUN(strftime, (s, maxsize, format, tp), + char *s AND size_t maxsize AND + CONST char *format AND register CONST struct tm *tp) +{ + CONST char *CONST a_wkday = _time_info->abbrev_wkday[tp->tm_wday]; + CONST char *CONST f_wkday = _time_info->full_wkday[tp->tm_wday]; + CONST char *CONST a_month = _time_info->abbrev_month[tp->tm_mon]; + CONST char *CONST f_month = _time_info->full_month[tp->tm_mon]; + size_t aw_len = strlen(a_wkday); + size_t am_len = strlen(a_month); + size_t wkday_len = strlen(f_wkday); + size_t month_len = strlen(f_month); + int hour12 = tp->tm_hour; + CONST char *CONST ampm = _time_info->ampm[hour12 >= 12]; + size_t ap_len = strlen(ampm); + CONST unsigned int y_week0 = week(tp, 0); + CONST unsigned int y_week1 = week(tp, 1); + CONST char *zone; + size_t zonelen; + register size_t i = 0; + register char *p = s; + register CONST char *f; + + if (tp->tm_isdst < 0) + { + zone = ""; + zonelen = 0; + } + else + { + zone = __tzname[tp->tm_isdst]; + zonelen = strlen(zone); + } + + if (hour12 > 12) + hour12 -= 12; + else + if (hour12 == 0) hour12 = 12; + + for (f = format; *f != '\0'; ++f) + { + CONST char *subfmt; + + if (!isascii(*f)) + { + /* Non-ASCII, may be a multibyte. */ + int len = mblen(f, strlen(f)); + if (len > 0) + { + cpy(len, f); + continue; + } + } + + if (*f != '%') + { + add(1, *p = *f); + continue; + } + + ++f; + switch (*f) + { + case '\0': + case '%': + add(1, *p = *f); + break; + + case 'a': + cpy(aw_len, a_wkday); + break; + + case 'A': + cpy(wkday_len, f_wkday); + break; + + case 'b': + case 'h': /* GNU extension. */ + cpy(am_len, a_month); + break; + + case 'B': + cpy(month_len, f_month); + break; + + case 'c': + subfmt = _time_info->date_time; + subformat: + { + size_t len = strftime (p, maxsize - i, subfmt, tp); + add(len, ); + } + break; + + case 'C': + fmt (2, (p, "%.2d", (1900 + tp->tm_year) / 100)); + break; + + case 'D': /* GNU extension. */ + subfmt = "%m/%d/%y"; + goto subformat; + + case 'd': + fmt(2, (p, "%.2d", tp->tm_mday)); + break; + + case 'e': /* GNU extension: %d, but blank-padded. */ + fmt(2, (p, "%2d", tp->tm_mday)); + break; + + case 'H': + fmt(2, (p, "%.2d", tp->tm_hour)); + break; + + case 'I': + fmt(2, (p, "%.2d", hour12)); + break; + + case 'k': /* GNU extension. */ + fmt(2, (p, "%2d", tp->tm_hour)); + break; + + case 'l': /* GNU extension. */ + fmt(2, (p, "%2d", hour12)); + break; + + case 'j': + fmt(3, (p, "%.3d", 1 + tp->tm_yday)); + break; + + case 'M': + fmt(2, (p, "%.2d", tp->tm_min)); + break; + + case 'm': + fmt(2, (p, "%.2d", tp->tm_mon + 1)); + break; + + case 'n': /* GNU extension. */ + add (1, *p = '\n'); + break; + + case 'p': + cpy(ap_len, ampm); + break; + + case 'R': /* GNU extension. */ + subfmt = "%H:%M"; + goto subformat; + + case 'r': /* GNU extension. */ + subfmt = "%I:%M:%S %p"; + goto subformat; + + case 'S': + fmt(2, (p, "%.2d", tp->tm_sec)); + break; + + case 'T': /* GNU extenstion. */ + subfmt = "%H:%M:%S"; + goto subformat; + + case 't': /* GNU extenstion. */ + add (1, *p = '\t'); + break; + + case 'U': + fmt(2, (p, "%.2u", y_week0)); + break; + + case 'W': + fmt(2, (p, "%.2u", y_week1)); + break; + + case 'w': + fmt(2, (p, "%.2d", tp->tm_wday)); + break; + + case 'X': + subfmt = _time_info->time; + goto subformat; + + case 'x': + subfmt = _time_info->date; + goto subformat; + + case 'Y': + fmt(4, (p, "%.4d", 1900 + tp->tm_year)); + break; + + case 'y': + fmt(2, (p, "%.2d", tp->tm_year)); + break; + + case 'Z': + cpy(zonelen, zone); + break; + + default: + /* Bad format. */ + break; + } + } + + if (p != NULL) + *p = '\0'; + return i; +} diff --git a/time/sys/time.h b/time/sys/time.h new file mode 100644 index 0000000000..7275561541 --- /dev/null +++ b/time/sys/time.h @@ -0,0 +1,147 @@ +/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _SYS_TIME_H + +#define _SYS_TIME_H 1 +#include <features.h> + +#include <time.h> + +__BEGIN_DECLS + +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + int tv_sec; /* Seconds. */ + int tv_usec; /* Microseconds. */ + }; + +/* POSIX.4 structure for a time value. This is like a `struct timeval' but + has nanoseconds instead of microseconds. */ +struct timespec + { + long int ts_sec; /* Seconds. */ + long int ts_nsec; /* Nanoseconds. */ + }; + +/* Macros for converting between `struct timeval' and `struct timespec'. */ +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->ts_sec = (tv)->tv_sec; \ + (ts)->ts_nsec = (tv)->tv_usec * 1000; \ +} +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->ts_sec; \ + (tv)->tv_usec = (ts)->ts_nsec / 1000; \ +} + + +/* Structure crudely representing a timezone. + This is obsolete and should never be used. */ +struct timezone + { + int tz_minuteswest; /* Minutes west of GMT. */ + int tz_dsttime; /* Nonzero if DST is ever in effect. */ + }; + +/* Get the current time of day and timezone information, + putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. + Returns 0 on success, -1 on errors. + NOTE: This form of timezone information is obsolete. + Use the functions and variables declared in <time.h> instead. */ +extern int __gettimeofday __P ((struct timeval *__tv, + struct timezone *__tz)); +extern int gettimeofday __P ((struct timeval *__tv, + struct timezone *__tz)); + +/* Set the current time of day and timezone information. + This call is restricted to the super-user. */ +extern int __settimeofday __P ((__const struct timeval *__tv, + __const struct timezone *__tz)); +extern int settimeofday __P ((__const struct timeval *__tv, + __const struct timezone *__tz)); + +/* Adjust the current time of day by the amount in DELTA. + If OLDDELTA is not NULL, it is filled in with the amount + of time adjustment remaining to be done from the last `adjtime' call. + This call is restricted to the super-user. */ +extern int __adjtime __P ((__const struct timeval *__delta, + struct timeval *__olddelta)); +extern int adjtime __P ((__const struct timeval *__delta, + struct timeval *__olddelta)); + + +/* Values for the first argument to `getitimer' and `setitimer'. */ +enum __itimer_which + { + /* Timers run in real time. */ + ITIMER_REAL = 0, + /* Timers run only when the process is executing. */ + ITIMER_VIRTUAL = 1, + /* Timers run when the process is executing and when + the system is executing on behalf of the process. */ + ITIMER_PROF = 2 + }; + +/* Type of the second argument to `getitimer' and + the second and third arguments `setitimer'. */ +struct itimerval + { + /* Value to put into `it_value' when the timer expires. */ + struct timeval it_interval; + /* Time to the next timer expiration. */ + struct timeval it_value; + }; + +/* Set *VALUE to the current setting of timer WHICH. + Return 0 on success, -1 on errors. */ +extern int __getitimer __P ((enum __itimer_which __which, + struct itimerval *__value)); +extern int getitimer __P ((enum __itimer_which __which, + struct itimerval *__value)); + +/* Set the timer WHICH to *NEW. If OLD is not NULL, + set *OLD to the old value of timer WHICH. + Returns 0 on success, -1 on errors. */ +extern int __setitimer __P ((enum __itimer_which __which, + struct itimerval *__new, + struct itimerval *__old)); +extern int setitimer __P ((enum __itimer_which __which, + struct itimerval *__new, + struct itimerval *__old)); + +/* Change the access time of FILE to TVP[0] and + the modification time of FILE to TVP[1]. */ +extern int __utimes __P ((__const char *__file, struct timeval __tvp[2])); +extern int utimes __P ((__const char *__file, struct timeval __tvp[2])); + + +/* Convenience macros for operations on timevals. + NOTE: `timercmp' does not work for >= or <=. */ +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp, uvp, CMP) \ + ((tvp)->tv_sec CMP (uvp)->tv_sec || \ + (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec CMP (uvp)->tv_usec) +#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) + + + +__END_DECLS + +#endif /* sys/time.h */ diff --git a/time/sys/timeb.h b/time/sys/timeb.h new file mode 100644 index 0000000000..965cb3deba --- /dev/null +++ b/time/sys/timeb.h @@ -0,0 +1,43 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _SYS_TIMEB_H + +#define _SYS_TIMEB_H 1 +#include <features.h> + +#define __need_time_t +#include <time.h> + + +/* Structure returned by the `ftime' function. */ + +struct timeb + { + time_t time; /* Seconds since epoch, as from `time'. */ + unsigned short int millitm; /* Additional milliseconds. */ + short int timezone; /* Minutes west of GMT. */ + short int dstflag; /* Nonzero if Daylight Savings Time used. */ + }; + +/* Fill in TIMEBUF with information about the current time. */ + +extern int ftime __P ((struct timeb *__timebuf)); + + +#endif /* sys/timeb.h */ diff --git a/time/systemv b/time/systemv new file mode 100644 index 0000000000..a6f79d231a --- /dev/null +++ b/time/systemv @@ -0,0 +1,35 @@ +# @(#)systemv 7.2 + +# Old rules, should the need arise. +# No attempt is made to handle Newfoundland, since it cannot be expressed +# using the System V "TZ" scheme (half-hour offset), or anything outside +# North America (no support for non-standard DST start/end dates), nor +# the change in the DST rules in the US in 1987 (can't split between +# Canada, with no changes, and the US) +# +# Be sure to compile this *without* leap second correction for true conformance. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule SystemV min 1973 - Apr lastSun 2:00 1:00 D +Rule SystemV min 1973 - Oct lastSun 2:00 0 S +Rule SystemV 1974 only - Jan 6 2:00 1:00 D +Rule SystemV 1974 only - Nov lastSun 2:00 0 S +Rule SystemV 1975 only - Feb 23 2:00 1:00 D +Rule SystemV 1975 only - Oct lastSun 2:00 0 S +Rule SystemV 1976 max - Apr lastSun 2:00 1:00 D +Rule SystemV 1976 max - Oct lastSun 2:00 0 S + +# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] +Zone SystemV/AST4ADT -4:00 SystemV A%sT +Zone SystemV/EST5EDT -5:00 SystemV E%sT +Zone SystemV/CST6CDT -6:00 SystemV C%sT +Zone SystemV/MST7MDT -7:00 SystemV M%sT +Zone SystemV/PST8PDT -8:00 SystemV P%sT +Zone SystemV/YST9YDT -9:00 SystemV Y%sT +Zone SystemV/AST4 -4:00 - AST +Zone SystemV/EST5 -5:00 - EST +Zone SystemV/CST6 -6:00 - CST +Zone SystemV/MST7 -7:00 - MST +Zone SystemV/PST8 -8:00 - PST +Zone SystemV/YST9 -9:00 - YST +Zone SystemV/HST10 -10:00 - HST diff --git a/time/test_time.args b/time/test_time.args new file mode 100644 index 0000000000..d84cd1c066 --- /dev/null +++ b/time/test_time.args @@ -0,0 +1,2 @@ +EST5EDT +CST diff --git a/time/test_time.c b/time/test_time.c new file mode 100644 index 0000000000..a090d93db4 --- /dev/null +++ b/time/test_time.c @@ -0,0 +1,117 @@ +/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + + +int +DEFUN(main, (argc, argv), int argc AND char **argv) +{ + time_t t; + register struct tm *tp; + struct tm tbuf; + int lose = 0; + + --argc; + ++argv; + + do + { + char buf[BUFSIZ]; + if (argc > 0) + { + static char buf[BUFSIZ]; + sprintf(buf, "TZ=%s", *argv); + if (putenv(buf)) + { + puts("putenv failed."); + lose = 1; + } + else + puts (buf); + } + tzset(); + tbuf.tm_year = 72; + tbuf.tm_mon = 0; + tbuf.tm_mday = 31; + tbuf.tm_hour = 6; + tbuf.tm_min = 14; + tbuf.tm_sec = 50; + tbuf.tm_isdst = -1; + doit:; + t = mktime(&tbuf); + if (t == (time_t) -1) + { + puts("mktime() failed?"); + lose = 1; + } + tp = localtime(&t); + if (tp == NULL) + { + puts("localtime() failed."); + lose = 1; + } + else if (strftime(buf, sizeof(buf), "%a %b %d %X %Z %Y", tp) == 0) + { + puts("strftime() failed."); + lose = 1; + } + else + puts(buf); + if (tbuf.tm_year == 101) + { + tbuf.tm_year = 97; + tbuf.tm_mon = 0; + goto doit; + } + ++argv; + } while (--argc > 0); + + { +#define SIZE 256 + char buffer[SIZE]; + time_t curtime; + struct tm *loctime; + + curtime = time (NULL); + + loctime = localtime (&curtime); + + fputs (asctime (loctime), stdout); + + strftime (buffer, SIZE, "Today is %A, %B %d.\n", loctime); + fputs (buffer, stdout); + strftime (buffer, SIZE, "The time is %I:%M %p.\n", loctime); + fputs (buffer, stdout); + + loctime->tm_year = 72; + loctime->tm_mon = 8; + loctime->tm_mday = 12; + loctime->tm_hour = 20; + loctime->tm_min = 49; + loctime->tm_sec = 05; + curtime = mktime (loctime); + strftime (buffer, SIZE, "%D %T was %w the %jth.\n", loctime); + fputs (buffer, stdout); + } + + return (lose ? EXIT_FAILURE : EXIT_SUCCESS); +} diff --git a/time/time.h b/time/time.h new file mode 100644 index 0000000000..7070881949 --- /dev/null +++ b/time/time.h @@ -0,0 +1,204 @@ +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* + * ANSI Standard: 4.12 DATE and TIME <time.h> + */ + +#ifndef _TIME_H + +#if !defined(__need_time_t) && !defined(__need_clock_t) +#define _TIME_H 1 +#include <features.h> + +__BEGIN_DECLS + +#endif + +#ifdef _TIME_H +/* Get size_t and NULL from <stddef.h>. */ +#define __need_size_t +#define __need_NULL +#include <stddef.h> +#endif /* <time.h> included. */ + + + +#ifdef _TIME_H +/* Processor clock ticks per second. */ +#define CLOCKS_PER_SEC 1 /* ??? */ + +#ifdef __USE_POSIX +#define CLK_TCK 60 /* ??? */ +#endif + +#endif /* <time.h> included. */ + + +#if !defined(__clock_t_defined) && \ + (defined(_TIME_H) || defined(__need_clock_t)) +#define __clock_t_defined 1 + +/* Returned by `clock'. */ +typedef long int clock_t; + +#endif /* clock_t not defined and <time.h> or need clock_t. */ +#undef __need_clock_t + +#if !defined(__time_t_defined) && \ + (defined(_TIME_H) || defined(__need_time_t)) +#define __time_t_defined 1 + +#include <gnu/types.h> + +/* Returned by `time'. */ +typedef __time_t time_t; + +#endif /* time_t not defined and <time.h> or need time_t. */ +#undef __need_time_t + + +#ifdef _TIME_H +/* Used by other time functions. */ +struct tm +{ + int tm_sec; /* Seconds. [0-61] (2 leap seconds) */ + int tm_min; /* Minutes. [0-59] */ + int tm_hour; /* Hours. [0-23] */ + int tm_mday; /* Day. [1-31] */ + int tm_mon; /* Month. [0-11] */ + int tm_year; /* Year - 1900. */ + int tm_wday; /* Day of week. [0-6] */ + int tm_yday; /* Days in year.[0-365] */ + int tm_isdst; /* DST. [-1/0/1]*/ + long int tm_gmtoff; /* Seconds west of UTC. */ + __const char *tm_zone; /* Timezone abbreviation. */ +}; + +#endif /* <time.h> included. */ + + +#ifdef _TIME_H +/* Time used by the program so far (user time + system time). + The result / CLOCKS_PER_SECOND is program time in seconds. */ +extern clock_t clock __P ((void)); + +/* Return the current time and put it in *TIMER if TIMER is not NULL. */ +extern time_t time __P ((time_t *__timer)); + +/* Return the difference between TIME1 and TIME0. */ +extern double difftime __P ((time_t __time1, time_t __time0)) + __attribute__ ((__const__)); + +/* Return the `time_t' representation of TP and normalize TP. */ +extern time_t mktime __P ((struct tm *__tp)); + +/* Subroutine of `mktime'. Return the `time_t' representation of TP and + normalize TP, given that a `struct tm *' maps to a `time_t' as performed + by FUNC. */ +extern time_t _mktime_internal __P ((struct tm *__tp, + struct tm *(*__func) (const time_t *))); + + +/* Format TP into S according to FORMAT. + Write no more than MAXSIZE characters and return the number + of characters written, or 0 if it would exceed MAXSIZE. */ +extern size_t strftime __P ((char *__s, size_t __maxsize, + __const char *__format, __const struct tm *__tp)); + + +/* Return the `struct tm' representation of *TIMER + in Universal Coordinated Time (aka Greenwich Mean Time). */ +extern struct tm *gmtime __P ((__const time_t *__timer)); + +/* Return the `struct tm' representation + of *TIMER in the local timezone. */ +extern struct tm *localtime __P ((__const time_t *__timer)); + +/* Return the `struct tm' representation of *TIMER, + offset OFFSET seconds east of Universal Coordinated Time. */ +extern struct tm *__offtime __P ((__const time_t *__timer, + long int __offset)); + +/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" + that is the representation of TP in this format. */ +extern char *asctime __P ((__const struct tm *__tp)); + +/* Equivalent to `asctime(localtime(timer))'. */ +extern char *ctime __P ((__const time_t *__timer)); + + +/* Defined in localtime.c. */ +extern char *__tzname[2]; /* Current timezone names. */ +extern int __daylight; /* If it is daylight savings time. */ +extern long int __timezone; /* Seconds west of UTC. */ + +/* Set time conversion information from the TZ environment variable. + If TZ is not defined, a locale-dependent default is used. */ +extern void __tzset __P ((void)); + +#ifdef __USE_POSIX +/* Same as above. */ +extern char *tzname[2]; + +/* Return the maximum length of a timezone name. + This is what `sysconf (_SC_TZNAME_MAX)' does. */ +extern long int __tzname_max __P ((void)); + +extern void tzset __P ((void)); +#ifdef __OPTIMIZE__ +#define tzset() __tzset() +#endif /* Optimizing. */ +#endif + +#ifdef __USE_SVID +extern int daylight; +extern long int timezone; + +/* Set the system time to *WHEN. + This call is restricted to the superuser. */ +extern int stime __P ((__const time_t *__when)); +#endif + + +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +#define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) + + +#ifdef __USE_MISC +/* Miscellaneous functions many Unices inherited from the public domain + localtime package. These are included only for compatibility. */ + +/* Like `mktime', but for TP represents Universal Time, not local time. */ +extern time_t timegm __P ((struct tm *__tp)); + +/* Another name for `mktime'. */ +extern time_t timelocal __P ((struct tm *__tp)); + +/* Return the number of days in YEAR. */ +extern int dysize __P ((int __year)); +#endif + + +__END_DECLS + +#endif /* <time.h> included. */ + +#endif /* <time.h> not already included. */ diff --git a/time/timegm.c b/time/timegm.c new file mode 100644 index 0000000000..dc80f78683 --- /dev/null +++ b/time/timegm.c @@ -0,0 +1,27 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <time.h> + +time_t +timegm (tmp) + struct tm *const tmp; +{ + tmp->tm_isdst = 0; + return _mktime_internal (tmp, gmtime); +} diff --git a/time/tzfile.c b/time/tzfile.c new file mode 100644 index 0000000000..841f598c87 --- /dev/null +++ b/time/tzfile.c @@ -0,0 +1,332 @@ +/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <stdlib.h> +#include <stdio.h> +#include <time.h> +#include <string.h> +#include <limits.h> + +#define NOID +#include <tzfile.h> + +#ifndef HAVE_GNU_LD +#define __tzname tzname +#define __daylight daylight +#define __timezone timezone +#endif + +int __use_tzfile = 0; + +struct ttinfo + { + long int offset; /* Seconds east of GMT. */ + unsigned char isdst; /* Used to set tm_isdst. */ + unsigned char idx; /* Index into `zone_names'. */ + unsigned char isstd; /* Transition times are standard time. */ + }; + +struct leap + { + time_t transition; /* Time the transition takes effect. */ + long int change; /* Seconds of correction to apply. */ + }; + +static void compute_tzname_max __P ((size_t)); + +static size_t num_transitions; +static time_t *transitions = NULL; +static unsigned char *type_idxs = NULL; +static size_t num_types; +static struct ttinfo *types = NULL; +static char *zone_names = NULL; +static size_t num_leaps; +static struct leap *leaps = NULL; + +#define uc2ul(x) _uc2ul((unsigned char *) (x)) +#define _uc2ul(x) \ + ((x)[3] + ((x)[2] << CHAR_BIT) + ((x)[1] << (2 * CHAR_BIT)) + \ + ((x)[0] << (3 * CHAR_BIT))) + +void +DEFUN(__tzfile_read, (file), CONST char *file) +{ + size_t num_isstd; + register FILE *f; + struct tzhead tzhead; + size_t chars; + register size_t i; + + __use_tzfile = 0; + + if (transitions != NULL) + free((PTR) transitions); + transitions = NULL; + if (type_idxs != NULL) + free((PTR) type_idxs); + type_idxs = NULL; + if (types != NULL) + free((PTR) types); + types = NULL; + if (zone_names != NULL) + free((PTR) zone_names); + zone_names = NULL; + if (leaps != NULL) + free((PTR) leaps); + leaps = NULL; + + if (file == NULL || *file == '\0') + file = TZDEFAULT; + + if (*file != '/') + { + static CONST char tzdir[] = TZDIR; + register CONST unsigned int len = strlen(file) + 1; + char *new = (char *) __alloca(sizeof(tzdir) + len); + memcpy(new, tzdir, sizeof(tzdir) - 1); + new[sizeof(tzdir) - 1] = '/'; + memcpy(&new[sizeof(tzdir)], file, len); + file = new; + } + + f = fopen(file, "r"); + if (f == NULL) + return; + + if (fread((PTR) &tzhead, sizeof(tzhead), 1, f) != 1) + goto lose; + + num_transitions = (size_t) uc2ul(tzhead.tzh_timecnt); + num_types = (size_t) uc2ul(tzhead.tzh_typecnt); + chars = (size_t) uc2ul(tzhead.tzh_charcnt); + num_leaps = (size_t) uc2ul(tzhead.tzh_leapcnt); + num_isstd = (size_t) uc2ul(tzhead.tzh_ttisstdcnt); + + if (num_transitions > 0) + { + transitions = (time_t *) malloc (num_transitions * sizeof(time_t)); + if (transitions == NULL) + goto lose; + type_idxs = (unsigned char *) malloc (num_transitions); + if (type_idxs == NULL) + goto lose; + } + if (num_types > 0) + { + types = (struct ttinfo *) malloc (num_types * sizeof (struct ttinfo)); + if (types == NULL) + goto lose; + } + if (chars > 0) + { + zone_names = (char *) malloc (chars); + if (zone_names == NULL) + goto lose; + } + if (num_leaps > 0) + { + leaps = (struct leap *) malloc (num_leaps * sizeof (struct leap)); + if (leaps == NULL) + goto lose; + } + + if (fread((PTR) transitions, sizeof(time_t), + num_transitions, f) != num_transitions || + fread((PTR) type_idxs, 1, num_transitions, f) != num_transitions) + goto lose; + + for (i = 0; i < num_transitions; ++i) + transitions[i] = uc2ul (&transitions[i]); + + for (i = 0; i < num_types; ++i) + { + unsigned char x[4]; + if (fread((PTR) x, 1, 4, f) != 4 || + fread((PTR) &types[i].isdst, 1, 1, f) != 1 || + fread((PTR) &types[i].idx, 1, 1, f) != 1) + goto lose; + types[i].offset = (long int) uc2ul(x); + } + + if (fread((PTR) zone_names, 1, chars, f) != chars) + goto lose; + + for (i = 0; i < num_leaps; ++i) + { + unsigned char x[4]; + if (fread((PTR) x, 1, sizeof(x), f) != sizeof(x)) + goto lose; + leaps[i].transition = (time_t) uc2ul(x); + if (fread((PTR) x, 1, sizeof(x), f) != sizeof(x)) + goto lose; + leaps[i].change = (long int) uc2ul(x); + } + + for (i = 0; i < num_isstd; ++i) + { + char c = getc(f); + if (c == EOF) + goto lose; + types[i].isstd = c != 0; + } + while (i < num_types) + types[i++].isstd = 0; + + (void) fclose(f); + + compute_tzname_max (chars); + + __use_tzfile = 1; + return; + + lose:; + (void) fclose(f); +} + +void +DEFUN(__tzfile_default, (std, dst, stdoff, dstoff), + char *std AND char *dst AND + long int stdoff AND long int dstoff) +{ + size_t stdlen, dstlen, i; + + __tzfile_read (TZDEFRULES); + if (!__use_tzfile) + return; + + if (num_types < 2) + { + __use_tzfile = 0; + return; + } + + free (zone_names); + + stdlen = strlen (std) + 1; + dstlen = strlen (dst) + 1; + zone_names = malloc (stdlen + dstlen); + if (zone_names == NULL) + { + __use_tzfile = 0; + return; + } + memcpy (zone_names, std, stdlen); + memcpy (&zone_names[stdlen], dst, dstlen); + + for (i = 0; i < num_types; ++i) + if (types[i].isdst) + { + types[i].idx = stdlen; + if (dst[0] != '\0') + types[i].offset = dstoff; + } + else + { + types[i].idx = 0; + if (dst[0] != '\0') + types[i].offset = stdoff; + } + + compute_tzname_max (stdlen + dstlen); +} + +int +DEFUN(__tzfile_compute, (timer, leap_correct, leap_hit), + time_t timer AND long int *leap_correct AND int *leap_hit) +{ + struct ttinfo *info; + register size_t i; + + if (num_transitions == 0 || timer < transitions[0]) + { + /* TIMER is before any transition (or there are no transitions). + Choose the first non-DST type + (or the first if they're all DST types). */ + i = 0; + while (i < num_types && types[i].isdst) + ++i; + if (i == num_types) + i = 0; + } + else + { + /* Find the first transition after TIMER, and + then pick the type of the transition before it. */ + for (i = 1; i < num_transitions; ++i) + if (timer < transitions[i]) + break; + i = type_idxs[i - 1]; + } + + info = &types[i]; + __daylight = info->isdst; + __timezone = info->offset; + for (i = 0; i < num_types && i < sizeof (__tzname) / sizeof (__tzname[0]); + ++i) + __tzname[types[i].isdst] = &zone_names[types[i].idx]; + if (info->isdst < sizeof (__tzname) / sizeof (__tzname[0])) + __tzname[info->isdst] = &zone_names[info->idx]; + + *leap_correct = 0L; + *leap_hit = 0; + + /* Find the last leap second correction transition time before TIMER. */ + i = num_leaps; + do + if (i-- == 0) + return 1; + while (timer < leaps[i].transition); + + /* Apply its correction. */ + *leap_correct = leaps[i].change; + + if (timer == leaps[i].transition && /* Exactly at the transition time. */ + ((i == 0 && leaps[i].change > 0) || + leaps[i].change > leaps[i - 1].change)) + { + *leap_hit = 1; + while (i > 0 && + leaps[i].transition == leaps[i - 1].transition + 1 && + leaps[i].change == leaps[i - 1].change + 1) + { + ++*leap_hit; + --i; + } + } + + return 1; +} + +void +DEFUN(compute_tzname_max, (chars), size_t chars) +{ + extern long int __tzname_cur_max; /* Defined in __tzset.c. */ + + const char *p; + + p = zone_names; + do + { + const char *start = p; + while (*p != '\0') + ++p; + if (p - start > __tzname_cur_max) + __tzname_cur_max = p - start; + } while (++p < &zone_names[chars]); +} diff --git a/time/tzfile.h b/time/tzfile.h new file mode 100644 index 0000000000..45b4d7d606 --- /dev/null +++ b/time/tzfile.h @@ -0,0 +1,170 @@ +#ifndef TZFILE_H + +#define TZFILE_H + +/* +** This header is for use ONLY with the time conversion code. +** There is no guarantee that it will remain unchanged, +** or that it will remain at all. +** Do NOT copy it to any system include directory. +** Thank you! +*/ + +/* +** ID +*/ + +#ifndef lint +#ifndef NOID +static char tzfilehid[] = "@(#)tzfile.h 7.4"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +/* +** Information about time zone files. +*/ + +#ifndef TZDIR +#define TZDIR "/usr/local/etc/zoneinfo" /* Time zone object file directory */ +#endif /* !defined TZDIR */ + +#ifndef TZDEFAULT +#define TZDEFAULT "localtime" +#endif /* !defined TZDEFAULT */ + +#ifndef TZDEFRULES +#define TZDEFRULES "posixrules" +#endif /* !defined TZDEFRULES */ + +/* +** Each file begins with. . . +*/ + +struct tzhead { + char tzh_reserved[24]; /* reserved for future use */ + char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ + char tzh_leapcnt[4]; /* coded number of leap seconds */ + char tzh_timecnt[4]; /* coded number of transition times */ + char tzh_typecnt[4]; /* coded number of local time types */ + char tzh_charcnt[4]; /* coded number of abbr. chars */ +}; + +/* +** . . .followed by. . . +** +** tzh_timecnt (char [4])s coded transition times a la time(2) +** tzh_timecnt (unsigned char)s types of local time starting at above +** tzh_typecnt repetitions of +** one (char [4]) coded GMT offset in seconds +** one (unsigned char) used to set tm_isdst +** one (unsigned char) that's an abbreviation list index +** tzh_charcnt (char)s '\0'-terminated zone abbreviations +** tzh_leapcnt repetitions of +** one (char [4]) coded leap second transition times +** one (char [4]) total correction after above +** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition +** time is standard time, if FALSE, +** transition time is wall clock time +** if absent, transition times are +** assumed to be wall clock time +*/ + +/* +** In the current implementation, "tzset()" refuses to deal with files that +** exceed any of the limits below. +*/ + +#ifndef TZ_MAX_TIMES +/* +** The TZ_MAX_TIMES value below is enough to handle a bit more than a +** year's worth of solar time (corrected daily to the nearest second) or +** 138 years of Pacific Presidential Election time +** (where there are three time zone transitions every fourth year). +*/ +#define TZ_MAX_TIMES 370 +#endif /* !defined TZ_MAX_TIMES */ + +#ifndef TZ_MAX_TYPES +#ifndef NOSOLAR +#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ +#endif /* !defined NOSOLAR */ +#ifdef NOSOLAR +#define TZ_MAX_TYPES 10 /* Maximum number of local time types */ +#endif /* !defined NOSOLAR */ +#endif /* !defined TZ_MAX_TYPES */ + +#ifndef TZ_MAX_CHARS +#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ + /* (limited by what unsigned chars can hold) */ +#endif /* !defined TZ_MAX_CHARS */ + +#ifndef TZ_MAX_LEAPS +#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ +#endif /* !defined TZ_MAX_LEAPS */ + +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define HOURSPERDAY 24 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define MONSPERYEAR 12 + +#define TM_SUNDAY 0 +#define TM_MONDAY 1 +#define TM_TUESDAY 2 +#define TM_WEDNESDAY 3 +#define TM_THURSDAY 4 +#define TM_FRIDAY 5 +#define TM_SATURDAY 6 + +#define TM_JANUARY 0 +#define TM_FEBRUARY 1 +#define TM_MARCH 2 +#define TM_APRIL 3 +#define TM_MAY 4 +#define TM_JUNE 5 +#define TM_JULY 6 +#define TM_AUGUST 7 +#define TM_SEPTEMBER 8 +#define TM_OCTOBER 9 +#define TM_NOVEMBER 10 +#define TM_DECEMBER 11 + +#define TM_YEAR_BASE 1900 + +#define EPOCH_YEAR 1970 +#define EPOCH_WDAY TM_THURSDAY + +/* +** Accurate only for the past couple of centuries; +** that will probably do. +*/ + +#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) + +#ifndef USG + +/* +** Use of the underscored variants may cause problems if you move your code to +** certain System-V-based systems; for maximum portability, use the +** underscore-free variants. The underscored variants are provided for +** backward compatibility only; they may disappear from future versions of +** this file. +*/ + +#define SECS_PER_MIN SECSPERMIN +#define MINS_PER_HOUR MINSPERHOUR +#define HOURS_PER_DAY HOURSPERDAY +#define DAYS_PER_WEEK DAYSPERWEEK +#define DAYS_PER_NYEAR DAYSPERNYEAR +#define DAYS_PER_LYEAR DAYSPERLYEAR +#define SECS_PER_HOUR SECSPERHOUR +#define SECS_PER_DAY SECSPERDAY +#define MONS_PER_YEAR MONSPERYEAR + +#endif /* !defined USG */ + +#endif /* !defined TZFILE_H */ diff --git a/time/tzset.c b/time/tzset.c new file mode 100644 index 0000000000..e4d5209e88 --- /dev/null +++ b/time/tzset.c @@ -0,0 +1,487 @@ +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <ansidecl.h> +#include <localeinfo.h> +#include <ctype.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +/* Defined in mktime.c. */ +extern CONST unsigned short int __mon_lengths[2][12]; + +#define NOID +#include "tzfile.h" + +extern int __use_tzfile; +extern void EXFUN(__tzfile_read, (CONST char *file)); +extern void EXFUN(__tzfile_default, (char *std AND char *dst AND + long int stdoff AND long int dstoff)); +extern int EXFUN(__tzfile_compute, (time_t, struct tm)); + +#ifndef HAVE_WEAK_SYMBOLS +#define __tzname tzname +#define __daylight daylight +#define __timezone timezone +#else +weak_alias (__tzname, tzname) +weak_alias (__daylight, daylight) +weak_alias (__timezone, timezone) +#endif + +char *__tzname[2] = { (char *) "GMT", (char *) "GMT" }; +int __daylight = 0; +long int __timezone = 0L; + + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define sign(x) ((x) < 0 ? -1 : 1) + + +/* This structure contains all the information about a + timezone given in the POSIX standard TZ envariable. */ +typedef struct + { + char *name; + + /* When to change. */ + enum { J0, J1, M } type; /* Interpretation of: */ + unsigned short int m, n, d; /* Month, week, day. */ + unsigned int secs; /* Time of day. */ + + long int offset; /* Seconds east of GMT (west if < 0). */ + + /* We cache the computed time of change for a + given year so we don't have to recompute it. */ + time_t change; /* When to change to this zone. */ + int computed_for; /* Year above is computed for. */ + } tz_rule; + +/* tz_rules[0] is standard, tz_rules[1] is daylight. */ +static tz_rule tz_rules[2]; + +int __tzset_run = 0; + +/* Interpret the TZ envariable. */ +void +DEFUN_VOID(__tzset) +{ + register CONST char *tz; + register size_t l; + unsigned short int hh, mm, ss; + unsigned short int whichrule; + + /* Free old storage. */ + if (tz_rules[0].name != NULL && *tz_rules[0].name != '\0') + free((PTR) tz_rules[0].name); + if (tz_rules[1].name != NULL && *tz_rules[1].name != '\0' && + tz_rules[1].name != tz_rules[0].name) + free((PTR) tz_rules[1].name); + + tz = getenv("TZ"); + + if (tz != NULL && *tz == ':') + { + __tzfile_read(tz + 1); + if (__use_tzfile) + { + __tzset_run = 1; + return; + } + else + tz = NULL; + } + + if (tz == NULL || *tz == '\0') + tz = _time_info->tz; + if (tz == NULL || *tz == '\0') + { + __tzfile_read((char *) NULL); + if (!__use_tzfile) + { + size_t len = strlen(_time_info->ut0) + 1; + tz_rules[0].name = (char *) malloc(len); + if (tz_rules[0].name == NULL) + return; + tz_rules[1].name = (char *) malloc(len); + if (tz_rules[1].name == NULL) + return; + memcpy((PTR) tz_rules[0].name, _time_info->ut0, len); + memcpy((PTR) tz_rules[1].name, _time_info->ut0, len); + tz_rules[0].type = tz_rules[1].type = J0; + tz_rules[0].m = tz_rules[0].n = tz_rules[0].d = 0; + tz_rules[1].m = tz_rules[1].n = tz_rules[1].d = 0; + tz_rules[0].secs = tz_rules[1].secs = 0; + tz_rules[0].offset = tz_rules[1].offset = 0L; + tz_rules[0].change = tz_rules[1].change = (time_t) -1; + tz_rules[0].computed_for = tz_rules[1].computed_for = 0; + } + __tzset_run = 1; + return; + } + + /* Clear out old state and reset to unnamed GMT. */ + memset (tz_rules, 0, sizeof tz_rules); + tz_rules[0].name = tz_rules[1].name = (char *) ""; + + /* Get the standard timezone name. */ + tz_rules[0].name = (char *) malloc (strlen (tz) + 1); + if (tz_rules[0].name == NULL) + /* Don't set __tzset_run so we will try again. */ + return; + + if (sscanf(tz, "%[^0-9,+-]", tz_rules[0].name) != 1 || + (l = strlen(tz_rules[0].name)) < 3) + { + free (tz_rules[0].name); + tz_rules[0].name = (char *) ""; + return; + } + + { + char *n = realloc ((PTR) tz_rules[0].name, l + 1); + if (n != NULL) + tz_rules[0].name = n; + } + + tz += l; + + /* Figure out the standard offset from GMT. */ + if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit(*tz))) + return; + + if (*tz == '-' || *tz == '+') + tz_rules[0].offset = *tz++ == '-' ? 1L : -1L; + else + tz_rules[0].offset = -1L; + switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss)) + { + default: + return; + case 1: + mm = 0; + case 2: + ss = 0; + case 3: + break; + } + tz_rules[0].offset *= (min(ss, 59) + (min(mm, 59) * 60) + + (min(hh, 12) * 60 * 60)); + + for (l = 0; l < 3; ++l) + { + while (isdigit(*tz)) + ++tz; + if (l < 2 && *tz == ':') + ++tz; + } + + /* Get the DST timezone name (if any). */ + if (*tz != '\0') + { + char *n = malloc (strlen(tz) + 1); + if (n != NULL) + { + tz_rules[1].name = n; + if (sscanf(tz, "%[^0-9,+-]", tz_rules[1].name) != 1 || + (l = strlen(tz_rules[1].name)) < 3) + { + free (n); + tz_rules[1].name = (char *) ""; + goto done_names; /* Punt on name, set up the offsets. */ + } + n = realloc ((PTR) tz_rules[1].name, l + 1); + if (n != NULL) + tz_rules[1].name = n; + } + } + + tz += l; + + /* Figure out the DST offset from GMT. */ + if (*tz == '-' || *tz == '+') + tz_rules[1].offset = *tz++ == '-' ? 1L : -1L; + else + tz_rules[1].offset = -1L; + + switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss)) + { + default: + /* Default to one hour later than standard time. */ + tz_rules[1].offset = tz_rules[0].offset + (60 * 60); + break; + + case 1: + mm = 0; + case 2: + ss = 0; + case 3: + tz_rules[1].offset *= (min(ss, 59) + (min(mm, 59) * 60) + + (min(hh, 12) * (60 * 60))); + break; + } + for (l = 0; l < 3; ++l) + { + while (isdigit (*tz)) + ++tz; + if (l < 2 && *tz == ':') + ++tz; + } + + done_names: + + if (*tz == '\0' || (tz[0] == ',' && tz[1] == '\0')) + { + /* There is no rule. See if there is a default rule file. */ + __tzfile_default (tz_rules[0].name, tz_rules[1].name, + tz_rules[0].offset, tz_rules[1].offset); + if (__use_tzfile) + { + __tzset_run = 1; + return; + } + } + + /* Figure out the standard <-> DST rules. */ + for (whichrule = 0; whichrule < 2; ++whichrule) + { + register tz_rule *tzr = &tz_rules[whichrule]; + + if (*tz == ',') + { + ++tz; + if (*tz == '\0') + return; + } + + /* Get the date of the change. */ + if (*tz == 'J' || isdigit (*tz)) + { + char *end; + tzr->type = *tz == 'J' ? J1 : J0; + if (tzr->type == J1 && !isdigit (*++tz)) + return; + tzr->d = (unsigned short int) strtoul (tz, &end, 10); + if (end == tz || tzr->d > 365) + return; + else if (tzr->type == J1 && tzr->d == 0) + return; + tz = end; + } + else if (*tz == 'M') + { + int n; + tzr->type = M; + if (sscanf (tz, "M%hu.%hu.%hu%n", + &tzr->m, &tzr->n, &tzr->d, &n) != 3 || + tzr->m < 1 || tzr->m > 12 || + tzr->n < 1 || tzr->n > 5 || tzr->d > 6) + return; + tz += n; + } + else if (*tz == '\0') + { + /* United States Federal Law, the equivalent of "M4.1.0,M10.5.0". */ + tzr->type = M; + if (tzr == &tz_rules[0]) + { + tzr->m = 4; + tzr->n = 1; + tzr->d = 0; + } + else + { + tzr->m = 10; + tzr->n = 5; + tzr->d = 0; + } + } + else + return; + + if (*tz != '\0' && *tz != '/' && *tz != ',') + return; + else if (*tz == '/') + { + /* Get the time of day of the change. */ + ++tz; + if (*tz == '\0') + return; + switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss)) + { + default: + hh = 2; /* Default to 2:00 AM. */ + case 1: + mm = 0; + case 2: + ss = 0; + case 3: + break; + } + for (l = 0; l < 3; ++l) + { + while (isdigit(*tz)) + ++tz; + if (l < 2 && *tz == ':') + ++tz; + } + tzr->secs = (hh * 60 * 60) + (mm * 60) + ss; + } + else + /* Default to 2:00 AM. */ + tzr->secs = 2 * 60 * 60; + + tzr->computed_for = -1; + } + + __tzset_run = 1; +} + +/* Maximum length of a timezone name. __tz_compute keeps this up to date + (never decreasing it) when ! __use_tzfile. + tzfile.c keeps it up to date when __use_tzfile. */ +long int __tzname_cur_max; + +long int +DEFUN_VOID(__tzname_max) +{ + if (! __tzset_run) + __tzset (); + + return __tzname_cur_max; +} + +/* Figure out the exact time (as a time_t) in YEAR + when the change described by RULE will occur and + put it in RULE->change, saving YEAR in RULE->computed_for. + Return nonzero if successful, zero on failure. */ +static int +DEFUN(compute_change, (rule, year), tz_rule *rule AND int year) +{ + register time_t t; + int y; + + if (year != -1 && rule->computed_for == year) + /* Operations on times in 1969 will be slower. Oh well. */ + return 1; + + /* First set T to January 1st, 0:00:00 GMT in YEAR. */ + t = 0; + for (y = 1970; y < year; ++y) + t += SECSPERDAY * (__isleap (y) ? 366 : 365); + + switch (rule->type) + { + case J1: + /* Jn - Julian day, 1 == January 1, 60 == March 1 even in leap years. + In non-leap years, or if the day number is 59 or less, just + add SECSPERDAY times the day number-1 to the time of + January 1, midnight, to get the day. */ + t += (rule->d - 1) * SECSPERDAY; + if (rule->d >= 60 && __isleap (year)) + t += SECSPERDAY; + break; + + case J0: + /* n - Day of year. + Just add SECSPERDAY times the day number to the time of Jan 1st. */ + t += rule->d * SECSPERDAY; + break; + + case M: + /* Mm.n.d - Nth "Dth day" of month M. */ + { + register int i, d, m1, yy0, yy1, yy2, dow; + + /* First add SECSPERDAY for each day in months before M. */ + for (i = 0; i < rule->m - 1; ++i) + t += __mon_lengths[__isleap (year)][i] * SECSPERDAY; + + /* Use Zeller's Congruence to get day-of-week of first day of month. */ + m1 = (rule->m + 9) % 12 + 1; + yy0 = (rule->m <= 2) ? (year - 1) : year; + yy1 = yy0 / 100; + yy2 = yy0 % 100; + dow = ((26 * m1 - 2) / 10 + 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7; + if (dow < 0) + dow += 7; + + /* DOW is the day-of-week of the first day of the month. Get the + day-of-month (zero-origin) of the first DOW day of the month. */ + d = rule->d - dow; + if (d < 0) + d += 7; + for (i = 1; i < rule->n; ++i) + { + if (d + 7 >= __mon_lengths[__isleap (year)][rule->m - 1]) + break; + d += 7; + } + + /* D is the day-of-month (zero-origin) of the day we want. */ + t += d * SECSPERDAY; + } + break; + } + + /* T is now the Epoch-relative time of 0:00:00 GMT on the day we want. + Just add the time of day and local offset from GMT, and we're done. */ + + rule->change = t + rule->offset + rule->secs; + rule->computed_for = year; + return 1; +} + + +/* Figure out the correct timezone for *TIMER and TM (which must be the same) + and set `__tzname', `__timezone', and `__daylight' accordingly. + Return nonzero on success, zero on failure. */ +int +DEFUN(__tz_compute, (timer, tm), + time_t timer AND const struct tm *tm) +{ + if (! __tzset_run) + __tzset (); + + if (! compute_change (&tz_rules[0], 1900 + tm->tm_year) || + ! compute_change (&tz_rules[1], 1900 + tm->tm_year)) + return 0; + + __daylight = timer >= tz_rules[0].change && timer < tz_rules[1].change; + __timezone = tz_rules[__daylight ? 1 : 0].offset; + __tzname[0] = (char *) tz_rules[0].name; + __tzname[1] = (char *) tz_rules[1].name; + + { + /* Keep __tzname_cur_max up to date. */ + size_t len0 = strlen (__tzname[0]); + size_t len1 = strlen (__tzname[1]); + if (len0 > __tzname_cur_max) + __tzname_cur_max = len0; + if (len1 > __tzname_cur_max) + __tzname_cur_max = len1; + } + + return 1; +} + +weak_alias (__tzset, tzset) diff --git a/time/yearistype b/time/yearistype new file mode 100755 index 0000000000..c7a886c25b --- /dev/null +++ b/time/yearistype @@ -0,0 +1,26 @@ +#! /bin/sh + +: '@(#)yearistype.sh 7.3' + +case $#-$2 in + 2-even) case $1 in + *[24680]) exit 0 ;; + *) exit 1 ;; + esac ;; + 2-nonpres) case $1 in + *[02468][048]|*[13567][26]) exit 1 ;; + *) exit 0 ;; + esac ;; + 2-odd) case $1 in + *[13579]) exit 0 ;; + *) exit 1 ;; + esac ;; + 2-uspres) case $1 in + *[02468][048]|*[13567][26]) exit 0 ;; + *) exit 1 ;; + esac ;; + 2-*) echo "$0: wild type - $2" >&2 + exit 1 ;; + *) echo "$0: usage is $0 year type" >&2 + exit 1 ;; +esac diff --git a/time/zdump.c b/time/zdump.c new file mode 100644 index 0000000000..d35df33073 --- /dev/null +++ b/time/zdump.c @@ -0,0 +1,331 @@ +#ifndef lint +#ifndef NOID +static char elsieid[] = "@(#)zdump.c 7.12"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +/* +** This code has been made independent of the rest of the time +** conversion package to increase confidence in the verification it provides. +** You can use this code to help in verifying other implementations. +*/ + +#include "stdio.h" /* for stdout, stderr */ +#include "string.h" /* for strcpy */ +#include "sys/types.h" /* for time_t */ +#include "time.h" /* for struct tm */ + +#ifndef MAX_STRING_LENGTH +#define MAX_STRING_LENGTH 1024 +#endif /* !defined MAX_STRING_LENGTH */ + +#ifndef TRUE +#define TRUE 1 +#endif /* !defined TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* !defined FALSE */ + +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif /* !defined EXIT_SUCCESS */ + +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif /* !defined EXIT_FAILURE */ + +#ifndef SECSPERMIN +#define SECSPERMIN 60 +#endif /* !defined SECSPERMIN */ + +#ifndef MINSPERHOUR +#define MINSPERHOUR 60 +#endif /* !defined MINSPERHOUR */ + +#ifndef SECSPERHOUR +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#endif /* !defined SECSPERHOUR */ + +#ifndef HOURSPERDAY +#define HOURSPERDAY 24 +#endif /* !defined HOURSPERDAY */ + +#ifndef EPOCH_YEAR +#define EPOCH_YEAR 1970 +#endif /* !defined EPOCH_YEAR */ + +#ifndef TM_YEAR_BASE +#define TM_YEAR_BASE 1900 +#endif /* !defined TM_YEAR_BASE */ + +#ifndef DAYSPERNYEAR +#define DAYSPERNYEAR 365 +#endif /* !defined DAYSPERNYEAR */ + +#ifndef isleap +#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) +#endif /* !defined isleap */ + +#ifndef GNUC_or_lint +#ifdef lint +#define GNUC_or_lint +#endif /* defined lint */ +#ifdef __GNUC__ +#define GNUC_or_lint +#endif /* defined __GNUC__ */ +#endif /* !defined GNUC_or_lint */ + +#ifndef INITIALIZE +#ifdef GNUC_or_lint +#define INITIALIZE(x) ((x) = 0) +#endif /* defined GNUC_or_lint */ +#ifndef GNUC_or_lint +#define INITIALIZE(x) +#endif /* !defined GNUC_or_lint */ +#endif /* !defined INITIALIZE */ + +extern char ** environ; +extern int getopt(); +extern char * optarg; +extern int optind; +extern time_t time(); +extern char * tzname[2]; + +#ifdef USG +extern void exit(); +extern void perror(); +#endif /* defined USG */ + +static char * abbr(); +static long delta(); +static time_t hunt(); +static int longest; +static char * progname; +static void show(); + +int +main(argc, argv) +int argc; +char * argv[]; +{ + register int i, c; + register int vflag; + register char * cutoff; + register int cutyear; + register long cuttime; + char ** fakeenv; + time_t now; + time_t t, newt; + time_t hibit; + struct tm tm, newtm; + + INITIALIZE(cuttime); + progname = argv[0]; + vflag = 0; + cutoff = NULL; + while ((c = getopt(argc, argv, "c:v")) == 'c' || c == 'v') + if (c == 'v') + vflag = 1; + else cutoff = optarg; + if (c != EOF || + (optind == argc - 1 && strcmp(argv[optind], "=") == 0)) { + (void) fprintf(stderr, +"%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n", + argv[0], argv[0]); + (void) exit(EXIT_FAILURE); + } + if (cutoff != NULL) { + int y; + + cutyear = atoi(cutoff); + cuttime = 0; + for (y = EPOCH_YEAR; y < cutyear; ++y) + cuttime += DAYSPERNYEAR + isleap(y); + cuttime *= SECSPERHOUR * HOURSPERDAY; + } + (void) time(&now); + longest = 0; + for (i = optind; i < argc; ++i) + if (strlen(argv[i]) > longest) + longest = strlen(argv[i]); + for (hibit = 1; (hibit << 1) != 0; hibit <<= 1) + continue; + { + register int from, to; + + for (i = 0; environ[i] != NULL; ++i) + continue; + fakeenv = (char **) malloc((i + 2) * sizeof *fakeenv); + if (fakeenv == NULL || + (fakeenv[0] = (char *) malloc(longest + 4)) == NULL) { + (void) perror(progname); + (void) exit(EXIT_FAILURE); + } + to = 0; + (void) strcpy(fakeenv[to++], "TZ="); + for (from = 0; environ[from] != NULL; ++from) + if (strncmp(environ[from], "TZ=", 3) != 0) + fakeenv[to++] = environ[from]; + fakeenv[to] = NULL; + environ = fakeenv; + } + for (i = optind; i < argc; ++i) { + static char buf[MAX_STRING_LENGTH]; + + (void) strcpy(&fakeenv[0][3], argv[i]); + show(argv[i], now, FALSE); + if (!vflag) + continue; + /* + ** Get lowest value of t. + */ + t = hibit; + if (t > 0) /* time_t is unsigned */ + t = 0; + show(argv[i], t, TRUE); + t += SECSPERHOUR * HOURSPERDAY; + show(argv[i], t, TRUE); + tm = *localtime(&t); + (void) strncpy(buf, abbr(&tm), (sizeof buf) - 1); + for ( ; ; ) { + if (cutoff != NULL && t >= cuttime) + break; + newt = t + SECSPERHOUR * 12; + if (cutoff != NULL && newt >= cuttime) + break; + if (newt <= t) + break; + newtm = *localtime(&newt); + if (delta(&newtm, &tm) != (newt - t) || + newtm.tm_isdst != tm.tm_isdst || + strcmp(abbr(&newtm), buf) != 0) { + newt = hunt(argv[i], t, newt); + newtm = *localtime(&newt); + (void) strncpy(buf, abbr(&newtm), + (sizeof buf) - 1); + } + t = newt; + tm = newtm; + } + /* + ** Get highest value of t. + */ + t = ~((time_t) 0); + if (t < 0) /* time_t is signed */ + t &= ~hibit; + t -= SECSPERHOUR * HOURSPERDAY; + show(argv[i], t, TRUE); + t += SECSPERHOUR * HOURSPERDAY; + show(argv[i], t, TRUE); + } + if (fflush(stdout) || ferror(stdout)) { + (void) fprintf(stderr, "%s: Error writing standard output ", + argv[0]); + (void) perror("standard output"); + (void) exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); + + /* gcc -Wall pacifier */ + for ( ; ; ) + continue; +} + +static time_t +hunt(name, lot, hit) +char * name; +time_t lot; +time_t hit; +{ + time_t t; + struct tm lotm; + struct tm tm; + static char loab[MAX_STRING_LENGTH]; + + lotm = *localtime(&lot); + (void) strncpy(loab, abbr(&lotm), (sizeof loab) - 1); + while ((hit - lot) >= 2) { + t = lot / 2 + hit / 2; + if (t <= lot) + ++t; + else if (t >= hit) + --t; + tm = *localtime(&t); + if (delta(&tm, &lotm) == (t - lot) && + tm.tm_isdst == lotm.tm_isdst && + strcmp(abbr(&tm), loab) == 0) { + lot = t; + lotm = tm; + } else hit = t; + } + show(name, lot, TRUE); + show(name, hit, TRUE); + return hit; +} + +/* +** Thanks to Paul Eggert (eggert@twinsun.com) for logic used in delta. +*/ + +static long +delta(newp, oldp) +struct tm * newp; +struct tm * oldp; +{ + long result; + int tmy; + + if (newp->tm_year < oldp->tm_year) + return -delta(oldp, newp); + result = 0; + for (tmy = oldp->tm_year; tmy < newp->tm_year; ++tmy) + result += DAYSPERNYEAR + isleap(tmy + TM_YEAR_BASE); + result += newp->tm_yday - oldp->tm_yday; + result *= HOURSPERDAY; + result += newp->tm_hour - oldp->tm_hour; + result *= MINSPERHOUR; + result += newp->tm_min - oldp->tm_min; + result *= SECSPERMIN; + result += newp->tm_sec - oldp->tm_sec; + return result; +} + +extern struct tm * localtime(); + +static void +show(zone, t, v) +char * zone; +time_t t; +int v; +{ + struct tm * tmp; + + (void) printf("%-*s ", longest, zone); + if (v) + (void) printf("%.24s GMT = ", asctime(gmtime(&t))); + tmp = localtime(&t); + (void) printf("%.24s", asctime(tmp)); + if (*abbr(tmp) != '\0') + (void) printf(" %s", abbr(tmp)); + if (v) { + (void) printf(" isdst=%d", tmp->tm_isdst); +#ifdef TM_GMTOFF + (void) printf(" gmtoff=%ld", tmp->TM_GMTOFF); +#endif /* defined TM_GMTOFF */ + } + (void) printf("\n"); +} + +static char * +abbr(tmp) +struct tm * tmp; +{ + register char * result; + static char nada; + + if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1) + return &nada; + result = tzname[tmp->tm_isdst]; + return (result == NULL) ? &nada : result; +} diff --git a/time/zic.c b/time/zic.c new file mode 100644 index 0000000000..73ea46821e --- /dev/null +++ b/time/zic.c @@ -0,0 +1,1956 @@ +#ifndef lint +#ifndef NOID +static char elsieid[] = "@(#)zic.c 7.28"; +#endif /* !defined NOID */ +#endif /* !defined lint */ + +#include "private.h" +#include "tzfile.h" + +struct rule { + const char * r_filename; + int r_linenum; + const char * r_name; + + int r_loyear; /* for example, 1986 */ + int r_hiyear; /* for example, 1986 */ + const char * r_yrtype; + + int r_month; /* 0..11 */ + + int r_dycode; /* see below */ + int r_dayofmonth; + int r_wday; + + long r_tod; /* time from midnight */ + int r_todisstd; /* above is standard time if TRUE */ + /* or wall clock time if FALSE */ + int r_todisuniv; /* above is universal time if TRUE */ + /* or local time if FALSE */ + long r_stdoff; /* offset from standard time */ + const char * r_abbrvar; /* variable part of abbreviation */ + + int r_todo; /* a rule to do (used in outzone) */ + time_t r_temp; /* used in outzone */ +}; + +/* +** r_dycode r_dayofmonth r_wday +*/ + +#define DC_DOM 0 /* 1..31 */ /* unused */ +#define DC_DOWGEQ 1 /* 1..31 */ /* 0..6 (Sun..Sat) */ +#define DC_DOWLEQ 2 /* 1..31 */ /* 0..6 (Sun..Sat) */ + +struct zone { + const char * z_filename; + int z_linenum; + + const char * z_name; + long z_gmtoff; + const char * z_rule; + const char * z_format; + + long z_stdoff; + + struct rule * z_rules; + int z_nrules; + + struct rule z_untilrule; + time_t z_untiltime; +}; + +extern int emkdir P((const char * name, int mode)); +extern int getopt P((int argc, char * argv[], const char * options)); +extern char * icatalloc P((char * old, const char * new)); +extern char * icpyalloc P((const char * string)); +extern void ifree P((char * p)); +extern char * imalloc P((int n)); +extern void * irealloc P((void * old, int n)); +extern int link P((const char * fromname, const char * toname)); +extern char * optarg; +extern int optind; +extern char * scheck P((const char * string, const char * format)); + +static void addtt P((time_t starttime, int type)); +static int addtype P((long gmtoff, const char * abbr, int isdst, + int ttisstd)); +static void leapadd P((time_t t, int positive, int rolling, int count)); +static void adjleap P((void)); +static void associate P((void)); +static int ciequal P((const char * ap, const char * bp)); +static void convert P((long val, char * buf)); +static void dolink P((const char * fromfile, const char * tofile)); +static void eat P((const char * name, int num)); +static void eats P((const char * name, int num, + const char * rname, int rnum)); +static long eitol P((int i)); +static void error P((const char * message)); +static char ** getfields P((char * buf)); +static long gethms P((const char * string, const char * errstrng, + int signable)); +static void infile P((const char * filename)); +static void inleap P((char ** fields, int nfields)); +static void inlink P((char ** fields, int nfields)); +static void inrule P((char ** fields, int nfields)); +static int inzcont P((char ** fields, int nfields)); +static int inzone P((char ** fields, int nfields)); +static int inzsub P((char ** fields, int nfields, int iscont)); +static int itsabbr P((const char * abbr, const char * word)); +static int itsdir P((const char * name)); +static int lowerit P((int c)); +static char * memcheck P((char * tocheck)); +static int mkdirs P((char * filename)); +static void newabbr P((const char * abbr)); +static long oadd P((long t1, long t2)); +static void outzone P((const struct zone * zp, int ntzones)); +static void puttzcode P((long code, FILE * fp)); +static int rcomp P((const genericptr_T leftp, const genericptr_T rightp)); +static time_t rpytime P((const struct rule * rp, int wantedy)); +static void rulesub P((struct rule * rp, + const char * loyearp, const char * hiyearp, + const char * typep, const char * monthp, + const char * dayp, const char * timep)); +static void setboundaries P((void)); +static time_t tadd P((time_t t1, long t2)); +static void usage P((void)); +static void writezone P((const char * name)); +static int yearistype P((int year, const char * type)); + +static int charcnt; +static int errors; +static const char * filename; +static int leapcnt; +static int linenum; +static int max_int; +static time_t max_time; +static int max_year; +static int min_int; +static time_t min_time; +static int min_year; +static int noise; +static const char * rfilename; +static int rlinenum; +static const char * progname; +static int timecnt; +static int typecnt; +static int tt_signed; + +/* +** Line codes. +*/ + +#define LC_RULE 0 +#define LC_ZONE 1 +#define LC_LINK 2 +#define LC_LEAP 3 + +/* +** Which fields are which on a Zone line. +*/ + +#define ZF_NAME 1 +#define ZF_GMTOFF 2 +#define ZF_RULE 3 +#define ZF_FORMAT 4 +#define ZF_TILYEAR 5 +#define ZF_TILMONTH 6 +#define ZF_TILDAY 7 +#define ZF_TILTIME 8 +#define ZONE_MINFIELDS 5 +#define ZONE_MAXFIELDS 9 + +/* +** Which fields are which on a Zone continuation line. +*/ + +#define ZFC_GMTOFF 0 +#define ZFC_RULE 1 +#define ZFC_FORMAT 2 +#define ZFC_TILYEAR 3 +#define ZFC_TILMONTH 4 +#define ZFC_TILDAY 5 +#define ZFC_TILTIME 6 +#define ZONEC_MINFIELDS 3 +#define ZONEC_MAXFIELDS 7 + +/* +** Which files are which on a Rule line. +*/ + +#define RF_NAME 1 +#define RF_LOYEAR 2 +#define RF_HIYEAR 3 +#define RF_COMMAND 4 +#define RF_MONTH 5 +#define RF_DAY 6 +#define RF_TOD 7 +#define RF_STDOFF 8 +#define RF_ABBRVAR 9 +#define RULE_FIELDS 10 + +/* +** Which fields are which on a Link line. +*/ + +#define LF_FROM 1 +#define LF_TO 2 +#define LINK_FIELDS 3 + +/* +** Which fields are which on a Leap line. +*/ + +#define LP_YEAR 1 +#define LP_MONTH 2 +#define LP_DAY 3 +#define LP_TIME 4 +#define LP_CORR 5 +#define LP_ROLL 6 +#define LEAP_FIELDS 7 + +/* +** Year synonyms. +*/ + +#define YR_MINIMUM 0 +#define YR_MAXIMUM 1 +#define YR_ONLY 2 + +static struct rule * rules; +static int nrules; /* number of rules */ + +static struct zone * zones; +static int nzones; /* number of zones */ + +struct link { + const char * l_filename; + int l_linenum; + const char * l_from; + const char * l_to; +}; + +static struct link * links; +static int nlinks; + +struct lookup { + const char * l_word; + const int l_value; +}; + +static struct lookup const * byword P((const char * string, + const struct lookup * lp)); + +static struct lookup const line_codes[] = { + { "Rule", LC_RULE }, + { "Zone", LC_ZONE }, + { "Link", LC_LINK }, + { "Leap", LC_LEAP }, + { NULL, 0} +}; + +static struct lookup const mon_names[] = { + { "January", TM_JANUARY }, + { "February", TM_FEBRUARY }, + { "March", TM_MARCH }, + { "April", TM_APRIL }, + { "May", TM_MAY }, + { "June", TM_JUNE }, + { "July", TM_JULY }, + { "August", TM_AUGUST }, + { "September", TM_SEPTEMBER }, + { "October", TM_OCTOBER }, + { "November", TM_NOVEMBER }, + { "December", TM_DECEMBER }, + { NULL, 0 } +}; + +static struct lookup const wday_names[] = { + { "Sunday", TM_SUNDAY }, + { "Monday", TM_MONDAY }, + { "Tuesday", TM_TUESDAY }, + { "Wednesday", TM_WEDNESDAY }, + { "Thursday", TM_THURSDAY }, + { "Friday", TM_FRIDAY }, + { "Saturday", TM_SATURDAY }, + { NULL, 0 } +}; + +static struct lookup const lasts[] = { + { "last-Sunday", TM_SUNDAY }, + { "last-Monday", TM_MONDAY }, + { "last-Tuesday", TM_TUESDAY }, + { "last-Wednesday", TM_WEDNESDAY }, + { "last-Thursday", TM_THURSDAY }, + { "last-Friday", TM_FRIDAY }, + { "last-Saturday", TM_SATURDAY }, + { NULL, 0 } +}; + +static struct lookup const begin_years[] = { + { "minimum", YR_MINIMUM }, + { "maximum", YR_MAXIMUM }, + { NULL, 0 } +}; + +static struct lookup const end_years[] = { + { "minimum", YR_MINIMUM }, + { "maximum", YR_MAXIMUM }, + { "only", YR_ONLY }, + { NULL, 0 } +}; + +static struct lookup const leap_types[] = { + { "Rolling", TRUE }, + { "Stationary", FALSE }, + { NULL, 0 } +}; + +static const int len_months[2][MONSPERYEAR] = { + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; + +static const int len_years[2] = { + DAYSPERNYEAR, DAYSPERLYEAR +}; + +static time_t ats[TZ_MAX_TIMES]; +static unsigned char types[TZ_MAX_TIMES]; +static long gmtoffs[TZ_MAX_TYPES]; +static char isdsts[TZ_MAX_TYPES]; +static unsigned char abbrinds[TZ_MAX_TYPES]; +static char ttisstds[TZ_MAX_TYPES]; +static char chars[TZ_MAX_CHARS]; +static time_t trans[TZ_MAX_LEAPS]; +static long corr[TZ_MAX_LEAPS]; +static char roll[TZ_MAX_LEAPS]; + +/* +** Memory allocation. +*/ + +static char * +memcheck(ptr) +char * const ptr; +{ + if (ptr == NULL) { + (void) perror(progname); + (void) exit(EXIT_FAILURE); + } + return ptr; +} + +#define emalloc(size) memcheck(imalloc(size)) +#define erealloc(ptr, size) memcheck(irealloc((ptr), (size))) +#define ecpyalloc(ptr) memcheck(icpyalloc(ptr)) +#define ecatalloc(oldp, newp) memcheck(icatalloc((oldp), (newp))) + +/* +** Error handling. +*/ + +static void +eats(name, num, rname, rnum) +const char * const name; +const int num; +const char * const rname; +const int rnum; +{ + filename = name; + linenum = num; + rfilename = rname; + rlinenum = rnum; +} + +static void +eat(name, num) +const char * const name; +const int num; +{ + eats(name, num, (char *) NULL, -1); +} + +static void +error(string) +const char * const string; +{ + /* + ** Match the format of "cc" to allow sh users to + ** zic ... 2>&1 | error -t "*" -v + ** on BSD systems. + */ + (void) fprintf(stderr, "\"%s\", line %d: %s", + filename, linenum, string); + if (rfilename != NULL) + (void) fprintf(stderr, " (rule from \"%s\", line %d)", + rfilename, rlinenum); + (void) fprintf(stderr, "\n"); + ++errors; +} + +static void +usage P((void)) +{ + (void) fprintf(stderr, +"%s: usage is %s [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d directory ] \n\ +\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n", + progname, progname); + (void) exit(EXIT_FAILURE); +} + +static const char * psxrules; +static const char * lcltime; +static const char * directory; +static const char * leapsec; +static const char * yitcommand; +static int sflag = FALSE; + +int +main(argc, argv) +int argc; +char * argv[]; +{ + register int i, j; + register int c; + +#ifdef unix + (void) umask(umask(022) | 022); +#endif /* defined unix */ + progname = argv[0]; + while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF) + switch (c) { + default: + usage(); + case 'd': + if (directory == NULL) + directory = optarg; + else { + (void) fprintf(stderr, +"%s: More than one -d option specified\n", + progname); + (void) exit(EXIT_FAILURE); + } + break; + case 'l': + if (lcltime == NULL) + lcltime = optarg; + else { + (void) fprintf(stderr, +"%s: More than one -l option specified\n", + progname); + (void) exit(EXIT_FAILURE); + } + break; + case 'p': + if (psxrules == NULL) + psxrules = optarg; + else { + (void) fprintf(stderr, +"%s: More than one -p option specified\n", + progname); + (void) exit(EXIT_FAILURE); + } + break; + case 'y': + if (yitcommand == NULL) + yitcommand = optarg; + else { + (void) fprintf(stderr, +"%s: More than one -y option specified\n", + progname); + (void) exit(EXIT_FAILURE); + } + break; + case 'L': + if (leapsec == NULL) + leapsec = optarg; + else { + (void) fprintf(stderr, +"%s: More than one -L option specified\n", + progname); + (void) exit(EXIT_FAILURE); + } + break; + case 'v': + noise = TRUE; + break; + case 's': + sflag = TRUE; + break; + } + if (optind == argc - 1 && strcmp(argv[optind], "=") == 0) + usage(); /* usage message by request */ + if (directory == NULL) + directory = TZDIR; + if (yitcommand == NULL) + yitcommand = "yearistype"; + + setboundaries(); + + if (optind < argc && leapsec != NULL) { + infile(leapsec); + adjleap(); + } + + for (i = optind; i < argc; ++i) + infile(argv[i]); + if (errors) + (void) exit(EXIT_FAILURE); + associate(); + for (i = 0; i < nzones; i = j) { + /* + ** Find the next non-continuation zone entry. + */ + for (j = i + 1; j < nzones && zones[j].z_name == NULL; ++j) + continue; + outzone(&zones[i], j - i); + } + /* + ** Make links. + */ + for (i = 0; i < nlinks; ++i) + dolink(links[i].l_from, links[i].l_to); + if (lcltime != NULL) + dolink(lcltime, TZDEFAULT); + if (psxrules != NULL) + dolink(psxrules, TZDEFRULES); + return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} + +static void +dolink(fromfile, tofile) +const char * const fromfile; +const char * const tofile; +{ + register char * fromname; + register char * toname; + + if (fromfile[0] == '/') + fromname = ecpyalloc(fromfile); + else { + fromname = ecpyalloc(directory); + fromname = ecatalloc(fromname, "/"); + fromname = ecatalloc(fromname, fromfile); + } + if (tofile[0] == '/') + toname = ecpyalloc(tofile); + else { + toname = ecpyalloc(directory); + toname = ecatalloc(toname, "/"); + toname = ecatalloc(toname, tofile); + } + /* + ** We get to be careful here since + ** there's a fair chance of root running us. + */ + if (!itsdir(toname)) + (void) remove(toname); + if (link(fromname, toname) != 0) { + if (mkdirs(toname) != 0) + (void) exit(EXIT_FAILURE); + if (link(fromname, toname) != 0) { + (void) fprintf(stderr, "%s: Can't link from %s to ", + progname, fromname); + (void) perror(toname); + (void) exit(EXIT_FAILURE); + } + } + ifree(fromname); + ifree(toname); +} + +static void +setboundaries P((void)) +{ + register time_t bit; + register int bii; + + for (bit = 1; bit > 0; bit <<= 1) + continue; + if (bit == 0) { /* time_t is an unsigned type */ + tt_signed = FALSE; + min_time = 0; + max_time = ~(time_t) 0; + if (sflag) + max_time >>= 1; + } else { + tt_signed = TRUE; + min_time = bit; + max_time = bit; + ++max_time; + max_time = -max_time; + if (sflag) + min_time = 0; + } + min_year = TM_YEAR_BASE + gmtime(&min_time)->tm_year; + max_year = TM_YEAR_BASE + gmtime(&max_time)->tm_year; + + for (bii = 1; bii > 0; bii <<= 1) + continue; + min_int = bii; + max_int = -1 - bii; +} + +static int +itsdir(name) +const char * const name; +{ + register char * myname; + register int accres; + + myname = ecpyalloc(name); + myname = ecatalloc(myname, "/."); + accres = access(myname, 0); + ifree(myname); + return accres == 0; +} + +/* +** Associate sets of rules with zones. +*/ + +/* +** Sort by rule name. +*/ + +static int +rcomp(cp1, cp2) +const genericptr_T cp1; +const genericptr_T cp2; +{ + return strcmp(((struct rule *) cp1)->r_name, + ((struct rule *) cp2)->r_name); +} + +static void +associate P((void)) +{ + register struct zone * zp; + register struct rule * rp; + register int base, out; + register int i; + + if (nrules != 0) + (void) qsort((genericptr_T) rules, + (qsort_size_T) nrules, + (qsort_size_T) sizeof *rules, rcomp); + for (i = 0; i < nzones; ++i) { + zp = &zones[i]; + zp->z_rules = NULL; + zp->z_nrules = 0; + } + for (base = 0; base < nrules; base = out) { + rp = &rules[base]; + for (out = base + 1; out < nrules; ++out) + if (strcmp(rp->r_name, rules[out].r_name) != 0) + break; + for (i = 0; i < nzones; ++i) { + zp = &zones[i]; + if (strcmp(zp->z_rule, rp->r_name) != 0) + continue; + zp->z_rules = rp; + zp->z_nrules = out - base; + } + } + for (i = 0; i < nzones; ++i) { + zp = &zones[i]; + if (zp->z_nrules == 0) { + /* + ** Maybe we have a local standard time offset. + */ + eat(zp->z_filename, zp->z_linenum); + zp->z_stdoff = gethms(zp->z_rule, "unruly zone", TRUE); + /* + ** Note, though, that if there's no rule, + ** a '%s' in the format is a bad thing. + */ + if (strchr(zp->z_format, '%') != 0) + error("%s in ruleless zone"); + } + } + if (errors) + (void) exit(EXIT_FAILURE); +} + +static void +infile(name) +const char * name; +{ + register FILE * fp; + register char ** fields; + register char * cp; + register const struct lookup * lp; + register int nfields; + register int wantcont; + register int num; + char buf[BUFSIZ]; + + if (strcmp(name, "-") == 0) { + name = "standard input"; + fp = stdin; + } else if ((fp = fopen(name, "r")) == NULL) { + (void) fprintf(stderr, "%s: Can't open ", progname); + (void) perror(name); + (void) exit(EXIT_FAILURE); + } + wantcont = FALSE; + for (num = 1; ; ++num) { + eat(name, num); + if (fgets(buf, (int) sizeof buf, fp) != buf) + break; + cp = strchr(buf, '\n'); + if (cp == NULL) { + error("line too long"); + (void) exit(EXIT_FAILURE); + } + *cp = '\0'; + fields = getfields(buf); + nfields = 0; + while (fields[nfields] != NULL) { + static char nada; + + if (ciequal(fields[nfields], "-")) + fields[nfields] = &nada; + ++nfields; + } + if (nfields == 0) { + /* nothing to do */ + } else if (wantcont) { + wantcont = inzcont(fields, nfields); + } else { + lp = byword(fields[0], line_codes); + if (lp == NULL) + error("input line of unknown type"); + else switch ((int) (lp->l_value)) { + case LC_RULE: + inrule(fields, nfields); + wantcont = FALSE; + break; + case LC_ZONE: + wantcont = inzone(fields, nfields); + break; + case LC_LINK: + inlink(fields, nfields); + wantcont = FALSE; + break; + case LC_LEAP: + if (name != leapsec) + (void) fprintf(stderr, +"%s: Leap line in non leap seconds file %s\n", + progname, name); + else inleap(fields, nfields); + wantcont = FALSE; + break; + default: /* "cannot happen" */ + (void) fprintf(stderr, +"%s: panic: Invalid l_value %d\n", + progname, lp->l_value); + (void) exit(EXIT_FAILURE); + } + } + ifree((char *) fields); + } + if (ferror(fp)) { + (void) fprintf(stderr, "%s: Error reading ", progname); + (void) perror(filename); + (void) exit(EXIT_FAILURE); + } + if (fp != stdin && fclose(fp)) { + (void) fprintf(stderr, "%s: Error closing ", progname); + (void) perror(filename); + (void) exit(EXIT_FAILURE); + } + if (wantcont) + error("expected continuation line not found"); +} + +/* +** Convert a string of one of the forms +** h -h hh:mm -hh:mm hh:mm:ss -hh:mm:ss +** into a number of seconds. +** A null string maps to zero. +** Call error with errstring and return zero on errors. +*/ + +static long +gethms(string, errstring, signable) +const char * string; +const char * const errstring; +const int signable; +{ + int hh, mm, ss, sign; + + if (string == NULL || *string == '\0') + return 0; + if (!signable) + sign = 1; + else if (*string == '-') { + sign = -1; + ++string; + } else sign = 1; + if (sscanf(string, scheck(string, "%d"), &hh) == 1) + mm = ss = 0; + else if (sscanf(string, scheck(string, "%d:%d"), &hh, &mm) == 2) + ss = 0; + else if (sscanf(string, scheck(string, "%d:%d:%d"), + &hh, &mm, &ss) != 3) { + error(errstring); + return 0; + } + if (hh < 0 || hh >= HOURSPERDAY || + mm < 0 || mm >= MINSPERHOUR || + ss < 0 || ss > SECSPERMIN) { + error(errstring); + return 0; + } + return eitol(sign) * + (eitol(hh * MINSPERHOUR + mm) * + eitol(SECSPERMIN) + eitol(ss)); +} + +static void +inrule(fields, nfields) +register char ** const fields; +const int nfields; +{ + static struct rule r; + + if (nfields != RULE_FIELDS) { + error("wrong number of fields on Rule line"); + return; + } + if (*fields[RF_NAME] == '\0') { + error("nameless rule"); + return; + } + r.r_filename = filename; + r.r_linenum = linenum; + r.r_stdoff = gethms(fields[RF_STDOFF], "invalid saved time", TRUE); + rulesub(&r, fields[RF_LOYEAR], fields[RF_HIYEAR], fields[RF_COMMAND], + fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]); + r.r_name = ecpyalloc(fields[RF_NAME]); + r.r_abbrvar = ecpyalloc(fields[RF_ABBRVAR]); + rules = (struct rule *) (void *) erealloc((char *) rules, + (int) ((nrules + 1) * sizeof *rules)); + rules[nrules++] = r; +} + +static int +inzone(fields, nfields) +register char ** const fields; +const int nfields; +{ + register int i; + static char * buf; + + if (nfields < ZONE_MINFIELDS || nfields > ZONE_MAXFIELDS) { + error("wrong number of fields on Zone line"); + return FALSE; + } + if (strcmp(fields[ZF_NAME], TZDEFAULT) == 0 && lcltime != NULL) { + buf = erealloc(buf, (int) (132 + strlen(TZDEFAULT))); + (void) sprintf(buf, +"\"Zone %s\" line and -l option are mutually exclusive", + TZDEFAULT); + error(buf); + return FALSE; + } + if (strcmp(fields[ZF_NAME], TZDEFRULES) == 0 && psxrules != NULL) { + buf = erealloc(buf, (int) (132 + strlen(TZDEFRULES))); + (void) sprintf(buf, +"\"Zone %s\" line and -p option are mutually exclusive", + TZDEFRULES); + error(buf); + return FALSE; + } + for (i = 0; i < nzones; ++i) + if (zones[i].z_name != NULL && + strcmp(zones[i].z_name, fields[ZF_NAME]) == 0) { + buf = erealloc(buf, (int) (132 + + strlen(fields[ZF_NAME]) + + strlen(zones[i].z_filename))); + (void) sprintf(buf, +"duplicate zone name %s (file \"%s\", line %d)", + fields[ZF_NAME], + zones[i].z_filename, + zones[i].z_linenum); + error(buf); + return FALSE; + } + return inzsub(fields, nfields, FALSE); +} + +static int +inzcont(fields, nfields) +register char ** const fields; +const int nfields; +{ + if (nfields < ZONEC_MINFIELDS || nfields > ZONEC_MAXFIELDS) { + error("wrong number of fields on Zone continuation line"); + return FALSE; + } + return inzsub(fields, nfields, TRUE); +} + +static int +inzsub(fields, nfields, iscont) +register char ** const fields; +const int nfields; +const int iscont; +{ + register char * cp; + static struct zone z; + register int i_gmtoff, i_rule, i_format; + register int i_untilyear, i_untilmonth; + register int i_untilday, i_untiltime; + register int hasuntil; + + if (iscont) { + i_gmtoff = ZFC_GMTOFF; + i_rule = ZFC_RULE; + i_format = ZFC_FORMAT; + i_untilyear = ZFC_TILYEAR; + i_untilmonth = ZFC_TILMONTH; + i_untilday = ZFC_TILDAY; + i_untiltime = ZFC_TILTIME; + z.z_name = NULL; + } else { + i_gmtoff = ZF_GMTOFF; + i_rule = ZF_RULE; + i_format = ZF_FORMAT; + i_untilyear = ZF_TILYEAR; + i_untilmonth = ZF_TILMONTH; + i_untilday = ZF_TILDAY; + i_untiltime = ZF_TILTIME; + z.z_name = ecpyalloc(fields[ZF_NAME]); + } + z.z_filename = filename; + z.z_linenum = linenum; + z.z_gmtoff = gethms(fields[i_gmtoff], "invalid GMT offset", TRUE); + if ((cp = strchr(fields[i_format], '%')) != 0) { + if (*++cp != 's' || strchr(cp, '%') != 0) { + error("invalid abbreviation format"); + return FALSE; + } + } + z.z_rule = ecpyalloc(fields[i_rule]); + z.z_format = ecpyalloc(fields[i_format]); + hasuntil = nfields > i_untilyear; + if (hasuntil) { + z.z_untilrule.r_filename = filename; + z.z_untilrule.r_linenum = linenum; + rulesub(&z.z_untilrule, + fields[i_untilyear], + "only", + "", + (nfields > i_untilmonth) ? + fields[i_untilmonth] : "Jan", + (nfields > i_untilday) ? fields[i_untilday] : "1", + (nfields > i_untiltime) ? fields[i_untiltime] : "0"); + z.z_untiltime = rpytime(&z.z_untilrule, + z.z_untilrule.r_loyear); + if (iscont && nzones > 0 && + z.z_untiltime > min_time && + z.z_untiltime < max_time && + zones[nzones - 1].z_untiltime > min_time && + zones[nzones - 1].z_untiltime < max_time && + zones[nzones - 1].z_untiltime >= z.z_untiltime) { +error("Zone continuation line end time is not after end time of previous line"); + return FALSE; + } + } + zones = (struct zone *) (void *) erealloc((char *) zones, + (int) ((nzones + 1) * sizeof *zones)); + zones[nzones++] = z; + /* + ** If there was an UNTIL field on this line, + ** there's more information about the zone on the next line. + */ + return hasuntil; +} + +static void +inleap(fields, nfields) +register char ** const fields; +const int nfields; +{ + register const char * cp; + register const struct lookup * lp; + register int i, j; + int year, month, day; + long dayoff, tod; + time_t t; + + if (nfields != LEAP_FIELDS) { + error("wrong number of fields on Leap line"); + return; + } + dayoff = 0; + cp = fields[LP_YEAR]; + if (sscanf(cp, scheck(cp, "%d"), &year) != 1) { + /* + * Leapin' Lizards! + */ + error("invalid leaping year"); + return; + } + j = EPOCH_YEAR; + while (j != year) { + if (year > j) { + i = len_years[isleap(j)]; + ++j; + } else { + --j; + i = -len_years[isleap(j)]; + } + dayoff = oadd(dayoff, eitol(i)); + } + if ((lp = byword(fields[LP_MONTH], mon_names)) == NULL) { + error("invalid month name"); + return; + } + month = lp->l_value; + j = TM_JANUARY; + while (j != month) { + i = len_months[isleap(year)][j]; + dayoff = oadd(dayoff, eitol(i)); + ++j; + } + cp = fields[LP_DAY]; + if (sscanf(cp, scheck(cp, "%d"), &day) != 1 || + day <= 0 || day > len_months[isleap(year)][month]) { + error("invalid day of month"); + return; + } + dayoff = oadd(dayoff, eitol(day - 1)); + if (dayoff < 0 && !tt_signed) { + error("time before zero"); + return; + } + t = (time_t) dayoff * SECSPERDAY; + /* + ** Cheap overflow check. + */ + if (t / SECSPERDAY != dayoff) { + error("time overflow"); + return; + } + tod = gethms(fields[LP_TIME], "invalid time of day", FALSE); + cp = fields[LP_CORR]; + { + register int positive; + int count; + + if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */ + positive = FALSE; + count = 1; + } else if (strcmp(cp, "--") == 0) { + positive = FALSE; + count = 2; + } else if (strcmp(cp, "+") == 0) { + positive = TRUE; + count = 1; + } else if (strcmp(cp, "++") == 0) { + positive = TRUE; + count = 2; + } else { + error("illegal CORRECTION field on Leap line"); + return; + } + if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) { + error("illegal Rolling/Stationary field on Leap line"); + return; + } + leapadd(tadd(t, tod), positive, lp->l_value, count); + } +} + +static void +inlink(fields, nfields) +register char ** const fields; +const int nfields; +{ + struct link l; + + if (nfields != LINK_FIELDS) { + error("wrong number of fields on Link line"); + return; + } + if (*fields[LF_FROM] == '\0') { + error("blank FROM field on Link line"); + return; + } + if (*fields[LF_TO] == '\0') { + error("blank TO field on Link line"); + return; + } + l.l_filename = filename; + l.l_linenum = linenum; + l.l_from = ecpyalloc(fields[LF_FROM]); + l.l_to = ecpyalloc(fields[LF_TO]); + links = (struct link *) (void *) erealloc((char *) links, + (int) ((nlinks + 1) * sizeof *links)); + links[nlinks++] = l; +} + +static void +rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep) +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; +{ + register const struct lookup * lp; + register const char * cp; + register char * dp; + register char * ep; + + if ((lp = byword(monthp, mon_names)) == NULL) { + error("invalid month name"); + return; + } + rp->r_month = lp->l_value; + rp->r_todisstd = FALSE; + rp->r_todisuniv = FALSE; + dp = ecpyalloc(timep); + if (*dp != '\0') { + ep = dp + strlen(dp) - 1; + switch (lowerit(*ep)) { + case 's': /* Standard */ + rp->r_todisstd = TRUE; + rp->r_todisuniv = FALSE; + *ep = '\0'; + break; + case 'w': /* Wall */ + rp->r_todisstd = FALSE; + rp->r_todisuniv = FALSE; + *ep = '\0'; + case 'g': /* Greenwich */ + case 'u': /* Universal */ + case 'z': /* Zulu */ + rp->r_todisstd = TRUE; + rp->r_todisuniv = TRUE; + *ep = '\0'; + break; + } + } + rp->r_tod = gethms(dp, "invalid time of day", FALSE); + ifree(dp); + /* + ** Year work. + */ + cp = loyearp; + if ((lp = byword(cp, begin_years)) != NULL) switch ((int) lp->l_value) { + case YR_MINIMUM: + rp->r_loyear = min_int; + break; + case YR_MAXIMUM: + rp->r_loyear = max_int; + break; + default: /* "cannot happen" */ + (void) fprintf(stderr, + "%s: panic: Invalid l_value %d\n", + progname, lp->l_value); + (void) exit(EXIT_FAILURE); + } else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) { + error("invalid starting year"); + return; + } + cp = hiyearp; + if ((lp = byword(cp, end_years)) != NULL) switch ((int) lp->l_value) { + case YR_MINIMUM: + rp->r_hiyear = min_int; + break; + case YR_MAXIMUM: + rp->r_hiyear = max_int; + break; + case YR_ONLY: + rp->r_hiyear = rp->r_loyear; + break; + default: /* "cannot happen" */ + (void) fprintf(stderr, + "%s: panic: Invalid l_value %d\n", + progname, lp->l_value); + (void) exit(EXIT_FAILURE); + } else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) { + error("invalid ending year"); + return; + } + if (rp->r_loyear > rp->r_hiyear) { + error("starting year greater than ending year"); + return; + } + if (*typep == '\0') + rp->r_yrtype = NULL; + else { + if (rp->r_loyear == rp->r_hiyear) { + error("typed single year"); + return; + } + rp->r_yrtype = ecpyalloc(typep); + } + /* + ** Day work. + ** Accept things such as: + ** 1 + ** last-Sunday + ** Sun<=20 + ** Sun>=7 + */ + dp = ecpyalloc(dayp); + if ((lp = byword(dp, lasts)) != NULL) { + rp->r_dycode = DC_DOWLEQ; + rp->r_wday = lp->l_value; + rp->r_dayofmonth = len_months[1][rp->r_month]; + } else { + if ((ep = strchr(dp, '<')) != 0) + rp->r_dycode = DC_DOWLEQ; + else if ((ep = strchr(dp, '>')) != 0) + rp->r_dycode = DC_DOWGEQ; + else { + ep = dp; + rp->r_dycode = DC_DOM; + } + if (rp->r_dycode != DC_DOM) { + *ep++ = 0; + if (*ep++ != '=') { + error("invalid day of month"); + ifree(dp); + return; + } + if ((lp = byword(dp, wday_names)) == NULL) { + error("invalid weekday name"); + ifree(dp); + return; + } + rp->r_wday = lp->l_value; + } + if (sscanf(ep, scheck(ep, "%d"), &rp->r_dayofmonth) != 1 || + rp->r_dayofmonth <= 0 || + (rp->r_dayofmonth > len_months[1][rp->r_month])) { + error("invalid day of month"); + ifree(dp); + return; + } + } + ifree(dp); +} + +static void +convert(val, buf) +const long val; +char * const buf; +{ + register int i; + register long shift; + + for (i = 0, shift = 24; i < 4; ++i, shift -= 8) + buf[i] = val >> shift; +} + +static void +puttzcode(val, fp) +const long val; +FILE * const fp; +{ + char buf[4]; + + convert(val, buf); + (void) fwrite((genericptr_T) buf, + (fwrite_size_T) sizeof buf, + (fwrite_size_T) 1, fp); +} + +static void +writezone(name) +const char * const name; +{ + register FILE * fp; + register int i, j; + static char * fullname; + static struct tzhead tzh; + + fullname = erealloc(fullname, + (int) (strlen(directory) + 1 + strlen(name) + 1)); + (void) sprintf(fullname, "%s/%s", directory, name); + if ((fp = fopen(fullname, "wb")) == NULL) { + if (mkdirs(fullname) != 0) + (void) exit(EXIT_FAILURE); + if ((fp = fopen(fullname, "wb")) == NULL) { + (void) fprintf(stderr, "%s: Can't create ", progname); + (void) perror(fullname); + (void) exit(EXIT_FAILURE); + } + } + convert(eitol(typecnt), tzh.tzh_ttisstdcnt); + convert(eitol(leapcnt), tzh.tzh_leapcnt); + convert(eitol(timecnt), tzh.tzh_timecnt); + convert(eitol(typecnt), tzh.tzh_typecnt); + convert(eitol(charcnt), tzh.tzh_charcnt); + (void) fwrite((genericptr_T) &tzh, + (fwrite_size_T) sizeof tzh, + (fwrite_size_T) 1, fp); + for (i = 0; i < timecnt; ++i) { + j = leapcnt; + while (--j >= 0) + if (ats[i] >= trans[j]) { + ats[i] = tadd(ats[i], corr[j]); + break; + } + puttzcode((long) ats[i], fp); + } + if (timecnt > 0) + (void) fwrite((genericptr_T) types, + (fwrite_size_T) sizeof types[0], + (fwrite_size_T) timecnt, fp); + for (i = 0; i < typecnt; ++i) { + puttzcode((long) gmtoffs[i], fp); + (void) putc(isdsts[i], fp); + (void) putc(abbrinds[i], fp); + } + if (charcnt != 0) + (void) fwrite((genericptr_T) chars, + (fwrite_size_T) sizeof chars[0], + (fwrite_size_T) charcnt, fp); + for (i = 0; i < leapcnt; ++i) { + if (roll[i]) { + if (timecnt == 0 || trans[i] < ats[0]) { + j = 0; + while (isdsts[j]) + if (++j >= typecnt) { + j = 0; + break; + } + } else { + j = 1; + while (j < timecnt && trans[i] >= ats[j]) + ++j; + j = types[j - 1]; + } + puttzcode((long) tadd(trans[i], -gmtoffs[j]), fp); + } else puttzcode((long) trans[i], fp); + puttzcode((long) corr[i], fp); + } + for (i = 0; i < typecnt; ++i) + (void) putc(ttisstds[i], fp); + if (ferror(fp) || fclose(fp)) { + (void) fprintf(stderr, "%s: Write error on ", progname); + (void) perror(fullname); + (void) exit(EXIT_FAILURE); + } +} + +static void +outzone(zpfirst, zonecount) +const struct zone * const zpfirst; +const int zonecount; +{ + register const struct zone * zp; + register struct rule * rp; + register int i, j; + register int usestart, useuntil; + register time_t starttime, untiltime; + register long gmtoff; + register long stdoff; + register int year; + register long startoff; + register int startisdst; + register int startttisstd; + register int type; + char startbuf[BUFSIZ]; + + INITIALIZE(untiltime); + INITIALIZE(starttime); + INITIALIZE(startoff); + /* + ** Now. . .finally. . .generate some useful data! + */ + timecnt = 0; + typecnt = 0; + charcnt = 0; + /* + ** A guess that may well be corrected later. + */ + stdoff = 0; + /* + ** Thanks to Earl Chew (earl@dnd.icp.nec.com.au) + ** for noting the need to unconditionally initialize startttisstd. + */ + startttisstd = FALSE; +#ifdef lint + starttime = 0; +#endif /* defined lint */ + for (i = 0; i < zonecount; ++i) { + zp = &zpfirst[i]; + usestart = i > 0 && (zp - 1)->z_untiltime > min_time; + useuntil = i < (zonecount - 1); + if (useuntil && zp->z_untiltime <= min_time) + continue; + gmtoff = zp->z_gmtoff; + eat(zp->z_filename, zp->z_linenum); + startisdst = -1; + if (zp->z_nrules == 0) { + stdoff = zp->z_stdoff; + (void) strcpy(startbuf, zp->z_format); + type = addtype(oadd(zp->z_gmtoff, stdoff), + startbuf, stdoff != 0, startttisstd); + if (usestart) + addtt(starttime, type); + else if (stdoff != 0) + addtt(min_time, type); + } else for (year = min_year; year <= max_year; ++year) { + if (useuntil && year > zp->z_untilrule.r_hiyear) + break; + /* + ** Mark which rules to do in the current year. + ** For those to do, calculate rpytime(rp, year); + */ + for (j = 0; j < zp->z_nrules; ++j) { + rp = &zp->z_rules[j]; + eats(zp->z_filename, zp->z_linenum, + rp->r_filename, rp->r_linenum); + rp->r_todo = year >= rp->r_loyear && + year <= rp->r_hiyear && + yearistype(year, rp->r_yrtype); + if (rp->r_todo) + rp->r_temp = rpytime(rp, year); + } + for ( ; ; ) { + register int k; + register time_t jtime, ktime; + register long offset; + char buf[BUFSIZ]; + + INITIALIZE(ktime); + if (useuntil) { + /* + ** Turn untiltime into GMT + ** assuming the current gmtoff and + ** stdoff values. + */ + untiltime = zp->z_untiltime; + if (!zp->z_untilrule.r_todisuniv) + untiltime = tadd(untiltime, + -gmtoff); + if (!zp->z_untilrule.r_todisstd) + untiltime = tadd(untiltime, + -stdoff); + } + /* + ** Find the rule (of those to do, if any) + ** that takes effect earliest in the year. + */ + k = -1; +#ifdef lint + ktime = 0; +#endif /* defined lint */ + for (j = 0; j < zp->z_nrules; ++j) { + rp = &zp->z_rules[j]; + if (!rp->r_todo) + continue; + eats(zp->z_filename, zp->z_linenum, + rp->r_filename, rp->r_linenum); + offset = rp->r_todisuniv ? 0 : gmtoff; + if (!rp->r_todisstd) + offset = oadd(offset, stdoff); + jtime = rp->r_temp; + if (jtime == min_time || + jtime == max_time) + continue; + jtime = tadd(jtime, -offset); + if (k < 0 || jtime < ktime) { + k = j; + ktime = jtime; + } + } + if (k < 0) + break; /* go on to next year */ + rp = &zp->z_rules[k]; + rp->r_todo = FALSE; + if (useuntil && ktime >= untiltime) + break; + if (usestart) { + if (ktime < starttime) { + stdoff = rp->r_stdoff; + startoff = oadd(zp->z_gmtoff, + rp->r_stdoff); + (void) sprintf(startbuf, zp->z_format, + rp->r_abbrvar); + startisdst = rp->r_stdoff != 0; + continue; + } + usestart = FALSE; + if (ktime != starttime) { + if (startisdst < 0 && + zp->z_gmtoff != + (zp - 1)->z_gmtoff) { + type = (timecnt == 0) ? 0 : + types[timecnt - 1]; + startoff = oadd(gmtoffs[type], + -(zp - 1)->z_gmtoff); + startisdst = startoff != 0; + startoff = oadd(startoff, + zp->z_gmtoff); + (void) strcpy(startbuf, + &chars[abbrinds[type]]); + } + if (startisdst >= 0) +addtt(starttime, addtype(startoff, startbuf, startisdst, startttisstd)); + } + } + eats(zp->z_filename, zp->z_linenum, + rp->r_filename, rp->r_linenum); + (void) sprintf(buf, zp->z_format, + rp->r_abbrvar); + offset = oadd(zp->z_gmtoff, rp->r_stdoff); + type = addtype(offset, buf, rp->r_stdoff != 0, + rp->r_todisstd); + addtt(ktime, type); + stdoff = rp->r_stdoff; + } + } + /* + ** Now we may get to set starttime for the next zone line. + */ + if (useuntil) { + starttime = tadd(zp->z_untiltime, -gmtoff); + startttisstd = zp->z_untilrule.r_todisstd; + if (!startttisstd) + starttime = tadd(starttime, -stdoff); + } + } + writezone(zpfirst->z_name); +} + +static void +addtt(starttime, type) +const time_t starttime; +const int type; +{ + if (timecnt != 0 && type == types[timecnt - 1]) + return; /* easy enough! */ + if (timecnt == 0 && type == 0 && isdsts[0] == 0) + return; /* handled by default rule */ + if (timecnt >= TZ_MAX_TIMES) { + error("too many transitions?!"); + (void) exit(EXIT_FAILURE); + } + ats[timecnt] = starttime; + types[timecnt] = type; + ++timecnt; +} + +static int +addtype(gmtoff, abbr, isdst, ttisstd) +const long gmtoff; +const char * const abbr; +const int isdst; +const int ttisstd; +{ + register int i, j; + + /* + ** See if there's already an entry for this zone type. + ** If so, just return its index. + */ + for (i = 0; i < typecnt; ++i) { + if (gmtoff == gmtoffs[i] && isdst == isdsts[i] && + strcmp(abbr, &chars[abbrinds[i]]) == 0 && + ttisstd == ttisstds[i]) + return i; + } + /* + ** There isn't one; add a new one, unless there are already too + ** many. + */ + if (typecnt >= TZ_MAX_TYPES) { + error("too many local time types"); + (void) exit(EXIT_FAILURE); + } + gmtoffs[i] = gmtoff; + isdsts[i] = isdst; + ttisstds[i] = ttisstd; + + for (j = 0; j < charcnt; ++j) + if (strcmp(&chars[j], abbr) == 0) + break; + if (j == charcnt) + newabbr(abbr); + abbrinds[i] = j; + ++typecnt; + return i; +} + +static void +leapadd(t, positive, rolling, count) +const time_t t; +const int positive; +const int rolling; +int count; +{ + register int i, j; + + if (leapcnt + (positive ? count : 1) > TZ_MAX_LEAPS) { + error("too many leap seconds"); + (void) exit(EXIT_FAILURE); + } + for (i = 0; i < leapcnt; ++i) + if (t <= trans[i]) { + if (t == trans[i]) { + error("repeated leap second moment"); + (void) exit(EXIT_FAILURE); + } + break; + } + do { + for (j = leapcnt; j > i; --j) { + trans[j] = trans[j - 1]; + corr[j] = corr[j - 1]; + roll[j] = roll[j - 1]; + } + trans[i] = t; + corr[i] = positive ? 1L : eitol(-count); + roll[i] = rolling; + ++leapcnt; + } while (positive && --count != 0); +} + +static void +adjleap P((void)) +{ + register int i; + register long last = 0; + + /* + ** propagate leap seconds forward + */ + for (i = 0; i < leapcnt; ++i) { + trans[i] = tadd(trans[i], last); + last = corr[i] += last; + } +} + +static int +yearistype(year, type) +const int year; +const char * const type; +{ + static char * buf; + int result; + + if (type == NULL || *type == '\0') + return TRUE; + buf = erealloc(buf, (int) (132 + strlen(yitcommand) + strlen(type))); + (void) sprintf(buf, "%s %d %s", yitcommand, year, type); + result = system(buf); + if (result == 0) + return TRUE; + if (result == (1 << 8)) + return FALSE; + error("Wild result from command execution"); + (void) fprintf(stderr, "%s: command was '%s', result was %d\n", + progname, buf, result); + for ( ; ; ) + (void) exit(EXIT_FAILURE); +} + +static int +lowerit(a) +const int a; +{ + return (isascii(a) && isupper(a)) ? tolower(a) : a; +} + +static int +ciequal(ap, bp) /* case-insensitive equality */ +register const char * ap; +register const char * bp; +{ + while (lowerit(*ap) == lowerit(*bp++)) + if (*ap++ == '\0') + return TRUE; + return FALSE; +} + +static int +itsabbr(abbr, word) +register const char * abbr; +register const char * word; +{ + if (lowerit(*abbr) != lowerit(*word)) + return FALSE; + ++word; + while (*++abbr != '\0') + do if (*word == '\0') + return FALSE; + while (lowerit(*word++) != lowerit(*abbr)); + return TRUE; +} + +static const struct lookup * +byword(word, table) +register const char * const word; +register const struct lookup * const table; +{ + register const struct lookup * foundlp; + register const struct lookup * lp; + + if (word == NULL || table == NULL) + return NULL; + /* + ** Look for exact match. + */ + for (lp = table; lp->l_word != NULL; ++lp) + if (ciequal(word, lp->l_word)) + return lp; + /* + ** Look for inexact match. + */ + foundlp = NULL; + for (lp = table; lp->l_word != NULL; ++lp) + if (itsabbr(word, lp->l_word)) + if (foundlp == NULL) + foundlp = lp; + else return NULL; /* multiple inexact matches */ + return foundlp; +} + +static char ** +getfields(cp) +register char * cp; +{ + register char * dp; + register char ** array; + register int nsubs; + + if (cp == NULL) + return NULL; + array = (char **) (void *) + emalloc((int) ((strlen(cp) + 1) * sizeof *array)); + nsubs = 0; + for ( ; ; ) { + while (isascii(*cp) && isspace(*cp)) + ++cp; + if (*cp == '\0' || *cp == '#') + break; + array[nsubs++] = dp = cp; + do { + if ((*dp = *cp++) != '"') + ++dp; + else while ((*dp = *cp++) != '"') + if (*dp != '\0') + ++dp; + else error("Odd number of quotation marks"); + } while (*cp != '\0' && *cp != '#' && + (!isascii(*cp) || !isspace(*cp))); + if (isascii(*cp) && isspace(*cp)) + ++cp; + *dp = '\0'; + } + array[nsubs] = NULL; + return array; +} + +static long +oadd(t1, t2) +const long t1; +const long t2; +{ + register long t; + + t = t1 + t2; + if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) { + error("time overflow"); + (void) exit(EXIT_FAILURE); + } + return t; +} + +static time_t +tadd(t1, t2) +const time_t t1; +const long t2; +{ + register time_t t; + + if (t1 == max_time && t2 > 0) + return max_time; + if (t1 == min_time && t2 < 0) + return min_time; + t = t1 + t2; + if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) { + error("time overflow"); + (void) exit(EXIT_FAILURE); + } + return t; +} + +/* +** Given a rule, and a year, compute the date - in seconds since January 1, +** 1970, 00:00 LOCAL time - in that year that the rule refers to. +*/ + +static time_t +rpytime(rp, wantedy) +register const struct rule * const rp; +register const int wantedy; +{ + register int y, m, i; + register long dayoff; /* with a nod to Margaret O. */ + register time_t t; + + if (wantedy == min_int) + return min_time; + if (wantedy == max_int) + return max_time; + dayoff = 0; + m = TM_JANUARY; + y = EPOCH_YEAR; + while (wantedy != y) { + if (wantedy > y) { + i = len_years[isleap(y)]; + ++y; + } else { + --y; + i = -len_years[isleap(y)]; + } + dayoff = oadd(dayoff, eitol(i)); + } + while (m != rp->r_month) { + i = len_months[isleap(y)][m]; + dayoff = oadd(dayoff, eitol(i)); + ++m; + } + i = rp->r_dayofmonth; + if (m == TM_FEBRUARY && i == 29 && !isleap(y)) { + if (rp->r_dycode == DC_DOWLEQ) + --i; + else { + error("use of 2/29 in non leap-year"); + (void) exit(EXIT_FAILURE); + } + } + --i; + dayoff = oadd(dayoff, eitol(i)); + if (rp->r_dycode == DC_DOWGEQ || rp->r_dycode == DC_DOWLEQ) { + register long wday; + +#define LDAYSPERWEEK ((long) DAYSPERWEEK) + wday = eitol(EPOCH_WDAY); + /* + ** Don't trust mod of negative numbers. + */ + if (dayoff >= 0) + wday = (wday + dayoff) % LDAYSPERWEEK; + else { + wday -= ((-dayoff) % LDAYSPERWEEK); + if (wday < 0) + wday += LDAYSPERWEEK; + } + while (wday != eitol(rp->r_wday)) + if (rp->r_dycode == DC_DOWGEQ) { + dayoff = oadd(dayoff, (long) 1); + if (++wday >= LDAYSPERWEEK) + wday = 0; + ++i; + } else { + dayoff = oadd(dayoff, (long) -1); + if (--wday < 0) + wday = LDAYSPERWEEK - 1; + --i; + } + if (i < 0 || i >= len_months[isleap(y)][m]) { + error("no day in month matches rule"); + (void) exit(EXIT_FAILURE); + } + } + if (dayoff < 0 && !tt_signed) + return min_time; + t = (time_t) dayoff * SECSPERDAY; + /* + ** Cheap overflow check. + */ + if (t / SECSPERDAY != dayoff) + return (dayoff > 0) ? max_time : min_time; + return tadd(t, rp->r_tod); +} + +static void +newabbr(string) +const char * const string; +{ + register int i; + + i = strlen(string) + 1; + if (charcnt + i > TZ_MAX_CHARS) { + error("too many, or too long, time zone abbreviations"); + (void) exit(EXIT_FAILURE); + } + (void) strcpy(&chars[charcnt], string); + charcnt += eitol(i); +} + +static int +mkdirs(argname) +char * const argname; +{ + register char * name; + register char * cp; + + if (argname == NULL || *argname == '\0') + return 0; + cp = name = ecpyalloc(argname); + while ((cp = strchr(cp + 1, '/')) != 0) { + *cp = '\0'; +#ifndef unix + /* + ** MS-DOS drive specifier? + */ + if (strlen(name) == 2 && isascii(name[0]) && + isalpha(name[0]) && name[1] == ':') { + *cp = '/'; + continue; + } +#endif /* !defined unix */ + if (!itsdir(name)) { + /* + ** It doesn't seem to exist, so we try to create it. + */ + if (emkdir(name, 0755) != 0) { + (void) fprintf(stderr, + "%s: Can't create directory ", + progname); + (void) perror(name); + ifree(name); + return -1; + } + } + *cp = '/'; + } + ifree(name); + return 0; +} + +static long +eitol(i) +const int i; +{ + long l; + + l = i; + if ((i < 0 && l >= 0) || (i == 0 && l != 0) || (i > 0 && l <= 0)) { + (void) fprintf(stderr, + "%s: %d did not sign extend correctly\n", + progname, i); + (void) exit(EXIT_FAILURE); + } + return l; +} + +/* +** UNIX was a registered trademark of UNIX System Laboratories in 1993. +*/ |