From d79de7ff7570de640252ff3ab8ae7105f99e6475 Mon Sep 17 00:00:00 2001
From: millert
Date: Thu, 4 Apr 2002 19:12:08 +0000
Subject: Minor updates from tzcode2002c
---
lib/libc/time/README | 22 ++-
lib/libc/time/Theory | 50 ++++--
lib/libc/time/difftime.c | 18 ++-
lib/libc/time/localtime.c | 18 ++-
lib/libc/time/private.h | 18 +--
lib/libc/time/strftime.c | 16 +-
lib/libc/time/tz-art.htm | 396 +++++++++++++++++++++++++---------------------
lib/libc/time/tz-link.htm | 230 +++++++++++++++++++--------
lib/libc/time/zic.c | 29 ++--
9 files changed, 481 insertions(+), 316 deletions(-)
(limited to 'lib/libc/time')
diff --git a/lib/libc/time/README b/lib/libc/time/README
index 80276794113..c143c778e96 100644
--- a/lib/libc/time/README
+++ b/lib/libc/time/README
@@ -1,5 +1,5 @@
-$OpenBSD: README,v 1.3 1998/01/18 23:24:46 millert Exp $
-@(#)README 7.10
+$OpenBSD: README,v 1.4 2002/04/04 19:12:08 millert Exp $
+@(#)README 7.11
"What time is it?" -- Richard Deacon as The King
"Any time you want it to be." -- Frank Baxter as The Scientist
@@ -34,8 +34,22 @@ Since POSIX frowns on correct leap second handling, the default behavior of
the "zic" command (in the absence of a "-L" option) has been changed to omit
leap second information from its output files.
-Be sure to read the comments in "Makefile" and make any changes
-needed to make things right for your system.
+Here is a recipe for acquiring, building, installing, and testing the
+tz distribution on a GNU/Linux or similar host.
+
+ mkdir tz
+ cd tz
+ wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
+ gzip -dc tzcode*.tar.gz | tar -xf -
+ gzip -dc tzdata*.tar.gz | tar -xf -
+
+Be sure to read the comments in "Makefile" and make any changes needed
+to make things right for your system, especially if you are using some
+platform other than GNU/Linux. Then run the following commands,
+substituting your desired installation directory for "$HOME/tzdir":
+
+ make TOPDIR=$HOME/tzdir install
+ $HOME/tzdir/etc/zdump -v America/Los_Angeles
To use the new functions, use a "-ltz" option when compiling or linking.
diff --git a/lib/libc/time/Theory b/lib/libc/time/Theory
index 438845f2538..771ad484cff 100644
--- a/lib/libc/time/Theory
+++ b/lib/libc/time/Theory
@@ -1,4 +1,5 @@
-@(#)Theory 7.12
+$OpenBSD: Theory,v 1.8 2002/04/04 19:12:09 millert Exp $
+@(#)Theory 7.13
----- Outline -----
@@ -35,7 +36,7 @@ POSIX.1 has the following properties and limitations.
stdoffset[dst[offset],date[/time],date[/time]]
where:
-
+
std and dst
are 3 or more characters specifying the standard
and daylight saving time (DST) zone names.
@@ -179,11 +180,34 @@ so much the better.
----- Names of time zone rule files -----
-The names of this package's installed time zone rule files are chosen to
-help minimize possible future incompatibilities due to political events.
-Ordinarily, names of countries are not used, to avoid incompatibilities
-when countries change their name (e.g. Zaire->Congo) or
-when locations change countries (e.g. Hong Kong from UK colony to China).
+The time zone rule file naming conventions attempt to strike a balance
+among the following goals:
+
+ * Uniquely identify every national region where clocks have all
+ agreed since 1970. This is essential for the intended use: static
+ clocks keeping local civil time.
+
+ * Indicate to humans as to where that region is. This simplifes use.
+
+ * Be robust in the presence of political changes. This reduces the
+ number of updates and backward-compatibility hacks. For example,
+ names of countries are ordinarily not used, to avoid
+ incompatibilities when countries change their name
+ (e.g. Zaire->Congo) or when locations change countries
+ (e.g. Hong Kong from UK colony to China).
+
+ * Be portable to a wide variety of implementations.
+ This promotes use of the technology.
+
+ * Use a consistent naming convention over the entire world.
+ This simplifies both use and maintenance.
+
+This naming convention is not intended for use by inexperienced users
+to select TZ values by themselves (though they can of course examine
+and reuse existing settings). Distributors should provide
+documentation and/or a simple selection interface that explains the
+names; see the 'tzselect' program supplied with this distribution for
+one example.
Names normally have the form AREA/LOCATION, where AREA is the name
of a continent or ocean, and LOCATION is the name of a specific
@@ -272,7 +296,7 @@ in decreasing order of importance:
requires at least three characters for an
abbreviation. POSIX.1-1996 says that an abbreviation
cannot start with ':', and cannot contain ',', '-',
- '+', NUL, or a digit. Draft 5 of POSIX 1003.1-200x
+ '+', NUL, or a digit. Draft 7 of POSIX 1003.1-200x
changes this rule to say that an abbreviation can
contain only '-', '+', and alphanumeric characters in
the current locale. To be portable to both sets of
@@ -397,8 +421,8 @@ Newsgroups: soc.genealogy.german
Date: Tue, 9 Feb 1999 02:32:48 -800
Message-ID: <199902091032.CAA09644@netcom10.netcom.com>
-The following is a(n incomplete) listing, arranged chronologically, of
-European states, with the date they converted from the Julian to the
+The following is a(n incomplete) listing, arranged chronologically, of
+European states, with the date they converted from the Julian to the
Gregorian calendar:
04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
@@ -475,9 +499,9 @@ Gregorian calendar:
1760-1812 - Graub"unden
-The Russian empire (including Finland and the Baltic states) did not
+The Russian empire (including Finland and the Baltic states) did not
convert to the Gregorian calendar until the Soviet revolution of 1917.
-Source: H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
-Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
+Source: H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
+Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
(Hannover: Hahnsche Buchhandlung, 1941), pp. 26-28.
diff --git a/lib/libc/time/difftime.c b/lib/libc/time/difftime.c
index f5e0c9c6bea..d5fa21fec35 100644
--- a/lib/libc/time/difftime.c
+++ b/lib/libc/time/difftime.c
@@ -4,8 +4,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
-static char elsieid[] = "@(#)difftime.c 7.7";
-static char rcsid[] = "$OpenBSD: difftime.c,v 1.5 1998/01/18 23:24:51 millert Exp $";
+static char elsieid[] = "@(#)difftime.c 7.9";
+static char rcsid[] = "$OpenBSD: difftime.c,v 1.6 2002/04/04 19:12:09 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*LINTLIBRARY*/
@@ -31,10 +31,16 @@ const time_t time0;
time_t delta;
time_t 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;
+ {
+ time_t tt;
+ double d;
+ long_double ld;
+
+ if (sizeof tt < sizeof d)
+ return (double) time1 - (double) time0;
+ if (sizeof tt < sizeof ld)
+ return (long_double) time1 - (long_double) time0;
+ }
if (time1 < time0)
return -difftime(time0, time1);
/*
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 106103ad80c..88821b7d954 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -4,8 +4,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
-static char elsieid[] = "@(#)localtime.c 7.70";
-static char rcsid[] = "$OpenBSD: localtime.c,v 1.20 2001/06/27 00:58:57 lebel Exp $";
+static char elsieid[] = "@(#)localtime.c 7.75";
+static char rcsid[] = "$OpenBSD: localtime.c,v 1.21 2002/04/04 19:12:09 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -320,8 +320,8 @@ register struct state * const sp;
{
struct tzhead * tzhp;
union {
- struct tzhead tzhead;
- char buf[sizeof *sp + sizeof *tzhp];
+ struct tzhead tzhead;
+ char buf[sizeof *sp + sizeof *tzhp];
} u;
int ttisstdcnt;
int ttisgmtcnt;
@@ -968,9 +968,9 @@ tzset_basic P((void))
return;
}
- if (lcl_is_set > 0 && strcmp(lcl_TZname, name) == 0)
+ if (lcl_is_set > 0 && strcmp(lcl_TZname, name) == 0)
return;
- lcl_is_set = (strlen(name) < sizeof(lcl_TZname));
+ lcl_is_set = strlen(name) < sizeof lcl_TZname;
if (lcl_is_set)
(void) strcpy(lcl_TZname, name);
@@ -989,6 +989,8 @@ tzset_basic P((void))
*/
lclptr->leapcnt = 0; /* so, we're off a little */
lclptr->timecnt = 0;
+ lclptr->typecnt = 0;
+ lclptr->ttis[0].tt_isdst = 0;
lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0;
(void) strcpy(lclptr->chars, gmt);
@@ -1409,7 +1411,9 @@ const int do_norm_secs;
}
if (increment_overflow(&yourtm.tm_year, -TM_YEAR_BASE))
return WRONG;
- if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) {
+ if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN)
+ saved_seconds = 0;
+ else if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) {
/*
** We can't set tm_sec to 0, because that might push the
** time below the minimum representable time.
diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h
index 7fa953fd133..5d402fde11d 100644
--- a/lib/libc/time/private.h
+++ b/lib/libc/time/private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: private.h,v 1.13 2000/09/06 23:05:11 millert Exp $ */
+/* $OpenBSD: private.h,v 1.14 2002/04/04 19:12:09 millert Exp $ */
#ifndef PRIVATE_H
#define PRIVATE_H
@@ -33,7 +33,7 @@
#if 0
#ifndef lint
#ifndef NOID
-static char privatehid[] = "@(#)private.h 7.51";
+static char privatehid[] = "@(#)private.h 7.52";
#endif /* !defined NOID */
#endif /* !defined lint */
#endif
@@ -67,6 +67,10 @@ static char privatehid[] = "@(#)private.h 7.51";
#define HAVE_SYMLINK 1
#endif /* !defined HAVE_SYMLINK */
+#ifndef HAVE_SYS_STAT_H
+#define HAVE_SYS_STAT_H 1
+#endif /* !defined HAVE_SYS_STAT_H */
+
#ifndef HAVE_SYS_WAIT_H
#define HAVE_SYS_WAIT_H 1
#endif /* !defined HAVE_SYS_WAIT_H */
@@ -137,16 +141,6 @@ static char privatehid[] = "@(#)private.h 7.51";
** Workarounds for compilers/systems.
*/
-/*
-** SunOS 4.1.1 cc lacks const.
-*/
-
-#ifndef const
-#ifndef __STDC__
-#define const
-#endif /* !defined __STDC__ */
-#endif /* !defined const */
-
/*
** SunOS 4.1.1 cc lacks prototypes.
*/
diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c
index 54270afa5d7..3c2b8e3177c 100644
--- a/lib/libc/time/strftime.c
+++ b/lib/libc/time/strftime.c
@@ -1,6 +1,6 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
-static char elsieid[] = "@(#)strftime.c 7.62";
-static char *rcsid = "$OpenBSD: strftime.c,v 1.7 2000/09/06 23:05:11 millert Exp $";
+static char elsieid[] = "@(#)strftime.c 7.64";
+static char *rcsid = "$OpenBSD: strftime.c,v 1.8 2002/04/04 19:12:09 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include "private.h"
@@ -534,7 +534,7 @@ label:
if (t->tm_isdst == 0)
#ifdef USG_COMPAT
diff = -timezone;
-#else /* defined USG_COMPAT */
+#else /* !defined USG_COMPAT */
continue;
#endif /* !defined USG_COMPAT */
else
@@ -606,7 +606,6 @@ _loc P((void))
static const char locale_home[] = LOCALE_HOME;
static const char lc_time[] = "LC_TIME";
static char * locale_buf;
- static char locale_buf_C[] = "C";
int fd;
int oldsun; /* "...ain't got nothin' to do..." */
@@ -645,8 +644,8 @@ _loc P((void))
** Slurp the locale file into the cache.
*/
namesize = strlen(name) + 1;
- if (sizeof(filename) <
- sizeof(locale_home) + namesize + sizeof(lc_time))
+ if (sizeof filename <
+ ((sizeof locale_home) + namesize + (sizeof lc_time)))
goto no_locale;
oldsun = 0;
(void) sprintf(filename, "%s/%s/%s", locale_home, name, lc_time);
@@ -668,8 +667,7 @@ _loc P((void))
goto bad_locale;
bufsize = namesize + st.st_size;
locale_buf = NULL;
- nlbuf = (lbuf == NULL || lbuf == locale_buf_C) ?
- malloc(bufsize) : realloc(lbuf, bufsize);
+ nlbuf = (lbuf == NULL) ? malloc(bufsize) : realloc(lbuf, bufsize);
if (nlbuf == NULL) {
if (lbuf)
free(lbuf);
@@ -723,7 +721,7 @@ bad_locale:
(void) close(fd);
no_locale:
localebuf = C_time_locale;
- locale_buf = locale_buf_C;
+ locale_buf = NULL;
return &localebuf;
}
#endif /* defined LOCALE_HOME */
diff --git a/lib/libc/time/tz-art.htm b/lib/libc/time/tz-art.htm
index 8a591323cf7..008b2dda864 100644
--- a/lib/libc/time/tz-art.htm
+++ b/lib/libc/time/tz-art.htm
@@ -1,8 +1,8 @@
-
+PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"DTD/xhtml1-strict.dtd">
+
@@ -11,215 +11,243 @@
-"Is that a pertinent fact, or are you trying to dazzle me with your command
-of time zones?"
- "Frasier Crane"
-==========================================================================
-Data on recordings of "Save That Time," Russ Long, Serrob Publishing, BMI:
---------------------------------------------------------------------------
-Artist: Karrin Allyson
-CD: I Didn't Know About You
-Copyright Date: 1993
-Label: Concord Jazz, Inc.
-ID: CCD-4543
-Track Time: 3:44
-Personnel: Karrin Allyson, vocal
- Russ Long, piano
- Gerald Spaits, bass
- Todd Strait, drums
-Notes: CD notes "additional lyric by Karrin Allyson;
- arranged by Russ Long and Karrin Allyson"
-ADO Rating: 1 star
-AMG Rating: 4 stars
-Penguin Rating: 3.5 stars
---------------------------------------------------------------------------
-Artist: Kevin Mahogany
-CD: Double Rainbow
-Copyright Date: 1993
-Label: Enja Records
-ID: ENJ-7097 2
-Track Time: 6:27
-Personnel: Kevin Mahogany, vocal
- Kenny Barron, piano
- Ray Drummond, bss
- Ralph Moore, tenor saxophone
- Lewis Nash, drums
-ADO Rating: 1.5 stars
-AMG Rating: 3 stars
-Penguin Rating: 3 stars
---------------------------------------------------------------------------
-Artist: Joe Williams
-CD: Here's to Life
-Copyright Date: 1994
-Label: Telarc International Corporation
-ID: CD-83357
-Track Time: 3:58
-Personnel: Joe Williams, vocal
- The Robert Farnon [39 piece] Orchestra
-Notes: This CD is also available as part of a 3-CD package from
- Telarc, "Triple Play" (CD-83461)
-ADO Rating: black dot
-AMG Rating: 2 stars
-Penguin Rating: 3 stars
---------------------------------------------------------------------------
-Artist: Charles Fambrough
-CD: Keeper of the Spirit
-Copyright Date: 1995
-Label: AudioQuest Music
-ID: AQ-CD1033
-Track Time: 7:07
-Personnel: Charles Fambrough, bass
- Joel Levine, tenor recorder
- Edward Simon, piano
- Lenny White, drums
- Marion Simon, percussion
-Notes: On-line information and samples available at
- http://wwmusic.com/~music/audioq/rel/1033.html
-ADO Rating: 2 stars
-AMG Rating: unrated
-Penguin Rating: 3 stars
-==========================================================================
-Also of note:
---------------------------------------------------------------------------
-Artist: Holly Cole Trio
-CD: Blame It On My Youth
-Copyright Date: 1992
-Label: Manhattan
-ID: CDP 7 97349 2
-Total Time: 37:45
-Personnel: Holly Cole, voice
- Aaron Davis, piano
- David Piltch, string bass
-Notes: Lyrical reference to "Eastern Standard Time" in
- Tom Waits' "Purple Avenue"
-ADO Rating: 2.5 stars
-AMG Rating: 3 stars
-Penguin Rating: unrated
---------------------------------------------------------------------------
-Artist: Milt Hinton
-CD: Old Man Time
-Copyright Date: 1990
-Label: Chiaroscuro
-ID: CR(D) 310
-Total Time: 149:38 (two CDs)
-Personnel: Milt Hinton, bass
- Doc Cheatham, Dizzy Gillespie, Clark Terry, trumpet
- Al Grey, trombone
- Eddie Barefield, Joe Camel (Flip Phillips), Buddy Tate,
- clarinet and saxophone
- John Bunch, Red Richards, Norman Simmons, Derek Smith,
- Ralph Sutton, piano
- Danny Barker, Al Casey, guitar
- Gus Johnson, Gerryck King, Bob Rosengarden, Jackie Williams,
- drums
- Lionel Hampton, vibraphone
- Cab Calloway, Joe Williams, vocal
- Buck Clayton, arrangements
-Notes: tunes include Old Man Time, Time After Time,
- Sometimes I'm Happy,
- A Hot Time in the Old Town Tonight,
- Four or Five Times, Now's the Time,
- Time on My Hands, This Time It's Us,
- and Good Time Charlie
- On-line samples available at
- http://www.globalmusic.com/labels/chiaroscuro/chiaro_cd_gallery.html
-ADO Rating: 3 stars
-AMG Rating: 4.5 stars
-Penguin Rating: 3 stars
---------------------------------------------------------------------------
-Artist: Paul Broadbent
-CD: Pacific Standard Time
-Copyright Date: 1995
-Label: Concord Jazz, Inc.
-ID: CCD-4664
-Total Time: 62:42
-Personnel: Paul Broadbent, piano
- Putter Smith, Bass
- Frank Gibson, Jr., drums
-Notes: The CD cover features an analemma for equation-of-time fans
-ADO Rating: 1 star
-AMG Rating: 4 stars
-Penguin Rating: 3.5 stars
---------------------------------------------------------------------------
-Artist: Anthony Braxton/Richard Teitelbaum
-CD: Silence/Time Zones
-Copyright Date: 1996
-Label: Black Lion
-ID: BLCD 760221
-Total Time: 72:58
-Personnel: Anthony Braxton, sopranino and alto saxophones,
- contrebasse clarinet, miscellaneous instruments
- Leo Smith, trumpet and miscellaneous instruments
- Leroy Jenkins, violin and miscellaneous instruments
- Richard Teitelbaum, modular moog and micromoog synthesizer
-ADO Rating: black dot
-AMG Rating: unrated
---------------------------------------------------------------------------
-Artist: Jules Verne
-Book: Le Tour du Monde en Quatre-Vingts Jours
- (Around the World in Eighty Days)
-Notes: Wall-clock time plays a central role in the plot.
- European readers of the 1870s clearly held the U.S. press in
- deep contempt; the protagonists cross the U.S. without once
- reading a paper.
- An on-line French-language version of the book
- "with illustrations from the original 1873 French-language edition"
- is available at
- http://fourmilab.ch/etexts/www/tdm80j
- An on-line English-language translation of the book is available at
- http://www.literature.org/Works/Jules-Verne/eighty
---------------------------------------------------------------------------
-Film: Bell Science - About Time
-Notes: The Frank Baxter/Richard Deacon extravaganza
- Information on ordering is available at
- http://www.videoflicks.com/VF2/1035/1035893.ihtml
---------------------------------------------------------------------------
+
+
+Data on recordings of "Save That Time," Russ Long, Serrob Publishing, BMI:
Milt Hinton, bass;
+Doc Cheatham, Dizzy Gillespie, Clark Terry, trumpet;
+Al Grey, trombone;
+Eddie Barefield, Joe Camel (Flip Phillips), Buddy Tate,
+clarinet and saxophone;
+John Bunch, Red Richards, Norman Simmons, Derek Smith,
+Ralph Sutton, piano;
+Danny Barker, Al Casey, guitar;
+Gus Johnson, Gerryck King, Bob Rosengarden, Jackie Williams,
+drums;
+Lionel Hampton, vibraphone;
+Cab Calloway, Joe Williams, vocal;
+Buck Clayton, arrangements
+
Notes
tunes include Old Man Time, Time After Time,
+Sometimes I'm Happy,
+A Hot Time in the Old Town Tonight,
+Four or Five Times, Now's the Time,
+Time on My Hands, This Time It's Us,
+and Good Time Charlie
+On-line samples available at
+http://www.chiaroscurojazz.com/albuminfo.php3?albumid=49
Le Tour du Monde en Quatre-Vingts Jours
+(Around the World in Eighty Days)
+
Notes
Wall-clock time plays a central role in the plot.
+European readers of the 1870s clearly held the U.S. press in
+deep contempt; the protagonists cross the U.S. without once
+reading a paper.
+An on-line French-language version of the book
+"with illustrations from the original 1873 French-language edition"
+is available at
+http://fourmilab.ch/etexts/www/tdm80j
+An on-line English-language translation of the book is available at
+http://www.literature.org/Works/Jules-Verne/eighty
An episode of "The Adventures of Superman" entitled "The Mysterious
Cube," first aired 1958-02-24, had Superman convincing the controllers
of WWV to broadcast time signals five minutes ahead of actual time;
doing so got a crook trying to beat the statute of limitations to
emerge a bit too early from the titular enclosure.
---------------------------------------------------------------------------
+
+
The 1960s ITC television series "The Prisoner" included an episode
entitled "The Chimes of Big Ben" in which our protagonist tumbled to
the fraudulent nature of a Poland-to-England escape upon hearing "Big
Ben" chiming on Polish local time.
---------------------------------------------------------------------------
+
+
The series "Seinfeld" included an episode entitled "The Susie," first
broadcast 1997-02-13, in which Kramer decides that daylight saving time
isn't coming fast enough, so he sets his watch ahead an hour.
---------------------------------------------------------------------------
+
+
The syndicated comic strip "Dilbert" featured an all-too-rare example of
time zone humor on 1998-03-14.
---------------------------------------------------------------------------
+
+
Surrealist artist Guy Billout's work "Date Line" appeared on page 103
of the November, 1999 Atlantic Monthly.
---------------------------------------------------------------------------
+
+
"In what time zone would you find New York City?" was a $200 question on
-the 1999-11-13 United States airing of "Who Wants to be a Millionaire?"
-==========================================================================
+the 1999-11-13 United States airing of "Who Wants to Be a Millionaire?"
+"In 1883, what industry led the movement to divide the U.S. into four time
+zones?" was a $32,000 question on the 2001-05-23 United States airing of
+"Who Wants to Be a Millionaire?" At this rate, the million-dollar time-zone
+question will be asked 2002-06-04.
+
+
+
+
+
+"We're been using the five-cent nickle in this country since 1492.
+Now that's pretty near 100 years, daylight savings [sic]."
+(Groucho Marx as Captain Spaulding in "Animal Crackers", 1930,
+as noted by Will Fitzerald, wfitzgerald@ameritech.net)
+
+
"Good news."
"What did they do? Extend Daylight Saving Time year round?"
- Professional tanner George Hamilton, in dialog from a
- May, 1999 episode of the syndicated television series "Baywatch"
---------------------------------------------------------------------------
+(Professional tanner George Hamilton, in dialog from a
+May, 1999 episode of the syndicated television series "Baywatch")
+
+
"A fundamental belief held by Americans is that if you are on land, you
cannot be killed by a fish...So most Americans remain on land, believing
-they're safe. Unfortunately, this belief--like so many myths, such as that
-there's a reason for 'Daylight Saving Time'--is false."
- Dave Barry column, 2000-07-02
---------------------------------------------------------------------------
+they're safe. Unfortunately, this belief—like so many myths, such as that
+there's a reason for 'Daylight Saving Time'—is false."
+(Dave Barry column, 2000-07-02)
+
+
"I once had sex for an hour and five minutes, but that was on the day
when you turn the clocks ahead."
- Garry Shandling, 52nd Annual Emmys, 2000-09-10
-
+(Garry Shandling, 52nd Annual Emmys, 2000-09-10)
+
+
+"Is that a pertinent fact, or are you trying to dazzle me with your command
+of time zones?"
+(Kelsey Grammer as "Frasier Crane")
+
+
diff --git a/lib/libc/time/tz-link.htm b/lib/libc/time/tz-link.htm
index d7bee9bfefc..9fe4edbae33 100644
--- a/lib/libc/time/tz-link.htm
+++ b/lib/libc/time/tz-link.htm
@@ -1,16 +1,16 @@
-
-
+
Sources for Time Zone and Daylight Saving Time Data
-
-
-
+
+
+
@@ -20,20 +20,20 @@
Sources for Time Zone and Daylight Saving Time Data
The public-domain time zone database contains code and data
that represent the history of local time
for many representative locations around the globe.
It is updated periodically to reflect changes made by political bodies
to UTC offsets and daylight-saving rules.
-This database (often called tz or zoneinfo)
+This database (often called tz or zoneinfo)
is used by several implementations,
including
GNU/Linux,
@@ -41,20 +41,45 @@ including
NetBSD,
OpenBSD,
DJGPP,
-HP-UX,
+HP-UX,
IRIX,
-SCO OpenServer,
+Open UNIX,
Solaris, and
-UnixWare.
-In the tz database's
+Tru64.
+
+Each location in the database represents a national region where all
+clocks keeping local time have agreed since 1970.
+Locations are identified by continent or ocean and then by the name of
+the location, which is typically the largest city within the region.
+For example, America/New_York
+represents most of the US eastern time zone;
+America/Indianapolis represents most of Indiana, which
+uses eastern time without daylight saving time (DST);
+America/Detroit represents most of Michigan, which uses
+eastern time but with different DST rules in 1975;
+and other entries represent smaller regions like Starke County,
+Kentucky, which switched from central to eastern time in 1991.
+To use the database, set the TZ environment variable to
+the location's full name, e.g., TZ="America/New_York".
+
+In the tz database's
FTP distribution,
-the code is in the file tzcodeC.tar.gz,
-where C is the code's version;
-similarly, the data are in tzdataD.tar.gz,
-where D is the data's version.
-The code lets you compile the text data into time zone files, one for
-each location. It also lets you read a compiled time zone file and
-interpret time stamps for that location.
+the code is in the file tzcodeC.tar.gz,
+where C is the code's version;
+similarly, the data are in tzdataD.tar.gz,
+where D is the data's version.
+The following shell commands download
+these files to a GNU/Linux or similar host; see the downloaded
+README file for what to do next.
+
wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
+gzip -dc tzcode*.tar.gz | tar -xf -
+gzip -dc tzdata*.tar.gz | tar -xf -
+
+
+The code lets you compile the tz source files into
+machine-readable binary files, one for each location. It also lets
+you read a tz binary file and interpret time stamps for that
+location.
Timezone
+Converter is a similar interface, with source code
written in Perl, using what Paul
Stewart calls the "20-line hack no one will let me forget".
Fancier web interfaces, roughly in ascending order of complexity, include:
@@ -84,36 +108,54 @@ World
The GNU C Library
has an independent, thread-safe implementation of
-a time zone file reader that is compatible with tz.
+a tz binary file reader.
This library is freely available under the
GNU Lesser General Public License (LGPL),
and is widely used in GNU/Linux systems.
ZoneInfo.java
-is a time zone file reader written in Java.
+is a tz binary file reader written in Java.
It is freely available under the GNU LGPL.
+href="http://www20.Brinkster.com/timezone50/">Time Zone Converter is a
+Microsoft Windows program.
Other time zone databases
@@ -121,20 +163,25 @@ Microsoft Windows 95/98/NT4 program.
- Atlas Query is Astrodienst's Web version of Shanks's
excellent time zone history atlases published in both computer and book form by book form by Astro Communications Services.
World Time Zones
contains data from the Time Service Department of the US Naval Observatory
(USNO), used as the source
-for the usno* files in the tz distribution.
@@ -156,23 +204,21 @@ current time
has several fancy time zone maps; it covers Russia particularly well.
The maps' pictorial quality is not quite as good as the CIA's
but the maps are more up to date.
-
World Time Server
-has a separate little outline map for each region of each country that
-currently observes a different time.
@@ -184,39 +230,58 @@ Saving Time - History, rationale, laws and dates
is a good overall history of DST.
The
Time of Internet
-contains good descriptions of Time Zones and daylight saving time,
+describes time zones and daylight saving time,
with diagrams.
The time zone map is out of date, however.
History of
legal time in Britain is an excellent discussion for the country
-with perhaps the best-documented history of clock adjustments.
+with perhaps the best-documented history of clock adjustments.
+The National Physical Laboratory also maintains an archive
+of summer time dates.
Precision timekeeping
@@ -225,32 +290,38 @@ with perhaps the best-documented history of clock adjustments.
href="http://literature.agilent.com/litwebbin/purl.cgi?org_id=tmo&pub_id=5965-7984E">The
Science of Timekeeping is an excellent and thorough introduction
to the theory and practice of precision timekeeping.
-
Bulletins
+maintained by the IERS EOP (PC) contains official publications of
+the Earth Orientation Parameters Product Center of the
International Earth Rotation Service, the committee that decides
when leap seconds occur.
.
This proposal is being studied by the URSI Commission J Working Group on the
-Leap Second, and the IAU
+Leap Second, and the IAU
has plans to report on this proposal by 2003.
Time notation
@@ -258,9 +329,30 @@ has plans to report on this proposal by 2003.
+Alphabetic time zone abbreviations should not be used as unique
+identifiers for UTC offsets as they are ambiguous in practice. For
+example, "EST" denotes 5 hours behind UTC in English-speaking North
+America, but it denotes 10 or 11 hours ahead of UTC in Australia;
+and French-speaking North Americans prefer "HNE" to "EST". For
+compatibility with POSIX the
+tz database contains English abbreviations for all time
+stamps but in many cases these are merely inventions of the database
+maintainers.
Related indexes
diff --git a/lib/libc/time/zic.c b/lib/libc/time/zic.c
index 23ccf3bbef8..74613afac59 100644
--- a/lib/libc/time/zic.c
+++ b/lib/libc/time/zic.c
@@ -1,14 +1,20 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
-static char elsieid[] = "@(#)zic.c 7.101";
-static char rcsid[] = "$OpenBSD: zic.c,v 1.15 2000/09/06 23:05:12 millert Exp $";
+static char elsieid[] = "@(#)zic.c 7.107";
+static char rcsid[] = "$OpenBSD: zic.c,v 1.16 2002/04/04 19:12:09 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include "private.h"
#include "locale.h"
#include "tzfile.h"
-#ifdef __unix__
-#include "sys/stat.h" /* for umask manifest constants */
-#endif /* defined __unix__ */
+
+#if HAVE_SYS_STAT_H
+#include "sys/stat.h"
+#endif
+#ifdef S_IRUSR
+#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#else
+#define MKDIR_UMASK 0755
+#endif
/*
** On some ancient hosts, predicates like `isspace(C)' are defined
@@ -1588,16 +1594,16 @@ const int zonecount;
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;
startttisgmt = FALSE;
for (i = 0; i < zonecount; ++i) {
+ /*
+ ** A guess that may well be corrected later.
+ */
+ stdoff = 0;
zp = &zpfirst[i];
usestart = i > 0 && (zp - 1)->z_untiltime > min_time;
useuntil = i < (zonecount - 1);
@@ -1617,8 +1623,7 @@ const int zonecount;
if (usestart) {
addtt(starttime, type);
usestart = FALSE;
- }
- else if (stdoff != 0)
+ } 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)
@@ -2176,7 +2181,7 @@ char * const argname;
** created by some other multiprocessor, so we get
** to do extra checking.
*/
- if (mkdir(name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) != 0) {
+ if (mkdir(name, MKDIR_UMASK) != 0) {
const char *e = strerror(errno);
if (errno != EEXIST || !itsdir(name)) {
--
cgit v1.2.3-59-g8ed1b