diff --git a/Cargo.lock b/Cargo.lock index 6b1758610a670..32e4d9208a687 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2053,8 +2053,7 @@ dependencies = [ [[package]] name = "chrono-tz" version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3" +source = "git+https://github.com/MaterializeInc/chrono-tz.git?rev=5999cdd1b971694f834ec3467d11ef9147fc297c#5999cdd1b971694f834ec3467d11ef9147fc297c" dependencies = [ "chrono", "chrono-tz-build", @@ -2066,8 +2065,7 @@ dependencies = [ [[package]] name = "chrono-tz-build" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d8d1efd5109b9c1cd3b7966bd071cdfb53bb6eb0b22a473a68c2f70a11a1eb" +source = "git+https://github.com/MaterializeInc/chrono-tz.git?rev=5999cdd1b971694f834ec3467d11ef9147fc297c#5999cdd1b971694f834ec3467d11ef9147fc297c" dependencies = [ "parse-zoneinfo", "phf_codegen 0.12.1", @@ -10030,8 +10028,7 @@ dependencies = [ [[package]] name = "parse-zoneinfo" version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c406c9e2aa74554e662d2c2ee11cd3e73756988800be7e6f5eddb16fed4699" +source = "git+https://github.com/MaterializeInc/chrono-tz.git?rev=5999cdd1b971694f834ec3467d11ef9147fc297c#5999cdd1b971694f834ec3467d11ef9147fc297c" [[package]] name = "paste" diff --git a/Cargo.toml b/Cargo.toml index 41bdd81398750..97f71cb67ac9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -650,6 +650,12 @@ postgres-types = { git = "https://github.com/MaterializeInc/rust-postgres" } postgres-openssl = { git = "https://github.com/MaterializeInc/rust-postgres" } postgres_array = { git = "https://github.com/MaterializeInc/rust-postgres-array" } +# Upstream chrono-tz is unmaintained and stops at tzdata 2025b. The fork's +# `mz_changes` branch carries current IANA data only, no code changes. To bump +# tzdata, update the fork, then follow the bump ceremony documented in +# src/environmentd/tests/testdata/timezones/regenerate.sh. +chrono-tz = { git = "https://github.com/MaterializeInc/chrono-tz.git", rev = "5999cdd1b971694f834ec3467d11ef9147fc297c" } + # Waiting on https://github.com/MaterializeInc/serde-value/pull/35. serde-value = { git = "https://github.com/MaterializeInc/serde-value.git" } diff --git a/src/environmentd/tests/testdata/timezones/names-2026-12-15.csv b/src/environmentd/tests/testdata/timezones/names-2026-12-15.csv index f74cbc1d46d22..a70d1bcb76355 100644 --- a/src/environmentd/tests/testdata/timezones/names-2026-12-15.csv +++ b/src/environmentd/tests/testdata/timezones/names-2026-12-15.csv @@ -12,14 +12,14 @@ Africa/Blantyre,CAT,02:00:00,f Africa/Brazzaville,WAT,01:00:00,f Africa/Bujumbura,CAT,02:00:00,f Africa/Cairo,EET,02:00:00,f -Africa/Casablanca,+01,01:00:00,f +Africa/Casablanca,+00,00:00:00,f Africa/Ceuta,CET,01:00:00,f Africa/Conakry,GMT,00:00:00,f Africa/Dakar,GMT,00:00:00,f Africa/Dar_es_Salaam,EAT,03:00:00,f Africa/Djibouti,EAT,03:00:00,f Africa/Douala,WAT,01:00:00,f -Africa/El_Aaiun,+01,01:00:00,f +Africa/El_Aaiun,+00,00:00:00,f Africa/Freetown,GMT,00:00:00,f Africa/Gaborone,CAT,02:00:00,f Africa/Harare,CAT,02:00:00,f @@ -107,7 +107,7 @@ America/Dawson_Creek,MST,-07:00:00,f America/Denver,MST,-07:00:00,f America/Detroit,EST,-05:00:00,f America/Dominica,AST,-04:00:00,f -America/Edmonton,MST,-07:00:00,f +America/Edmonton,CST,-06:00:00,f America/Eirunepe,-05,-05:00:00,f America/El_Salvador,CST,-06:00:00,f America/Ensenada,PST,-08:00:00,f @@ -215,12 +215,12 @@ America/Thunder_Bay,EST,-05:00:00,f America/Tijuana,PST,-08:00:00,f America/Toronto,EST,-05:00:00,f America/Tortola,AST,-04:00:00,f -America/Vancouver,PST,-08:00:00,f +America/Vancouver,MST,-07:00:00,f America/Virgin,AST,-04:00:00,f America/Whitehorse,MST,-07:00:00,f America/Winnipeg,CST,-06:00:00,f America/Yakutat,AKST,-09:00:00,f -America/Yellowknife,MST,-07:00:00,f +America/Yellowknife,CST,-06:00:00,f Antarctica/Casey,+08,08:00:00,f Antarctica/Davis,+07,07:00:00,f Antarctica/DumontDUrville,+10,10:00:00,f @@ -375,9 +375,9 @@ Brazil/West,-04,-04:00:00,f Canada/Atlantic,AST,-04:00:00,f Canada/Central,CST,-06:00:00,f Canada/Eastern,EST,-05:00:00,f -Canada/Mountain,MST,-07:00:00,f +Canada/Mountain,CST,-06:00:00,f Canada/Newfoundland,NST,-03:30:00,f -Canada/Pacific,PST,-08:00:00,f +Canada/Pacific,MST,-07:00:00,f Canada/Saskatchewan,CST,-06:00:00,f Canada/Yukon,MST,-07:00:00,f CET,CET,01:00:00,f diff --git a/src/environmentd/tests/testdata/timezones/regenerate.sh b/src/environmentd/tests/testdata/timezones/regenerate.sh index a1cae366cff29..6d0013dccbb9d 100755 --- a/src/environmentd/tests/testdata/timezones/regenerate.sh +++ b/src/environmentd/tests/testdata/timezones/regenerate.sh @@ -29,7 +29,7 @@ set -euo pipefail cd "$(dirname "$0")" -EXPECTED_TZDATA=2025b +EXPECTED_TZDATA=2026c IMAGE=mz-timezone-snapshot DATES=("$@") diff --git a/test/sqllogictest/timezone.slt b/test/sqllogictest/timezone.slt index 53026cadaa1cf..1c53b705565ad 100644 --- a/test/sqllogictest/timezone.slt +++ b/test/sqllogictest/timezone.slt @@ -358,6 +358,44 @@ SELECT timezone_offset('Asia/Almaty', '2026-07-15 00:00:00 UTC'), timezone_offse (+05,05:00:00,00:00:00) (EEST,02:00:00,01:00:00) +# Zones whose rules changed in tzdata 2025c through 2026c: Morocco moved to +# permanent +00 on 2026-09-20, Alberta and British Columbia abolished DST on +# their 2026 fall-back dates and keep the summer offset, and Moldova follows +# EU transition instants. Both Canadian zones now render a neighbouring +# region's standard-time abbreviation for their permanent offset. + +statement ok +SET unsafe_new_transaction_wall_time = '2026-12-15 00:00:00 UTC'; + +query TTTT +SELECT * FROM pg_catalog.pg_timezone_names +WHERE name IN ('Africa/Casablanca', 'America/Edmonton', 'America/Vancouver', 'Europe/Chisinau') +ORDER BY name +---- +Africa/Casablanca ++00 +00:00:00 +false +America/Edmonton +CST +-06:00:00 +false +America/Vancouver +MST +-07:00:00 +false +Europe/Chisinau +EET +02:00:00 +false + +query TTT +SELECT timezone_offset('Africa/Casablanca', '2026-09-21 00:00:00 UTC'), timezone_offset('America/Edmonton', '2026-11-15 00:00:00 UTC'), timezone_offset('America/Vancouver', '2026-11-15 00:00:00 UTC') +---- +(+00,00:00:00,00:00:00) +(CST,-06:00:00,00:00:00) +(MST,-07:00:00,00:00:00) + # These pin historical rules: a timestamp from before a zone's rule change # must resolve under the rules in force at that instant, not current rules. @@ -385,3 +423,22 @@ query T SELECT timezone_offset('Asia/Choibalsan', '1995-06-15 00:00:00 UTC') ---- (+09,08:00:00,01:00:00) + +# Moldova has switched at the EU instant, 01:00 UTC, since 2022. Older data +# had it one hour earlier, so for one hour around each transition the two +# disagree. This asserts the current belief about the past. If a data update +# breaks it, IANA rewrote history. + +query T +SELECT timezone_offset('Europe/Chisinau', '2023-03-26 00:30:00 UTC') +---- +(EET,02:00:00,00:00:00) + +# Baja California observed DST in 1953 and 1961 through 1975, following +# California, where earlier data had none. This asserts the current belief +# about the past. If a data update breaks it, IANA rewrote history. + +query T +SELECT timezone_offset('America/Tijuana', '1970-07-15 12:00:00 UTC') +---- +(PDT,-08:00:00,01:00:00)