]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Update our mapping of Windows time zone names using CLDR info.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Oct 2021 20:05:42 +0000 (16:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Oct 2021 20:06:55 +0000 (16:06 -0400)
This corrects a bunch of entries in win32_tzmap[], and adds a few
new ones, based on the CLDR project's windowsZones.xml file.
Non-cosmetic changes fall into four main categories:

* Flat-out errors:

US/Aleutan doesn't exist
America/Salvador doesn't exist
Asia/Baku is wrong for Yerevan
Asia/Dhaka (Bangladesh) is wrong for Astana (Kazakhstan)
Europe/Bucharest is wrong for Chisinau
America/Mexico_City is wrong for Chetumal
America/Buenos_Aires is wrong for Cayenne
America/Caracas has its own zone, so poor fit for La Paz
US/Eastern is wrong for Haiti
US/Eastern is wrong for Indiana (East)
Asia/Karachi is wrong for Tashkent
Etc/UTC+12 doesn't exist
Signs of Etc/GMT zones were backwards

* Judgment calls:

(These changes follow CLDR's choices, except for the first one)

Use Europe/London for "Greenwich Standard Time", since that seems much
more likely than Africa/Casablanca to be what people will think that
zone name means.  CLDR has Atlantic/Reykjavik here, but that's no better.

Asia/Shanghai seems a better fit than Hong Kong for "China Standard
Time".

Europe/Sarajevo is now a link to Belgrade, ie "Central Europe Standard
Time"; so use Warsaw for "Central European Standard Time".

America/Sao_Paulo seems more representative than Araguaina for
"E. South America Standard Time".

Africa/Johannesburg seems more representative than Harare for
"South Africa Standard Time".

* New Windows zone names:

"Israel Standard Time"
"Kaliningrad Standard Time"
"Russia Time Zone N" for various N
"Singapore Standard Time"
"South Sudan Standard Time"
"W. Central Africa Standard Time"
"West Bank Standard Time"
"Yukon Standard Time"

Some of these replace older spellings, but I kept the older spellings
too in case our code runs on a machine with the older data.

* Replace aliases (tzdb Links) with underlying city-named zones:

(This tracks tzdb's longstanding practice, and reduces inconsistency
with the rest of the entries, as well as with CLDR.)

US/Alaska
Asia/Kuwait
Asia/Muscat
Canada/Atlantic
Australia/Canberra
Canada/Saskatchewan
US/Central
US/Eastern
US/Hawaii
US/Mountain
Canada/Newfoundland
US/Pacific

Back-patch to all supported branches, as is our usual practice for
time zone data updates.

Discussion: https://postgr.es/m/3266414.1633045628@sss.pgh.pa.us

src/bin/initdb/findtimezone.c

index 733612e9ae73496c206f7e68ea24940cc920a467..0215fd0c3fa404674c066093259d247ab7b8f681 100644 (file)
@@ -736,10 +736,12 @@ static const struct
        /*
         * This list was built from the contents of the registry at
         * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
-        * Zones on Windows 7, Windows 10, and Windows Server 2019.
+        * Zones on Windows 7, Windows 10, and Windows Server 2019.  Some recent
+        * additions have been made by comparing to the CLDR project's
+        * windowsZones.xml file.
         *
-        * The zones have been matched to IANA timezones by looking at the cities
-        * listed in the win32 display name (in the comment here) in most cases.
+        * The zones have been matched to IANA timezones based on CLDR's mapping,
+        * with a few manual exceptions.
         */
        {
                /* (UTC+04:30) Kabul */
@@ -749,12 +751,12 @@ static const struct
        {
                /* (UTC-09:00) Alaska */
                "Alaskan Standard Time", "Alaskan Daylight Time",
-               "US/Alaska"
+               "America/Anchorage"
        },
        {
                /* (UTC-10:00) Aleutian Islands */
                "Aleutian Standard Time", "Aleutian Daylight Time",
-               "US/Aleutan"
+               "America/Adak"
        },
        {
                /* (UTC+07:00) Barnaul, Gorno-Altaysk */
@@ -764,12 +766,12 @@ static const struct
        {
                /* (UTC+03:00) Kuwait, Riyadh */
                "Arab Standard Time", "Arab Daylight Time",
-               "Asia/Kuwait"
+               "Asia/Riyadh"
        },
        {
                /* (UTC+04:00) Abu Dhabi, Muscat */
                "Arabian Standard Time", "Arabian Daylight Time",
-               "Asia/Muscat"
+               "Asia/Dubai"
        },
        {
                /* (UTC+03:00) Baghdad */
@@ -794,7 +796,7 @@ static const struct
        {
                /* (UTC-04:00) Atlantic Time (Canada) */
                "Atlantic Standard Time", "Atlantic Daylight Time",
-               "Canada/Atlantic"
+               "America/Halifax"
        },
        {
                /* (UTC+09:30) Darwin */
@@ -809,7 +811,7 @@ static const struct
        {
                /* (UTC+10:00) Canberra, Melbourne, Sydney */
                "AUS Eastern Standard Time", "AUS Eastern Daylight Time",
-               "Australia/Canberra"
+               "Australia/Sydney"
        },
        {
                /* (UTC+04:00) Baku */
@@ -824,7 +826,7 @@ static const struct
        {
                /* (UTC-03:00) Salvador */
                "Bahia Standard Time", "Bahia Daylight Time",
-               "America/Salvador"
+               "America/Bahia"
        },
        {
                /* (UTC+06:00) Dhaka */
@@ -849,7 +851,7 @@ static const struct
        {
                /* (UTC-06:00) Saskatchewan */
                "Canada Central Standard Time", "Canada Central Daylight Time",
-               "Canada/Saskatchewan"
+               "America/Regina"
        },
        {
                /* (UTC-01:00) Cape Verde Is. */
@@ -859,7 +861,7 @@ static const struct
        {
                /* (UTC+04:00) Yerevan */
                "Caucasus Standard Time", "Caucasus Daylight Time",
-               "Asia/Baku"
+               "Asia/Yerevan"
        },
        {
                /* (UTC+09:30) Adelaide */
@@ -875,7 +877,7 @@ static const struct
        {
                /* (UTC+06:00) Astana */
                "Central Asia Standard Time", "Central Asia Daylight Time",
-               "Asia/Dhaka"
+               "Asia/Almaty"
        },
        {
                /* (UTC-04:00) Cuiaba */
@@ -890,7 +892,7 @@ static const struct
        {
                /* (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb */
                "Central European Standard Time", "Central European Daylight Time",
-               "Europe/Sarajevo"
+               "Europe/Warsaw"
        },
        {
                /* (UTC+11:00) Solomon Is., New Caledonia */
@@ -900,7 +902,7 @@ static const struct
        {
                /* (UTC-06:00) Central Time (US & Canada) */
                "Central Standard Time", "Central Daylight Time",
-               "US/Central"
+               "America/Chicago"
        },
        {
                /* (UTC-06:00) Guadalajara, Mexico City, Monterrey */
@@ -915,7 +917,7 @@ static const struct
        {
                /* (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi */
                "China Standard Time", "China Daylight Time",
-               "Asia/Hong_Kong"
+               "Asia/Shanghai"
        },
        {
                /* (UTC) Coordinated Universal Time */
@@ -930,7 +932,7 @@ static const struct
        {
                /* (UTC-12:00) International Date Line West */
                "Dateline Standard Time", "Dateline Daylight Time",
-               "Etc/UTC+12"
+               "Etc/GMT+12"
        },
        {
                /* (UTC+03:00) Nairobi */
@@ -945,12 +947,12 @@ static const struct
        {
                /* (UTC+02:00) Chisinau */
                "E. Europe Standard Time", "E. Europe Daylight Time",
-               "Europe/Bucharest"
+               "Europe/Chisinau"
        },
        {
                /* (UTC-03:00) Brasilia */
                "E. South America Standard Time", "E. South America Daylight Time",
-               "America/Araguaina"
+               "America/Sao_Paulo"
        },
        {
                /* (UTC-06:00) Easter Island */
@@ -960,12 +962,12 @@ static const struct
        {
                /* (UTC-05:00) Eastern Time (US & Canada) */
                "Eastern Standard Time", "Eastern Daylight Time",
-               "US/Eastern"
+               "America/New_York"
        },
        {
                /* (UTC-05:00) Chetumal */
                "Eastern Standard Time (Mexico)", "Eastern Daylight Time (Mexico)",
-               "America/Mexico_City"
+               "America/Cancun"
        },
        {
                /* (UTC+02:00) Cairo */
@@ -974,7 +976,7 @@ static const struct
        },
        {
                /* (UTC+05:00) Ekaterinburg */
-               "Ekaterinburg Standard Time (RTZ 4)", "Ekaterinburg Daylight Time",
+               "Ekaterinburg Standard Time", "Ekaterinburg Daylight Time",
                "Asia/Yekaterinburg"
        },
        {
@@ -1003,9 +1005,15 @@ static const struct
                "America/Godthab"
        },
        {
+               /*
+                * Windows uses this zone name in various places that lie near the
+                * prime meridian, but are not in the UK.  However, most people
+                * probably think that "Greenwich" means UK civil time, or maybe even
+                * straight-up UTC.  Hence, map to Europe/London.
+                */
                /* (UTC+00:00) Monrovia, Reykjavik */
                "Greenwich Standard Time", "Greenwich Daylight Time",
-               "Africa/Casablanca"
+               "Europe/London"
        },
        {
                /* (UTC+02:00) Athens, Bucharest */
@@ -1015,12 +1023,12 @@ static const struct
        {
                /* (UTC-05:00) Haiti */
                "Haiti Standard Time", "Haiti Daylight Time",
-               "US/Eastern"
+               "America/Port-au-Prince"
        },
        {
                /* (UTC-10:00) Hawaii */
                "Hawaiian Standard Time", "Hawaiian Daylight Time",
-               "US/Hawaii"
+               "Pacific/Honolulu"
        },
        {
                /* (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi */
@@ -1034,6 +1042,11 @@ static const struct
        },
        {
                /* (UTC+02:00) Jerusalem */
+               "Israel Standard Time", "Israel Daylight Time",
+               "Asia/Jerusalem"
+       },
+       {
+               /* (UTC+02:00) Jerusalem (old spelling of zone name) */
                "Jerusalem Standard Time", "Jerusalem Daylight Time",
                "Asia/Jerusalem"
        },
@@ -1042,6 +1055,11 @@ static const struct
                "Jordan Standard Time", "Jordan Daylight Time",
                "Asia/Amman"
        },
+       {
+               /* (UTC+02:00) Kaliningrad */
+               "Kaliningrad Standard Time", "Kaliningrad Daylight Time",
+               "Europe/Kaliningrad"
+       },
        {
                /* (UTC+12:00) Petropavlovsk-Kamchatsky - Old */
                "Kamchatka Standard Time", "Kamchatka Daylight Time",
@@ -1125,7 +1143,7 @@ static const struct
        {
                /* (UTC-07:00) Mountain Time (US & Canada) */
                "Mountain Standard Time", "Mountain Daylight Time",
-               "US/Mountain"
+               "America/Denver"
        },
        {
                /* (UTC-07:00) Chihuahua, La Paz, Mazatlan */
@@ -1138,7 +1156,7 @@ static const struct
                "Asia/Rangoon"
        },
        {
-               /* (UTC+06:00) Novosibirsk (RTZ 5) */
+               /* (UTC+07:00) Novosibirsk */
                "N. Central Asia Standard Time", "N. Central Asia Daylight Time",
                "Asia/Novosibirsk"
        },
@@ -1160,7 +1178,7 @@ static const struct
        {
                /* (UTC-03:30) Newfoundland */
                "Newfoundland Standard Time", "Newfoundland Daylight Time",
-               "Canada/Newfoundland"
+               "America/St_Johns"
        },
        {
                /* (UTC+11:00) Norfolk Island */
@@ -1168,7 +1186,7 @@ static const struct
                "Pacific/Norfolk"
        },
        {
-               /* (UTC+08:00) Irkutsk, Ulaan Bataar */
+               /* (UTC+08:00) Irkutsk */
                "North Asia East Standard Time", "North Asia East Daylight Time",
                "Asia/Irkutsk"
        },
@@ -1200,7 +1218,7 @@ static const struct
        {
                /* (UTC-08:00) Pacific Time (US & Canada) */
                "Pacific Standard Time", "Pacific Daylight Time",
-               "US/Pacific"
+               "America/Los_Angeles"
        },
        {
                /* (UTC-08:00) Baja California */
@@ -1227,6 +1245,21 @@ static const struct
                "Romance Standard Time", "Romance Daylight Time",
                "Europe/Brussels"
        },
+       {
+               /* (UTC+04:00) Izhevsk, Samara */
+               "Russia Time Zone 3", "Russia Time Zone 3",
+               "Europe/Samara"
+       },
+       {
+               /* (UTC+11:00) Chokurdakh */
+               "Russia Time Zone 10", "Russia Time Zone 10",
+               "Asia/Srednekolymsk"
+       },
+       {
+               /* (UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky */
+               "Russia Time Zone 11", "Russia Time Zone 11",
+               "Asia/Kamchatka"
+       },
        {
                /* (UTC+02:00) Kaliningrad */
                "Russia TZ 1 Standard Time", "Russia TZ 1 Daylight Time",
@@ -1283,14 +1316,14 @@ static const struct
                "Asia/Anadyr"
        },
        {
-               /* (UTC+03:00) Moscow, St. Petersburg, Volgograd */
+               /* (UTC+03:00) Moscow, St. Petersburg */
                "Russian Standard Time", "Russian Daylight Time",
                "Europe/Moscow"
        },
        {
                /* (UTC-03:00) Cayenne, Fortaleza */
                "SA Eastern Standard Time", "SA Eastern Daylight Time",
-               "America/Buenos_Aires"
+               "America/Cayenne"
        },
        {
                /* (UTC-05:00) Bogota, Lima, Quito, Rio Branco */
@@ -1300,7 +1333,7 @@ static const struct
        {
                /* (UTC-04:00) Georgetown, La Paz, Manaus, San Juan */
                "SA Western Standard Time", "SA Western Daylight Time",
-               "America/Caracas"
+               "America/La_Paz"
        },
        {
                /* (UTC-03:00) Saint Pierre and Miquelon */
@@ -1332,10 +1365,20 @@ static const struct
                "SE Asia Standard Time", "SE Asia Daylight Time",
                "Asia/Bangkok"
        },
+       {
+               /* (UTC+08:00) Kuala Lumpur, Singapore */
+               "Singapore Standard Time", "Singapore Daylight Time",
+               "Asia/Singapore"
+       },
        {
                /* (UTC+02:00) Harare, Pretoria */
                "South Africa Standard Time", "South Africa Daylight Time",
-               "Africa/Harare"
+               "Africa/Johannesburg"
+       },
+       {
+               /* (UTC+02:00) Juba */
+               "South Sudan Standard Time", "South Sudan Daylight Time",
+               "Africa/Juba"
        },
        {
                /* (UTC+05:30) Sri Jayawardenepura */
@@ -1394,61 +1437,66 @@ static const struct
        },
        {
                /* (UTC-05:00) Turks and Caicos */
-               "Turks and Caicos Standard Time", "Turks and Caicos Daylight Time",
+               "Turks And Caicos Standard Time", "Turks And Caicos Daylight Time",
                "America/Grand_Turk"
        },
        {
                /* (UTC+08:00) Ulaanbaatar */
                "Ulaanbaatar Standard Time", "Ulaanbaatar Daylight Time",
-               "Asia/Ulaanbaatar",
+               "Asia/Ulaanbaatar"
        },
        {
                /* (UTC-05:00) Indiana (East) */
                "US Eastern Standard Time", "US Eastern Daylight Time",
-               "US/Eastern"
+               "America/Indianapolis"
        },
        {
                /* (UTC-07:00) Arizona */
                "US Mountain Standard Time", "US Mountain Daylight Time",
-               "US/Arizona"
+               "America/Phoenix"
+       },
+       {
+               /* (UTC) Coordinated Universal Time */
+               "UTC", "UTC",
+               "UTC"
        },
        {
                /* (UTC+12:00) Coordinated Universal Time+12 */
                "UTC+12", "UTC+12",
-               "Etc/GMT+12"
+               "Etc/GMT-12"
        },
        {
                /* (UTC+13:00) Coordinated Universal Time+13 */
                "UTC+13", "UTC+13",
-               "Etc/GMT+13"
+               "Etc/GMT-13"
        },
        {
                /* (UTC-02:00) Coordinated Universal Time-02 */
                "UTC-02", "UTC-02",
-               "Etc/GMT-02"
+               "Etc/GMT+2"
        },
        {
                /* (UTC-08:00) Coordinated Universal Time-08 */
                "UTC-08", "UTC-08",
-               "Etc/GMT-08"
+               "Etc/GMT+8"
        },
        {
                /* (UTC-09:00) Coordinated Universal Time-09 */
                "UTC-09", "UTC-09",
-               "Etc/GMT-09"
+               "Etc/GMT+9"
        },
        {
                /* (UTC-11:00) Coordinated Universal Time-11 */
                "UTC-11", "UTC-11",
-               "Etc/GMT-11"
+               "Etc/GMT+11"
        },
        {
                /* (UTC-04:00) Caracas */
                "Venezuela Standard Time", "Venezuela Daylight Time",
-               "America/Caracas",
+               "America/Caracas"
        },
        {
-               /* (UTC+10:00) Vladivostok (RTZ 9) */
+               /* (UTC+10:00) Vladivostok */
                "Vladivostok Standard Time", "Vladivostok Daylight Time",
                "Asia/Vladivostok"
        },
@@ -1462,14 +1510,11 @@ static const struct
                "W. Australia Standard Time", "W. Australia Daylight Time",
                "Australia/Perth"
        },
-#ifdef NOT_USED
-       /* Could not find a match for this one (just a guess). Excluded for now. */
        {
                /* (UTC+01:00) West Central Africa */
                "W. Central Africa Standard Time", "W. Central Africa Daylight Time",
-               "WAT"
+               "Africa/Lagos"
        },
-#endif
        {
                /* (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna */
                "W. Europe Standard Time", "W. Europe Daylight Time",
@@ -1483,13 +1528,18 @@ static const struct
        {
                /* (UTC+05:00) Ashgabat, Tashkent */
                "West Asia Standard Time", "West Asia Daylight Time",
-               "Asia/Karachi"
+               "Asia/Tashkent"
        },
        {
                /* (UTC+02:00) Gaza, Hebron */
                "West Bank Gaza Standard Time", "West Bank Gaza Daylight Time",
                "Asia/Gaza"
        },
+       {
+               /* (UTC+02:00) Gaza, Hebron */
+               "West Bank Standard Time", "West Bank Daylight Time",
+               "Asia/Hebron"
+       },
        {
                /* (UTC+10:00) Guam, Port Moresby */
                "West Pacific Standard Time", "West Pacific Daylight Time",
@@ -1500,6 +1550,11 @@ static const struct
                "Yakutsk Standard Time", "Yakutsk Daylight Time",
                "Asia/Yakutsk"
        },
+       {
+               /* (UTC-07:00) Yukon */
+               "Yukon Standard Time", "Yukon Daylight Time",
+               "America/Whitehorse"
+       },
        {
                NULL, NULL, NULL
        }