Skip to content

Commit

Permalink
Update zoneinfo files to 2024b (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
devbww committed Sep 9, 2024
1 parent 8bdbd84 commit d139743
Show file tree
Hide file tree
Showing 39 changed files with 24 additions and 38 deletions.
41 changes: 15 additions & 26 deletions src/time_zone_lookup_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1325,35 +1325,24 @@ TEST(TimeZoneEdgeCase, AmericaJamaica) {
ExpectTime(tp, tz, 1983, 12, 31, 23, 59, 59, -5 * 3600, false, "EST");
}

TEST(TimeZoneEdgeCase, WET) {
// Cover some non-existent times within forward transitions.
const time_zone tz = LoadZone("WET");

// Before the first transition.
auto tp = convert(civil_second(1977, 1, 1, 0, 0, 0), tz);
ExpectTime(tp, tz, 1977, 1, 1, 0, 0, 0, 0, false, "WET");

// Over the first transition.
// 228877199 == Sun, 3 Apr 1977 00:59:59 +0000 (WET)
// 228877200 == Sun, 3 Apr 1977 02:00:00 +0100 (WEST)
tp = convert(civil_second(1977, 4, 3, 0, 59, 59), tz);
ExpectTime(tp, tz, 1977, 4, 3, 0, 59, 59, 0, false, "WET");
TEST(TimeZoneEdgeCase, EuropeLisbon) {
// Cover a non-existent time within a forward transition.
const time_zone tz = LoadZone("Europe/Lisbon");

// Over a forward transition.
// 354671999 == Sat, 28 Mar 1981 23:59:59 +0000 (WET)
// 354672000 == Sun, 29 Mar 1981 01:00:00 +0100 (WEST)
auto tp = convert(civil_second(1981, 3, 28, 23, 59, 59), tz);
ExpectTime(tp, tz, 1981, 3, 28, 23, 59, 59, 0, false, "WET");
tp += cctz::seconds(1);
ExpectTime(tp, tz, 1977, 4, 3, 2, 0, 0, 1 * 3600, true, "WEST");
ExpectTime(tp, tz, 1981, 3, 29, 1, 0, 0, 1 * 3600, true, "WEST");

// A non-existent time within the first transition.
time_zone::civil_lookup cl1 = tz.lookup(civil_second(1977, 4, 3, 1, 15, 0));
// A non-existent time within the transition.
time_zone::civil_lookup cl1 = tz.lookup(civil_second(1981, 3, 29, 0, 15, 0));
EXPECT_EQ(time_zone::civil_lookup::SKIPPED, cl1.kind);
ExpectTime(cl1.pre, tz, 1977, 4, 3, 2, 15, 0, 1 * 3600, true, "WEST");
ExpectTime(cl1.trans, tz, 1977, 4, 3, 2, 0, 0, 1 * 3600, true, "WEST");
ExpectTime(cl1.post, tz, 1977, 4, 3, 0, 15, 0, 0 * 3600, false, "WET");

// A non-existent time within the second forward transition.
time_zone::civil_lookup cl2 = tz.lookup(civil_second(1978, 4, 2, 1, 15, 0));
EXPECT_EQ(time_zone::civil_lookup::SKIPPED, cl2.kind);
ExpectTime(cl2.pre, tz, 1978, 4, 2, 2, 15, 0, 1 * 3600, true, "WEST");
ExpectTime(cl2.trans, tz, 1978, 4, 2, 2, 0, 0, 1 * 3600, true, "WEST");
ExpectTime(cl2.post, tz, 1978, 4, 2, 0, 15, 0, 0 * 3600, false, "WET");
ExpectTime(cl1.pre, tz, 1981, 3, 29, 1, 15, 0, 1 * 3600, true, "WEST");
ExpectTime(cl1.trans, tz, 1981, 3, 29, 1, 0, 0, 1 * 3600, true, "WEST");
ExpectTime(cl1.post, tz, 1981, 3, 28, 23, 15, 0, 0 * 3600, false, "WET");
}

TEST(TimeZoneEdgeCase, FixedOffsets) {
Expand Down
8 changes: 5 additions & 3 deletions src/tzfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ struct tzhead {
** If tzh_version is '2' or greater, the above is followed by a second instance
** of tzhead and a second instance of the data in which each coded transition
** time uses 8 rather than 4 chars,
** then a POSIX-TZ-environment-variable-style string for use in handling
** then a POSIX.1-2017 proleptic TZ string for use in handling
** instants after the last transition time stored in the file
** (with nothing between the newlines if there is no POSIX.1-2017
** representation for such instants).
**
** If tz_version is '3' or greater, the above is extended as follows.
** If tz_version is '3' or greater, the TZ string can be any POSIX.1-2024
** proleptic TZ string, which means the above is extended as follows.
** First, the TZ string's hour offset may range from -167
** through 167 as compared to the POSIX-required 0 through 24.
** through 167 as compared to the range 0 through 24 required
** by POSIX.1-2017 and earlier.
** Second, its DST start time may be January 1 at 00:00 and its stop
** time December 31 at 24:00 plus the difference between DST and
** standard time, indicating DST all year.
Expand Down
2 changes: 1 addition & 1 deletion testdata/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024a
2024b
Binary file modified testdata/zoneinfo/Africa/Maputo
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Bahia_Banderas
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Cancun
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Chihuahua
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Ciudad_Juarez
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Ensenada
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Hermosillo
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Mazatlan
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Merida
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Mexico_City
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Monterrey
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Ojinaga
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Santa_Isabel
Binary file not shown.
Binary file modified testdata/zoneinfo/America/Tijuana
Binary file not shown.
Binary file modified testdata/zoneinfo/Asia/Choibalsan
Binary file not shown.
Binary file modified testdata/zoneinfo/Asia/Dili
Binary file not shown.
Binary file modified testdata/zoneinfo/Atlantic/Azores
Binary file not shown.
Binary file modified testdata/zoneinfo/Atlantic/Madeira
Binary file not shown.
Binary file modified testdata/zoneinfo/CET
Binary file not shown.
Binary file modified testdata/zoneinfo/CST6CDT
Binary file not shown.
Binary file modified testdata/zoneinfo/EET
Binary file not shown.
Binary file modified testdata/zoneinfo/EST
Binary file not shown.
Binary file modified testdata/zoneinfo/EST5EDT
Binary file not shown.
Binary file modified testdata/zoneinfo/Europe/Lisbon
Binary file not shown.
Binary file modified testdata/zoneinfo/HST
Binary file not shown.
Binary file modified testdata/zoneinfo/MET
Binary file not shown.
Binary file modified testdata/zoneinfo/MST
Binary file not shown.
Binary file modified testdata/zoneinfo/MST7MDT
Binary file not shown.
Binary file modified testdata/zoneinfo/Mexico/BajaNorte
Binary file not shown.
Binary file modified testdata/zoneinfo/Mexico/BajaSur
Binary file not shown.
Binary file modified testdata/zoneinfo/Mexico/General
Binary file not shown.
Binary file modified testdata/zoneinfo/PST8PDT
Binary file not shown.
Binary file modified testdata/zoneinfo/Portugal
Binary file not shown.
Binary file modified testdata/zoneinfo/WET
Binary file not shown.
3 changes: 1 addition & 2 deletions testdata/zoneinfo/zone1970.tab
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ MD +4700+02850 Europe/Chisinau
MH +0905+16720 Pacific/Kwajalein Kwajalein
MM,CC +1647+09610 Asia/Yangon
MN +4755+10653 Asia/Ulaanbaatar most of Mongolia
MN +4801+09139 Asia/Hovd Bayan-Ölgii, Govi-Altai, Hovd, Uvs, Zavkhan
MN +4804+11430 Asia/Choibalsan Dornod, Sükhbaatar
MN +4801+09139 Asia/Hovd Bayan-Ölgii, Hovd, Uvs
MO +221150+1133230 Asia/Macau
MQ +1436-06105 America/Martinique
MT +3554+01431 Europe/Malta
Expand Down
8 changes: 2 additions & 6 deletions testdata/zoneinfo/zonenow.tab
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# From Paul Eggert (2023-12-18):
# This file contains a table where each row stands for a timezone
# where civil timestamps are predicted to agree from now on.
# This file is like zone1970.tab (see zone1970.tab's coments),
# This file is like zone1970.tab (see zone1970.tab's comments),
# but with the following changes:
#
# 1. Each timezone corresponds to a set of clocks that are planned
Expand Down Expand Up @@ -123,8 +123,6 @@ XX +1455-02331 Atlantic/Cape_Verde Cape Verde
#
# -01/+00 (EU DST)
XX +3744-02540 Atlantic/Azores Azores
# -01/+00 (EU DST) until 2024-03-31; then -02/-01 (EU DST)
XX +7029-02158 America/Scoresbysund Ittoqqortoormiit
#
# +00 - GMT
XX +0519-00402 Africa/Abidjan far western Africa; Iceland ("GMT")
Expand Down Expand Up @@ -199,7 +197,7 @@ XX +2518+05518 Asia/Dubai Russia; Caucasus; Persian Gulf; Seychelles; Réunion
XX +3431+06912 Asia/Kabul Afghanistan
#
# +05
XX +4120+06918 Asia/Tashkent Russia; west Kazakhstan; Tajikistan; Turkmenistan; Uzbekistan; Maldives
XX +4120+06918 Asia/Tashkent Russia; Kazakhstan; Tajikistan; Turkmenistan; Uzbekistan; Maldives
#
# +05 - PKT
XX +2452+06703 Asia/Karachi Pakistan ("PKT")
Expand All @@ -215,8 +213,6 @@ XX +2743+08519 Asia/Kathmandu Nepal
#
# +06
XX +2343+09025 Asia/Dhaka Russia; Kyrgyzstan; Bhutan; Bangladesh; Chagos
# +06 until 2024-03-01; then +05
XX +4315+07657 Asia/Almaty Kazakhstan (except western areas)
#
# +06:30
XX +1647+09610 Asia/Yangon Myanmar; Cocos
Expand Down

0 comments on commit d139743

Please sign in to comment.