summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart@stuartbishop.net>2014-06-02 12:39:59 +0000
committerStuart Bishop <stuart@stuartbishop.net>2014-06-02 12:39:59 +0000
commit2f916c2a85561fd96cc7fb252c19fadcf2a5f77b (patch)
tree0496bc394bf88cebc04045bce8675180a64e1f53
parent54b09ec9de8f5a1ab29a261db4a465b9bb27e159 (diff)
downloadpytz-2f916c2a85561fd96cc7fb252c19fadcf2a5f77b.tar.gz
Import 2014d
-rw-r--r--elsie.nci.nih.gov/src/Makefile3
-rw-r--r--elsie.nci.nih.gov/src/NEWS18
-rw-r--r--elsie.nci.nih.gov/src/tz-link.htm6
-rw-r--r--elsie.nci.nih.gov/src/zic.86
-rw-r--r--elsie.nci.nih.gov/src/zic.8.txt6
-rw-r--r--elsie.nci.nih.gov/src/zic.c55
6 files changed, 79 insertions, 15 deletions
diff --git a/elsie.nci.nih.gov/src/Makefile b/elsie.nci.nih.gov/src/Makefile
index 3cdd845..5e8fa91 100644
--- a/elsie.nci.nih.gov/src/Makefile
+++ b/elsie.nci.nih.gov/src/Makefile
@@ -6,7 +6,7 @@
PACKAGE= tzcode
# Version numbers of the code and data distributions.
-VERSION= 2014c
+VERSION= 2014d
# Email address for bug reports.
BUGEMAIL= tz@iana.org
@@ -100,6 +100,7 @@ YEARISTYPE= ./yearistype
LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed.
+# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
# -DHAVE_ADJTIME=0 if `adjtime' does not exist (SVR0?)
# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
# -DHAVE_GETTEXT=1 if `gettext' works (GNU, Linux, Solaris); also see LDLIBS
diff --git a/elsie.nci.nih.gov/src/NEWS b/elsie.nci.nih.gov/src/NEWS
index b092ba8..d2a7e9a 100644
--- a/elsie.nci.nih.gov/src/NEWS
+++ b/elsie.nci.nih.gov/src/NEWS
@@ -1,11 +1,27 @@
News for the tz database
+Release 2014d - 2014-05-27 21:34:40 -0700
+
+ Changes affecting code
+
+ zic no longer generates files containing time stamps before the Big Bang.
+ This works around GNOME bug 730332
+ <https://bugzilla.gnome.org/show_bug.cgi?id=730332>.
+ (Thanks to Leonardo Chiquitto for reporting the bug, and to
+ Arthur David Olson and James Cloos for suggesting improvements to the fix.)
+
+ Changes affecting documentation
+
+ tz-link.htm now mentions GNOME.
+
+
Release 2014c - 2014-05-13 07:44:13 -0700
Changes affecting near-future time stamps
- Egypt observes DST starting May 15. (Thanks to Ahmad El-Dardiry.)
+ Egypt observes DST starting 2014-05-15 at 24:00.
+ (Thanks to Ahmad El-Dardiry and Gunther Vermier.)
Details have not been announced, except that DST will not be observed
during Ramadan. Guess that DST will stop during the same Ramadan dates as
Morocco, and that Egypt's future spring and fall transitions will be the
diff --git a/elsie.nci.nih.gov/src/tz-link.htm b/elsie.nci.nih.gov/src/tz-link.htm
index c7af0f8..04919a9 100644
--- a/elsie.nci.nih.gov/src/tz-link.htm
+++ b/elsie.nci.nih.gov/src/tz-link.htm
@@ -8,7 +8,7 @@
<meta http-equiv="Content-type" content='text/html; charset="US-ASCII"'>
<meta name="DC.Creator" content="Eggert, Paul">
<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2014-03-10">
+<meta name="DC.Date" content="2014-05-27">
<meta name="DC.Description"
content="Sources of information about time zones and daylight saving time">
<meta name="DC.Identifier"
@@ -315,6 +315,10 @@ This library is freely available under the
<abbr>GNU</abbr> Lesser General Public License
(<abbr title="Lesser General Public License">LGPL</abbr>)</a>,
and is widely used in <abbr>GNU</abbr>/Linux systems.</li>
+<li><a href="http://www.gnome.org/">GNOME</a>'s Glib has
+a <code><abbr>tz</abbr></code> binary file reader written in C that
+creates a <code>GTimeZone</code> object representing sets of UTC offsets.
+It is freely available under the <abbr>LGPL</abbr>.</li>
<li><a href="http://bmsi.com/java/#TZ">ZoneInfo.java</a>
is a <code><abbr>tz</abbr></code> binary file reader written in Java.
It is freely available under the <abbr>LGPL</abbr>.</li>
diff --git a/elsie.nci.nih.gov/src/zic.8 b/elsie.nci.nih.gov/src/zic.8
index ca29fd1..5f5268c 100644
--- a/elsie.nci.nih.gov/src/zic.8
+++ b/elsie.nci.nih.gov/src/zic.8
@@ -519,6 +519,12 @@ produces a single transition to daylight saving at the new UT offset
To get separate transitions
use multiple zone continuation lines
specifying transition instants using universal time.
+.PP
+Time stamps well before the Big Bang are silently omitted from the output.
+This works around bugs in software that mishandles large negative time
+stamps. Call it sour grapes, but pre-Big-Bang time stamps are
+physically suspect anyway. The pre-Big-Bang cutoff time is
+approximate and may change in future versions.
.SH FILE
/usr/local/etc/zoneinfo standard directory used for created files
.SH "SEE ALSO"
diff --git a/elsie.nci.nih.gov/src/zic.8.txt b/elsie.nci.nih.gov/src/zic.8.txt
index 4a25ec2..5e47fe5 100644
--- a/elsie.nci.nih.gov/src/zic.8.txt
+++ b/elsie.nci.nih.gov/src/zic.8.txt
@@ -309,6 +309,12 @@ NOTES
To get separate transitions use multiple zone continuation lines
specifying transition instants using universal time.
+ Time stamps well before the Big Bang are silently omitted from the
+ output. This works around bugs in software that mishandles large
+ negative time stamps. Call it sour grapes, but pre-Big-Bang time
+ stamps are physically suspect anyway. The pre-Big-Bang cutoff time is
+ approximate and may change in future versions.
+
FILE
/usr/local/etc/zoneinfo standard directory used for created
files
diff --git a/elsie.nci.nih.gov/src/zic.c b/elsie.nci.nih.gov/src/zic.c
index 7e0f97f..07d6c30 100644
--- a/elsie.nci.nih.gov/src/zic.c
+++ b/elsie.nci.nih.gov/src/zic.c
@@ -723,6 +723,36 @@ warning(_("hard link failed, symbolic link used"));
static const zic_t min_time = (zic_t) -1 << (TIME_T_BITS_IN_FILE - 1);
static const zic_t max_time = -1 - ((zic_t) -1 << (TIME_T_BITS_IN_FILE - 1));
+/* Estimated time of the Big Bang, in seconds since the POSIX epoch.
+ rounded downward to the negation of a power of two that is
+ comfortably outside the error bounds.
+
+ zic does not output time stamps before this, partly because they
+ are physically suspect, and partly because GNOME mishandles them; see
+ GNOME bug 730332 <https://bugzilla.gnome.org/show_bug.cgi?id=730332>.
+
+ For the time of the Big Bang, see:
+
+ Ade PAR, Aghanim N, Armitage-Caplan C et al. Planck 2013 results.
+ I. Overview of products and scientific results.
+ arXiv:1303.5062 2013-03-20 20:10:01 UTC
+ <http://arxiv.org/pdf/1303.5062v1> [PDF]
+
+ Page 36, Table 9, row Age/Gyr, column Planck+WP+highL+BAO 68% limits
+ gives the value 13.798 plus-or-minus 0.037 billion years.
+ Multiplying this by 1000000000 and then by 31557600 (the number of
+ seconds in an astronomical year) gives a value that is comfortably
+ less than 2**59, so BIG_BANG is - 2**59.
+
+ BIG_BANG is approximate, and may change in future versions.
+ Please do not rely on its exact value. */
+
+#ifndef BIG_BANG
+#define BIG_BANG (- (1LL << 59))
+#endif
+
+static const zic_t big_bang_time = BIG_BANG;
+
static int
itsdir(const char *const name)
{
@@ -1174,10 +1204,6 @@ inleap(register char ** const fields, const int nfields)
return;
}
dayoff = oadd(dayoff, day - 1);
- if (dayoff < 0 && !TYPE_SIGNED(zic_t)) {
- error(_("time before zero"));
- return;
- }
if (dayoff < min_time / SECSPERDAY) {
error(_("time too small"));
return;
@@ -1186,7 +1212,7 @@ inleap(register char ** const fields, const int nfields)
error(_("time too large"));
return;
}
- t = (zic_t) dayoff * SECSPERDAY;
+ t = dayoff * SECSPERDAY;
tod = gethms(fields[LP_TIME], _("invalid time of day"), FALSE);
cp = fields[LP_CORR];
{
@@ -1215,7 +1241,12 @@ inleap(register char ** const fields, const int nfields)
));
return;
}
- leapadd(tadd(t, tod), positive, lp->l_value, count);
+ t = tadd(t, tod);
+ if (t < big_bang_time) {
+ error(_("leap second precedes Big Bang"));
+ return;
+ }
+ leapadd(t, positive, lp->l_value, count);
}
}
@@ -1478,7 +1509,7 @@ writezone(const char *const name, const char *const string, char version)
toi = 0;
fromi = 0;
- while (fromi < timecnt && attypes[fromi].at < min_time)
+ while (fromi < timecnt && attypes[fromi].at < big_bang_time)
++fromi;
for ( ; fromi < timecnt; ++fromi) {
if (toi > 1 && ((attypes[fromi].at +
@@ -2167,9 +2198,9 @@ outzone(const struct zone * const zpfirst, const int zonecount)
*/
stdoff = 0;
zp = &zpfirst[i];
- usestart = i > 0 && (zp - 1)->z_untiltime > min_time;
+ usestart = i > 0 && (zp - 1)->z_untiltime > big_bang_time;
useuntil = i < (zonecount - 1);
- if (useuntil && zp->z_untiltime <= min_time)
+ if (useuntil && zp->z_untiltime <= big_bang_time)
continue;
gmtoff = zp->z_gmtoff;
eat(zp->z_filename, zp->z_linenum);
@@ -2185,7 +2216,7 @@ outzone(const struct zone * const zpfirst, const int zonecount)
if (usestart) {
addtt(starttime, type);
usestart = FALSE;
- } else addtt(min_time, type);
+ } else addtt(big_bang_time, type);
} else for (year = min_year; year <= max_year; ++year) {
if (useuntil && year > zp->z_untilrule.r_hiyear)
break;
@@ -2362,8 +2393,8 @@ error(_("can't determine time zone abbreviation to use just after until time"));
static void
addtt(const zic_t starttime, int type)
{
- if (starttime <= min_time ||
- (timecnt == 1 && attypes[0].at < min_time)) {
+ if (starttime <= big_bang_time ||
+ (timecnt == 1 && attypes[0].at < big_bang_time)) {
gmtoffs[0] = gmtoffs[type];
isdsts[0] = isdsts[type];
ttisstds[0] = ttisstds[type];