diff --git a/src/time_zone_lookup_test.cc b/src/time_zone_lookup_test.cc index 700a1a1..942148d 100644 --- a/src/time_zone_lookup_test.cc +++ b/src/time_zone_lookup_test.cc @@ -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) { diff --git a/src/tzfile.h b/src/tzfile.h index 3155010..b154146 100644 --- a/src/tzfile.h +++ b/src/tzfile.h @@ -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. diff --git a/testdata/version b/testdata/version index 04fe674..699e50d 100644 --- a/testdata/version +++ b/testdata/version @@ -1 +1 @@ -2024a +2024b diff --git a/testdata/zoneinfo/Africa/Maputo b/testdata/zoneinfo/Africa/Maputo index 651e5cf..581bb0e 100644 Binary files a/testdata/zoneinfo/Africa/Maputo and b/testdata/zoneinfo/Africa/Maputo differ diff --git a/testdata/zoneinfo/America/Bahia_Banderas b/testdata/zoneinfo/America/Bahia_Banderas index 48faea2..882400b 100644 Binary files a/testdata/zoneinfo/America/Bahia_Banderas and b/testdata/zoneinfo/America/Bahia_Banderas differ diff --git a/testdata/zoneinfo/America/Cancun b/testdata/zoneinfo/America/Cancun index 640b259..3110cdf 100644 Binary files a/testdata/zoneinfo/America/Cancun and b/testdata/zoneinfo/America/Cancun differ diff --git a/testdata/zoneinfo/America/Chihuahua b/testdata/zoneinfo/America/Chihuahua index 5e0a54f..f65bb1c 100644 Binary files a/testdata/zoneinfo/America/Chihuahua and b/testdata/zoneinfo/America/Chihuahua differ diff --git a/testdata/zoneinfo/America/Ciudad_Juarez b/testdata/zoneinfo/America/Ciudad_Juarez index f636ee6..5f865ea 100644 Binary files a/testdata/zoneinfo/America/Ciudad_Juarez and b/testdata/zoneinfo/America/Ciudad_Juarez differ diff --git a/testdata/zoneinfo/America/Ensenada b/testdata/zoneinfo/America/Ensenada index 42087af..18d0d14 100644 Binary files a/testdata/zoneinfo/America/Ensenada and b/testdata/zoneinfo/America/Ensenada differ diff --git a/testdata/zoneinfo/America/Hermosillo b/testdata/zoneinfo/America/Hermosillo index 5c92e29..ba7b147 100644 Binary files a/testdata/zoneinfo/America/Hermosillo and b/testdata/zoneinfo/America/Hermosillo differ diff --git a/testdata/zoneinfo/America/Mazatlan b/testdata/zoneinfo/America/Mazatlan index 97d4d36..5aa6039 100644 Binary files a/testdata/zoneinfo/America/Mazatlan and b/testdata/zoneinfo/America/Mazatlan differ diff --git a/testdata/zoneinfo/America/Merida b/testdata/zoneinfo/America/Merida index e5de113..e5c7d8c 100644 Binary files a/testdata/zoneinfo/America/Merida and b/testdata/zoneinfo/America/Merida differ diff --git a/testdata/zoneinfo/America/Mexico_City b/testdata/zoneinfo/America/Mexico_City index 80a415c..1811234 100644 Binary files a/testdata/zoneinfo/America/Mexico_City and b/testdata/zoneinfo/America/Mexico_City differ diff --git a/testdata/zoneinfo/America/Monterrey b/testdata/zoneinfo/America/Monterrey index a5822e2..c1e0546 100644 Binary files a/testdata/zoneinfo/America/Monterrey and b/testdata/zoneinfo/America/Monterrey differ diff --git a/testdata/zoneinfo/America/Ojinaga b/testdata/zoneinfo/America/Ojinaga index f7e40c0..1dd08b1 100644 Binary files a/testdata/zoneinfo/America/Ojinaga and b/testdata/zoneinfo/America/Ojinaga differ diff --git a/testdata/zoneinfo/America/Santa_Isabel b/testdata/zoneinfo/America/Santa_Isabel index 42087af..18d0d14 100644 Binary files a/testdata/zoneinfo/America/Santa_Isabel and b/testdata/zoneinfo/America/Santa_Isabel differ diff --git a/testdata/zoneinfo/America/Tijuana b/testdata/zoneinfo/America/Tijuana index 42087af..18d0d14 100644 Binary files a/testdata/zoneinfo/America/Tijuana and b/testdata/zoneinfo/America/Tijuana differ diff --git a/testdata/zoneinfo/Asia/Choibalsan b/testdata/zoneinfo/Asia/Choibalsan index 0a948c2..6f5d3a1 100644 Binary files a/testdata/zoneinfo/Asia/Choibalsan and b/testdata/zoneinfo/Asia/Choibalsan differ diff --git a/testdata/zoneinfo/Asia/Dili b/testdata/zoneinfo/Asia/Dili index bb7be9f..22e705c 100644 Binary files a/testdata/zoneinfo/Asia/Dili and b/testdata/zoneinfo/Asia/Dili differ diff --git a/testdata/zoneinfo/Atlantic/Azores b/testdata/zoneinfo/Atlantic/Azores index e6e2616..cda1c1d 100644 Binary files a/testdata/zoneinfo/Atlantic/Azores and b/testdata/zoneinfo/Atlantic/Azores differ diff --git a/testdata/zoneinfo/Atlantic/Madeira b/testdata/zoneinfo/Atlantic/Madeira index cf965c3..21e8457 100644 Binary files a/testdata/zoneinfo/Atlantic/Madeira and b/testdata/zoneinfo/Atlantic/Madeira differ diff --git a/testdata/zoneinfo/CET b/testdata/zoneinfo/CET index 546748d..3197327 100644 Binary files a/testdata/zoneinfo/CET and b/testdata/zoneinfo/CET differ diff --git a/testdata/zoneinfo/CST6CDT b/testdata/zoneinfo/CST6CDT index d931558..b016880 100644 Binary files a/testdata/zoneinfo/CST6CDT and b/testdata/zoneinfo/CST6CDT differ diff --git a/testdata/zoneinfo/EET b/testdata/zoneinfo/EET index 378919e..231bf9c 100644 Binary files a/testdata/zoneinfo/EET and b/testdata/zoneinfo/EET differ diff --git a/testdata/zoneinfo/EST b/testdata/zoneinfo/EST index 3ae9691..9154643 100644 Binary files a/testdata/zoneinfo/EST and b/testdata/zoneinfo/EST differ diff --git a/testdata/zoneinfo/EST5EDT b/testdata/zoneinfo/EST5EDT index 50c95e0..2b6c2ee 100644 Binary files a/testdata/zoneinfo/EST5EDT and b/testdata/zoneinfo/EST5EDT differ diff --git a/testdata/zoneinfo/Europe/Lisbon b/testdata/zoneinfo/Europe/Lisbon index f0c70b6..7e9aae7 100644 Binary files a/testdata/zoneinfo/Europe/Lisbon and b/testdata/zoneinfo/Europe/Lisbon differ diff --git a/testdata/zoneinfo/HST b/testdata/zoneinfo/HST index 160a53e..40e3d49 100644 Binary files a/testdata/zoneinfo/HST and b/testdata/zoneinfo/HST differ diff --git a/testdata/zoneinfo/MET b/testdata/zoneinfo/MET index 6f0558c..3197327 100644 Binary files a/testdata/zoneinfo/MET and b/testdata/zoneinfo/MET differ diff --git a/testdata/zoneinfo/MST b/testdata/zoneinfo/MST index a0953d1..c2bd2f9 100644 Binary files a/testdata/zoneinfo/MST and b/testdata/zoneinfo/MST differ diff --git a/testdata/zoneinfo/MST7MDT b/testdata/zoneinfo/MST7MDT index 137867c..09e54e5 100644 Binary files a/testdata/zoneinfo/MST7MDT and b/testdata/zoneinfo/MST7MDT differ diff --git a/testdata/zoneinfo/Mexico/BajaNorte b/testdata/zoneinfo/Mexico/BajaNorte index 42087af..18d0d14 100644 Binary files a/testdata/zoneinfo/Mexico/BajaNorte and b/testdata/zoneinfo/Mexico/BajaNorte differ diff --git a/testdata/zoneinfo/Mexico/BajaSur b/testdata/zoneinfo/Mexico/BajaSur index 97d4d36..5aa6039 100644 Binary files a/testdata/zoneinfo/Mexico/BajaSur and b/testdata/zoneinfo/Mexico/BajaSur differ diff --git a/testdata/zoneinfo/Mexico/General b/testdata/zoneinfo/Mexico/General index 80a415c..1811234 100644 Binary files a/testdata/zoneinfo/Mexico/General and b/testdata/zoneinfo/Mexico/General differ diff --git a/testdata/zoneinfo/PST8PDT b/testdata/zoneinfo/PST8PDT index fde4833..aaf0778 100644 Binary files a/testdata/zoneinfo/PST8PDT and b/testdata/zoneinfo/PST8PDT differ diff --git a/testdata/zoneinfo/Portugal b/testdata/zoneinfo/Portugal index f0c70b6..7e9aae7 100644 Binary files a/testdata/zoneinfo/Portugal and b/testdata/zoneinfo/Portugal differ diff --git a/testdata/zoneinfo/WET b/testdata/zoneinfo/WET index 423c6c2..7e9aae7 100644 Binary files a/testdata/zoneinfo/WET and b/testdata/zoneinfo/WET differ diff --git a/testdata/zoneinfo/zone1970.tab b/testdata/zoneinfo/zone1970.tab index abd9489..7726f39 100644 --- a/testdata/zoneinfo/zone1970.tab +++ b/testdata/zoneinfo/zone1970.tab @@ -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 diff --git a/testdata/zoneinfo/zonenow.tab b/testdata/zoneinfo/zonenow.tab index b6f2910..01f536b 100644 --- a/testdata/zoneinfo/zonenow.tab +++ b/testdata/zoneinfo/zonenow.tab @@ -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 @@ -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") @@ -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") @@ -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