Commit Graph
3084 Commits
Author SHA1 Message Date
Paul Eggert 8fe97ff3bc * Theory: Document time_t better and update for POSIX.1-2013.
Change "`" to "'"; these days, "`" and "'" are not symmetric.
2013-08-07 17:19:22 -07:00
Paul Eggert 3638e641e8 Don't bother with uintmax_t in previous change.
See the thread starting with Clive D.W. Feather's comments in
<http://mm.icann.org/pipermail/tz/2013-August/019496.html>.
* localtime.c (truncate_time): Don't bother with uintmax_t,
as using it doesn't help on any known platform.
* private.h (UINTMAX_MAX): Remove.
2013-08-07 16:08:39 -07:00
Paul Eggert b0bf6d8fee Avoid undefined behavior on integer overflow.
Problem reported by Alois Treindl in
<http://mm.icann.org/pipermail/tz/2013-August/019493.html>.
* localtime.c (truncate_time): New function.
(localsub): Use it to avoid undefined behavior on integer overflow.
* private.h (INTMAX_MAX, INTMAX_MIN, UINTMAX_MAX):
New macros, for older platforms that lack them.
2013-08-07 09:03:09 -07:00
Paul Eggert 5ea7a94f6a Revert unintended change to ABI for extern functions.
* localtime.c (offtime, timeoff, gtime): Revert change to ABI, by
going back to 'long' instead of 'int_fast32_t' for types accepted
and returned by extern functions.  Reported by Christos Zoulas in
<http://mm.icann.org/pipermail/tz/2013-July/019488.html>.
2013-07-21 08:24:45 -07:00
Paul Eggert ba39973190 Rework to avoid bogus warning from clang -Wliteral-conversion.
Reported by Andy Heninger in
<http://mm.icann.org/pipermail/tz/2013-July/019446.html>.
* localtime.c (double_to_time): New function.
(timesub): Use it.
2013-07-08 15:51:18 -07:00
Paul Eggert 8f10e5c535 Release tzcode2013d and tzdata2013d.
* Makefile (VERSION): Increase to 2013d.
2013d
2013-07-05 07:38:01 -07:00
Paul Eggert 4e3a632736 Update link page.
* tz-link.htm: Add commentary section.  Update URLs and titles.
Add links to Firefox OS, Bill Seymour's intro, Jon Udell's appreciation,
W3C's "Working with Time Zones".
2013-07-03 01:31:47 -07:00
Ephraim Silverberg c7438a6543 Israel now falls back on the last Sunday of October.
* asia (Zion): Change fallback rule for 2013 on to Oct lastSun 2:00.
2013-07-03 00:57:38 -07:00
Paul Eggert 30344f7c14 Move Morocco's midsummer 2013 transitions.
* africa (Morocco): This year's midsummer transitions are
July 7 and August 10, not July 9 and August 8.
Thanks to Andrew Paprocki in
<http://mm.icann.org/pipermail/tz/2013-July/019421.html>.
2013-07-02 23:49:41 -07:00
Paul Eggert 985296c911 * tz-art.htm: A couple more fixes. 2013-05-31 00:48:37 -07:00
Paul Eggert ea308a6345 Spelling fixes.
Most of these are from Kevin Lyda in
<http://mm.icann.org/pipermail/tz/2013-May/019407.html>,
with a couple more from Jonathan Leffler in
<http://mm.icann.org/pipermail/tz/2013-May/019409.html>.
2013-05-31 00:21:25 -07:00
Paul Eggert 5546a79cea * asia (Asia/Jerusalem): Fix LMT to match more-precise longitude.
Suggested by Tim Parenti in
<http://mm.icann.org/pipermail/tz/2013-May/019410.html>.
2013-05-30 08:54:25 -07:00
Paul Eggert 8b05d8e8ec * zdump.8: Fix minor typos in recent changes. 2013-05-30 00:00:09 -07:00
Paul Eggert f0133dd86a Port to NetBSD, where, e.g., 'time_t' is wider than 'long'.
I audited the code and fixed as many width-asssumptions as I could
find, including several places where the code assumed that 'time_t'
was no wider than 'long'; this assumption is not true on 32-bit
NetBSD platforms.  This caught every problem that is already fixed
in the NetBSD zic.c, and caught quite a few more.
* Makefile: Add comments re HAVE_DOS_FILE_NAMES and HAVE_INTTYPES_H.
* date.c (checkfinal, netsettime): Don't use 'long' where 'int' will do.
* difftime.c (difftime): Mark with ATTRIBUTE_CONST.
Use uintmax_t, not unsigned long, for the widest unsigned integer type.
Use long double, not double, if time_t is wider than uintmax_t;
this can in theory help on nonstandard platforms, such as GCC
with 64-bit uintmax_t and 128-bit __int128_t.
* localtime.c (struct ttinfo.tt_gmtoff, struct rule.r_time)
(detzcode, getsecs, getoffset, gmtsub, localsub, increment_overflow32)
(normalize_overflow32, time1, time2, timesub, transtime, tzparse)
(time2sub, timeoff, gtime):
* tzfile.h (SECSPERDAY):
* zdump.c (SECSPERDAY):
* zic.c (convert, puttzcode):
Use int_fast32_t, not long, when all we care is that values up to
2**31 can be stored.  This doesn't fix any bugs, but it allows
more opportunity for compiler optimization.
(struct lsinfo.ls_corr, timesub, leapcorr):
Use int_fast64_t, not long, when values up to 2**63 can be stored.
(timesub): Make it clearer when we are truncating 0.5 to 0.
(increment_overflow32): Rename from long_increment_overflow.
All uses changed.
(normalize_overflow32): Rename from long_normalize_overflow.
All uses changed.
* private.h (HAVE_INTTYPES_H, ATTRIBUTE_CONST): New macros.
Include <inttypes.h> if HAVE_INTTYPES_H.
(INT_FAST64_MIN, INT_FAST64_MAX, SCNdFAST64, int_fast32_t, PRIdMAX)
(uintmax_t, PRIuMAX, _Noreturn):
Define to reasonable values if it's an older compiler.
* scheck.c (scheck): Add support for arbitrary formats, such as
those that SCNdFAST64 can expand to, at the price of no longer
supporting weird conversion specs like "%[%]".
* strftime.c (_fmt): Use intmax_t and uintmax_t to format time_t,
not long and unsigned long.
* zdump.c (int_fast32_t, intmax_t, PRIdMAX, SCNdMAX):
Define for pre-C99 compilers, like private.h does.
(delta, yeartot, main): Use intmax_t, not long.
(hunt): Use time_t, not long, since the diff must be nonnegative.
(tformat): Allow for time_t wider than long.
* zic.c (ZIC_MIN, ZIC_MAX, SCNdZIC): New macros.
(OFFSET_STRLEN_MAXIMUM, RULE_STRLEN_MAXIMUM): Remove.
(struct rule): Make r_loyear, r_hiyear, r_tod, r_stdoff, z_gmtoff,
z_stdoff zic_t, not long.
(addtype, gethms, oadd, rpytime, tadd, gmtoffs, corr, inleap)
(stringoffset, stringrule, outzone, addtype, adjleap, rpytime)
(LDAYSPERWEEK):
Use zic_t, not long.
(leapminyear, leapmaxyear, min_year, max_year, rulesub, updateminmax)
(outzone, rpytime):
Use zic_t, not int.
(usage): Now _Noreturn.
(main): Use S_IWGRP, not 'unix', to determine whether to call umask.
(writezone): Omit unnecessary cast.
(mkdirs): Use HAVE_DOS_FILE_NAMES, not 'unix', to determine
whether to parse DOS file anmes.
(eitol): Remove; no longer needed.
2013-05-27 21:26:18 -07:00
Paul Eggert d3b025adb2 Adjust commentary to try to defuse recent issues somewhat.
This change stemmed from a long discussion on the tz mailing list
about what country the Jerusalem zone entry is in.  The idea of
this change is to deemphasize the role of countries in the tz
database, to lessen the amount of controversy in the future.
Due to backward compatibility concerns this change does not eliminate
the role of countries entirely.  With one minor exception this
change does not alter any code or data, just comments.
* Theory, zone.tab: Deemphasize the role of countries in choosing
location names, as they tend to introduce political conflict
during maintenance, and country information isn't needed for
typical uses of the database.
* Theory: Say that names should differ in more than just case, and why;
and explain why 'backward' means old names will continue to work.
(thanks to Norbert Lindenberg for spotting these issues).
Update citation date and URL.
* iso3166.tab: Mention latest maintenance update.
Update citation URL.  Add missing comma for BQ.
Be more consistent about abbreviating Sint like Saint.
Mention SX "Dutch part" for consistency with MF "French part".
* iso3166.tab, zone.tab: Add legal/territorial disclaimer.
* zone.tab: Say that country/zone overlaps can occur in both
directions, and that column 2 need not lie within column 1.
(Asia/Jerusalem): Change the coordinates from a sloppy value,
taken from an old astrology book, to a more-precise value, the
site of city hall.  The sloppy value sparked some controversy and
the hope is that the more-precise value will be a bit less
controversial.
2013-05-27 18:08:26 -07:00
Paul Eggert 4c43a92919 Add tests for 32- and 64-bit signed and unsigned time_t.
* Makefile (TIME_T_ALTERNATIVES): New macro.
(check_time_t_alternatives, clean_misc): New rules.
(clean): Split out into clean_misc and removing tzpublic.
(public): Add check_time_t.
2013-05-27 14:59:14 -07:00
Paul Eggert 8a883a64cb Add support for testing time_t types other than the system's.
This makes it easier to test on (say) Debian, even if we're
testing the time_t type on (say) NetBSD.  NetBSD uses 64-bit
time_t on 32-bit hosts, and this lets us test a NetBSD-style
implementation (32-bit 'long', 64-bit time_t) on a 32-bit Debian host.
* Makefile: Update comments to talk about TIME_T_FLOATING and time_tz.
Sort the comments.
* private.h (restrict): Define to empty with older compilers.
'restrict' is now needed, to define gmtime_r and localtime_r in
standard ways when time_tz is defined.
Make the following changes if time_tz is defined:
(sys_time, time): New static functions.  The former is the system
'time' function that applies to the system time_t, the latter
our function that applies to our time_t.
(time_t, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime)
(localtime_r, mktime): Rename to tz_time_t, tz_ctime, etc.,
via macros.  Declare the renamed versions.
* zdump.8: Document new options -V, -t.
* zdump.c: Include private.h if time_tz is defined.
(INITIALIZE): Remove; no longer needed.
(absolute_min_time, absolute_max_time): Work even if time_t
is wider than intmax_t, which can be true with GCC and __int128_t.
Use the new TIME_T_FLOATING macro for this.
(usage): Document new flags.
(main): Support them.
2013-05-27 14:59:09 -07:00
Denis Excoffier 13d50f6f74 * Makefile: Remove obsolete NOID comment.
See <http://mm.icann.org/pipermail/tz/2013-May/019291.html>.
2013-05-23 13:01:02 -07:00
Arthur David Olson fada9b7b05 Rework to avoid problem with Australia/Macquarie on 32-bit hosts.
Problem reported by Alan Gutierrez in
<http://mm.icann.org/pipermail/tz/2013-May/019368.html>.
* australasia (Antarctica/Macquarie): Rework to avoid problem
when combined with older zic + older localtime.
* localtime.c: Rework to avoid problem when combined with
older Antarctica/Macquarie + older zic.
(struct state): New member defaulttype.
(tzload): Set it.
(localsub): Use it.
* zic.c: Rework to avoid problem when combined with
older Antarctica/Macquarie + older zic.
(writezone): Potentially, set type 0 to that of lowest-valued time.
(outzone): Reserve type 0.
2013-05-23 12:21:02 -07:00
Paul Eggert bc0d28a763 Update URL for CLDR Zone->Tzid table.
* tz-link.htm: Fix link.  Problem eported by Yoshito Umaoka in
<http://mm.icann.org/pipermail/tz/2013-May/019284.html>.
2013-05-10 11:22:21 -07:00
Paul Eggert f599ad15ce Release tzcode2013c and tzdata2013c.
* Makefile (VERSION): Increase to 2013c.
2013c
2013-04-19 16:17:40 -07:00
Paul Eggert 188b29d966 Fix times of habitation for Macquarie to agree with Tasmania history.
Also, sort Macquarie more-consistently with other parts of Australia.
This doesn't affect time stamps, just zone selection.
Problems reported by Tim Parenti in
<http://mm.icann.org/pipermail/tz/2013-April/019060.html>.
* australasia (Antarctica/Macquarie): Tasmania Parks & Wildlife Service
history indicates that permanent habitation was 1899-1918 and 1948 on.
* zone.tab (Antarctica/Macquarie): Move next to Lord Howe and Tasmania.
2013-04-17 09:23:34 -07:00
Paul Eggert a676f5ad3b Macquarie Island is politically part of Australia, not Antarctica.
This doesn't affect time stamps, just zone selection.
Problem reported by Tobias Conradi in
<http://mm.icann.org/pipermail/tz/2013-April/019023.html>.
* antarctica (AusAQ, ATAQ): Remove; no longer needed.
* australasia (Antarctica/Macquarie): Move here from
the 'antarctica' file.  Use Aus and AT rather than
AusAQ and ATAQ.
* zone.tab (Antarctica/Macquarie): Country code AU, not AQ.
2013-04-15 00:00:01 -07:00
Paul Eggert 65da15f972 Palestine observes DST starting March 29, 2013 (reworked).
Thanks to Steffen Thorsen, in
<http://mm.icann.org/pipermail/tz/2013-March/018812.html>.
An earlier version of this patch was mistaken.
Thanks to Petr Machata for reporting some of the bugs, in
<http://mm.icann.org/pipermail/tz/2013-March/018814.html>.

* asia (Palestine, Asia/Gaza, Asia/Hebron): Incorporates the latest info
from timeanddate.com about Palestine.  When combined with the previous
(incorrect) patch this incorporates the following changes for Gaza and
Hebron:

  The spring 2008 change in Gaza and Hebron was on 00:00 Mar 28, not
  00:00 Apr 1.

  The fall 2009 change in Gaza and Hebron on Sep 4 was at 01:00, not
  02:00.

  The spring 2010 change in Hebron was 00:00 Mar 26, not 00:01 Mar 27.
  timeanddate.com's table says 02:00, but the text at
  <http://www.timeanddate.com/news/time/gaza-and-west-bank-dst-2010.html>
  says 00:00.

  The spring 2011 change in Gaza was 00:01 Apr 1, not 12:01 Apr 2.
  timeanddate's table says 00:00, but the text at
  <http://www.timeanddate.com/news/time/west-bank-starts-dst-2011.html>
  says 00:01.

  The spring 2011 change in Hebron on Apr 1 was at 00:01, not 12:01.

  The fall 2011 change in Hebron on Sep 30 was at 00:00, not 03:00.

  From 2013 on, Gaza and Hebron both observe DST, with the predicted
  rules being the last Thursday in March at 24:00 to the first Friday on
  or after September 21 at 01:00.
2013-04-14 23:39:54 -07:00
Paul Eggert 63814cf0a8 Palestine observes DST starting March 29, 2013.
Thanks to Steffen Thorsen, in
<http://mm.icann.org/pipermail/tz/2013-March/018812.html>.
* asia (Palestine): Add rules for 2011 on, to simplify Gaza and Hebron.
Adjust to recently announced changed.
(Asia/Gaza, Asia/Hebron): Use adjusted rules.
2013-03-26 14:23:08 -07:00
Paul Eggert 0a700f096a Assume Paraguay change is permanent.
* southamerica (Para): Move end of DST to the 4th Sunday in March
every year.  Suggested by Carlos Raúl Perasso in
<http://mm.icann.org/pipermail/tz/2013-March/018788.html>.
2013-03-15 12:26:57 -07:00
Paul Eggert 014d6f775d Release tzcode2013b and tzdata2013b.
* Makefile (VERSION): Increase to 2013b.
2013b
2013-03-10 22:33:40 -07:00
Paul Eggert 6b8911ccc3 Update URLs in tz-link page.
* tz-link.htm: Add URLs for webOS, BB10, iOS.  Update URL for Solaris.
Mention Internet RFC 6557.  Update Internet RFCs 2445->5545,
2822->5322.  Switch from FTP to HTTP for Internet RFCs.
2013-03-10 22:29:53 -07:00
Paul Eggert cfdfcf9e91 * northamerica (Haiti): Haiti is using US-style rules this year, too.
Assume this will continue.  Thanks to Steffen Thorsen, in
<http://mm.icann.org/pipermail/tz/2013-March/018761.html>.
2013-03-10 21:22:47 -07:00
Paul Eggert d89986e3aa Paraguay ends DST early this year.
* southamerica (Para): DST ends on March 24 this year.  (Thanks to
Steffen Thorsen).  For now, assume the change is just this year.
2013-03-07 14:12:38 -08:00
Paul Eggert 95e6f814bb Estimate Morocco 2013-2038 transitions for Ramadan.
* africa (Morocco): Use GNU Emacs 24.3 to estimate Ramadan-based
DST transition dates for 2013-2038.  Heads-up by Erik Homoet in
<http://mm.icann.org/pipermail/tz/2013-February/018680.html>.
2013-03-06 22:32:18 -08:00
Paul Eggert 0fdbcdc252 Release tzcode2013a and tzdata2013a.
* Makefile (VERSION): Increase to 2013a.
2013a
2013-02-27 09:20:35 -08:00
Paul Eggert cec2e7019a Chile is changing its DST rules.
Thanks to Steffen Thorsen for the heads-up, in
<http://mm.icann.org/pipermail/tz/2013-February/018623.html>.
* antarctica (ChileAQ):
* southamerica (Chile):
Assume the 2012 rules will continue indefinitely.  Suggested by Robert
Elz in <http://mm.icann.org/pipermail/tz/2013-February/018636.html>.
2013-02-20 23:40:23 -08:00
Paul Eggert 68efd69762 Incorporate data from Milne (1899).
The source is: Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
<http://www.jstor.org/stable/1774359>.
* africa (Africa/Gaborone, Africa/Cairo):
* asia (Asia/Rangoon, Asia/Shanghai, Asia/Hong_Kong, Asia/Aden):
* australasia (Pacific/Fiji):
* europe (Europe/Vienna):
* northamerica (America/Nassau, America/Barbados, Atlantic/Bermuda)
(America/Costa_Rica):
* southamerica (America/Bogota, America/Curacao):
Adjust old time stamps to match Milne.  I went going through
Milne's list one by one and did not finish, but the rest can be
done later.
2013-02-20 23:00:40 -08:00
Paul Eggert 09936256b9 * tz-link.htm: Add pointer to tz.js. Update URLs. 2013-02-20 22:39:27 -08:00
Paul Eggert 3c6cc4544d Allow 24:00 at the end of version-2-format time zone files.
* zic.c (stringoffset): Allow 24:00.  POSIX.1-2008 allows 24:00,
even though older versions of POSIX maxed out at 23:59:59.
Patch from Arthur David Olson.
2013-02-20 22:05:52 -08:00
Paul Eggert d4266a8cac * strftime.c: Also mention sccsid in the "Based on" comment. 2013-01-12 12:04:36 -08:00
Paul Eggert 0d43a76fca * strftime.c: Bring back "Based on UCB" comment.
This was inadvertently omitted when SCCS keywords were removed.
2013-01-11 20:54:47 -08:00
Arthur David Olson 3056d67be6 Fix bug with two-in-one-month time changes in 2010 in Egypt.
Problem reported by Paul Eggert in
<http://mm.icann.org/pipermail/tz/2013-January/018532.html>.
* zic.c (stringzone): Check for day of month too, when finding
latest rule.
2013-01-11 17:57:57 -08:00
Paul Eggert 78d0395d95 Move 'make check' to Ubuntu 12.10.
* Makefile (SGML_DTDDIR): New macro, for easier porting.
Update to file name used in Ubuntu 12.10.
(SGML_SEARCH_PATH): Use SGML_DTDDIR.
2013-01-11 12:02:22 -08:00
Paul Eggert 3daaa8e346 New alias Europe/Busingen for Europe/Zurich.
* europe, zone.tab (Europe/Busingen): New Link.  See Arthur David Olson
in <http://mm.icann.org/pipermail/tz/2013-January/018511.html>.
Original heads-up from Tobias Conradi in
<http://mm.icann.org/pipermail/tz/2011-September/008784.html>.
2013-01-11 11:58:07 -08:00
Paul Eggert daadd70793 Check that the distributed files use a safe ASCII subset.
* Makefile (TAB_CHAR, INVALID_CHAR1, INVALID_CHAR2, INVALID_CHAR3)
(INVALID_CHAR): New macros.
(check_character_set): New rule.
(check): Use it.
2012-12-13 17:19:47 -08:00
Paul Eggert 3423c7fa4a Stick to ASCII in commentary.
* southamerica: Rewrite to avoid the need for Latin-1 bytes.
Perhaps someday we should allow non-ASCII characters in commentary,
but if we do so we should use UTF-8.  Reported by Andy Heninger in
<http://mm.icann.org/pipermail/tz/2012-December/018480.html>.
2012-12-13 16:32:22 -08:00
Paul Eggert 318a6e5dcc Update zones Asia/Khandyga, Asia/Ust-Nera for pre-2004 time.
* europe (Asia/Khandyga, Asia/Ust-Nera): Modify pre-2004 history
to agree with Shanks and Pottenger (2003), since we have no better info.
2012-11-25 18:57:05 -08:00
Arthur David Olson 5ccc5f314f * tz-art.htm: Add "Run by the Monkeys". 2012-11-25 18:49:36 -08:00
Arthur David Olson 8c7f3d45f2 New zones Asia/Khandyga, Asia/Ust-Nera.
* europe, zone.tab (Asia/Khandyga, Asia/Ust-Nera): New zones.
Original heads-up from Alexander Krivenyshev in
<http://mm.icann.org/pipermail/tz/2011-September/008798.html>
with additional comments by Sanjeev Gupta and Tobias Conradi.
2012-11-25 18:47:40 -08:00
Arthur David Olson 4aae6cb25c Fix two localtime.c bugs reported by Doug Bailey.
See <http://mm.icann.org/pipermail/tz/2012-July/018103.html>.
* localtime.c (settzname): Ensure that tzname values are set.
(tzload): Get proper behavior when the software is being run on an
unsigned-time_t system but is using data files generated on a
signed-time_t system.
2012-11-25 14:08:15 -08:00
Paul Eggert a435f9f0ec Make bug-reporting address more configurable.
Based on a patch by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018452.html>.
* Makefile (BUGEMAIL): New macro.
(version.h, tzselect): Use it to define REPORT_BUGS_TO.
* tzselect.ksh (REPORT_BUGS_TO): New variable, used for --help.
* zdump.c, zic.c (usage): Use REPORT_BUGS_TO for --help.
2012-11-12 21:52:35 -08:00
Paul Eggert dec96c09a2 Release tzcode2012j and tzdata2012j.
* Makefile (VERSION): Increase to 2012j.
2012j
2012-11-12 18:34:49 -08:00
Paul Eggert 4222458f3f FoxClocks update.
* tz-link.htm: Update FoxClocks info as per Andy McDonald
<http://mm.icann.org/pipermail/tz/2012-November/018458.html>.
2012-11-12 18:33:22 -08:00