當你在 Azure 使用 App Service 部署網站時,預設的時區是設定在 UTC 時間,當你的網站不需要處理跨時區的問題時,最簡單的解法,當然就是調整系統設定,讓你的程式可以直接讀取到台灣時區的時間 (UTC+8),原本我們都設定的好好的,但上周突然決定要改用以 Linux 為主的 App Service Plan,這才發現時區設定失效了,查詢後才發現原來設定不同!這篇文章我將說明如何正確的調整 App Service 的時區設定。
在 Windows 變更時區的方法
如果你今天執行的是一台 VM 或是本機 Windows 電腦,在 Windows 作業系統中預設內建一個 tzutil 工具,可以幫助你列出完整的可用時區列表與時區名稱,使用方式如下:
tzutil /l
(UTC-12:00) International Date Line West
Dateline Standard Time
(UTC-11:00) Coordinated Universal Time-11
UTC-11
(UTC-10:00) Aleutian Islands
Aleutian Standard Time
(UTC-10:00) Hawaii
Hawaiian Standard Time
(UTC-09:30) Marquesas Islands
Marquesas Standard Time
(UTC-09:00) Alaska
Alaskan Standard Time
(UTC-09:00) Coordinated Universal Time-09
UTC-09
(UTC-08:00) Baja California
Pacific Standard Time (Mexico)
(UTC-08:00) Coordinated Universal Time-08
UTC-08
(UTC-08:00) Pacific Time (US & Canada)
Pacific Standard Time
(UTC-07:00) Arizona
US Mountain Standard Time
(UTC-07:00) Chihuahua, La Paz, Mazatlan
Mountain Standard Time (Mexico)
(UTC-07:00) Mountain Time (US & Canada)
Mountain Standard Time
(UTC-07:00) Yukon
Yukon Standard Time
(UTC-06:00) Central America
Central America Standard Time
(UTC-06:00) Central Time (US & Canada)
Central Standard Time
(UTC-06:00) Easter Island
Easter Island Standard Time
(UTC-06:00) Guadalajara, Mexico City, Monterrey
Central Standard Time (Mexico)
(UTC-06:00) Saskatchewan
Canada Central Standard Time
(UTC-05:00) Bogota, Lima, Quito, Rio Branco
SA Pacific Standard Time
(UTC-05:00) Chetumal
Eastern Standard Time (Mexico)
(UTC-05:00) Eastern Time (US & Canada)
Eastern Standard Time
(UTC-05:00) Haiti
Haiti Standard Time
(UTC-05:00) Havana
Cuba Standard Time
(UTC-05:00) Indiana (East)
US Eastern Standard Time
(UTC-05:00) Turks and Caicos
Turks And Caicos Standard Time
(UTC-04:00) Asuncion
Paraguay Standard Time
(UTC-04:00) Atlantic Time (Canada)
Atlantic Standard Time
(UTC-04:00) Caracas
Venezuela Standard Time
(UTC-04:00) Cuiaba
Central Brazilian Standard Time
(UTC-04:00) Georgetown, La Paz, Manaus, San Juan
SA Western Standard Time
(UTC-04:00) Santiago
Pacific SA Standard Time
(UTC-03:30) Newfoundland
Newfoundland Standard Time
(UTC-03:00) Araguaina
Tocantins Standard Time
(UTC-03:00) Brasilia
E. South America Standard Time
(UTC-03:00) Cayenne, Fortaleza
SA Eastern Standard Time
(UTC-03:00) City of Buenos Aires
Argentina Standard Time
(UTC-03:00) Greenland
Greenland Standard Time
(UTC-03:00) Montevideo
Montevideo Standard Time
(UTC-03:00) Punta Arenas
Magallanes Standard Time
(UTC-03:00) Saint Pierre and Miquelon
Saint Pierre Standard Time
(UTC-03:00) Salvador
Bahia Standard Time
(UTC-02:00) Coordinated Universal Time-02
UTC-02
(UTC-01:00) Azores
Azores Standard Time
(UTC-01:00) Cabo Verde Is.
Cape Verde Standard Time
(UTC) Coordinated Universal Time
UTC
(UTC+00:00) Dublin, Edinburgh, Lisbon, London
GMT Standard Time
(UTC+00:00) Monrovia, Reykjavik
Greenwich Standard Time
(UTC+00:00) Sao Tome
Sao Tome Standard Time
(UTC+01:00) Casablanca
Morocco Standard Time
(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
W. Europe Standard Time
(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
Central Europe Standard Time
(UTC+01:00) Brussels, Copenhagen, Madrid, Paris
Romance Standard Time
(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
Central European Standard Time
(UTC+01:00) West Central Africa
W. Central Africa Standard Time
(UTC+02:00) Amman
Jordan Standard Time
(UTC+02:00) Athens, Bucharest
GTB Standard Time
(UTC+02:00) Beirut
Middle East Standard Time
(UTC+02:00) Cairo
Egypt Standard Time
(UTC+02:00) Chisinau
E. Europe Standard Time
(UTC+02:00) Damascus
Syria Standard Time
(UTC+02:00) Gaza, Hebron
West Bank Standard Time
(UTC+02:00) Harare, Pretoria
South Africa Standard Time
(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
FLE Standard Time
(UTC+02:00) Jerusalem
Israel Standard Time
(UTC+02:00) Juba
South Sudan Standard Time
(UTC+02:00) Kaliningrad
Kaliningrad Standard Time
(UTC+02:00) Khartoum
Sudan Standard Time
(UTC+02:00) Tripoli
Libya Standard Time
(UTC+02:00) Windhoek
Namibia Standard Time
(UTC+03:00) Baghdad
Arabic Standard Time
(UTC+03:00) Istanbul
Turkey Standard Time
(UTC+03:00) Kuwait, Riyadh
Arab Standard Time
(UTC+03:00) Minsk
Belarus Standard Time
(UTC+03:00) Moscow, St. Petersburg
Russian Standard Time
(UTC+03:00) Nairobi
E. Africa Standard Time
(UTC+03:00) Volgograd
Volgograd Standard Time
(UTC+03:30) Tehran
Iran Standard Time
(UTC+04:00) Abu Dhabi, Muscat
Arabian Standard Time
(UTC+04:00) Astrakhan, Ulyanovsk
Astrakhan Standard Time
(UTC+04:00) Baku
Azerbaijan Standard Time
(UTC+04:00) Izhevsk, Samara
Russia Time Zone 3
(UTC+04:00) Port Louis
Mauritius Standard Time
(UTC+04:00) Saratov
Saratov Standard Time
(UTC+04:00) Tbilisi
Georgian Standard Time
(UTC+04:00) Yerevan
Caucasus Standard Time
(UTC+04:30) Kabul
Afghanistan Standard Time
(UTC+05:00) Ashgabat, Tashkent
West Asia Standard Time
(UTC+05:00) Ekaterinburg
Ekaterinburg Standard Time
(UTC+05:00) Islamabad, Karachi
Pakistan Standard Time
(UTC+05:00) Qyzylorda
Qyzylorda Standard Time
(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
India Standard Time
(UTC+05:30) Sri Jayawardenepura
Sri Lanka Standard Time
(UTC+05:45) Kathmandu
Nepal Standard Time
(UTC+06:00) Astana
Central Asia Standard Time
(UTC+06:00) Dhaka
Bangladesh Standard Time
(UTC+06:00) Omsk
Omsk Standard Time
(UTC+06:30) Yangon (Rangoon)
Myanmar Standard Time
(UTC+07:00) Bangkok, Hanoi, Jakarta
SE Asia Standard Time
(UTC+07:00) Barnaul, Gorno-Altaysk
Altai Standard Time
(UTC+07:00) Hovd
W. Mongolia Standard Time
(UTC+07:00) Krasnoyarsk
North Asia Standard Time
(UTC+07:00) Novosibirsk
N. Central Asia Standard Time
(UTC+07:00) Tomsk
Tomsk Standard Time
(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
China Standard Time
(UTC+08:00) Irkutsk
North Asia East Standard Time
(UTC+08:00) Kuala Lumpur, Singapore
Singapore Standard Time
(UTC+08:00) Perth
W. Australia Standard Time
(UTC+08:00) Taipei
Taipei Standard Time
(UTC+08:00) Ulaanbaatar
Ulaanbaatar Standard Time
(UTC+08:45) Eucla
Aus Central W. Standard Time
(UTC+09:00) Chita
Transbaikal Standard Time
(UTC+09:00) Osaka, Sapporo, Tokyo
Tokyo Standard Time
(UTC+09:00) Pyongyang
North Korea Standard Time
(UTC+09:00) Seoul
Korea Standard Time
(UTC+09:00) Yakutsk
Yakutsk Standard Time
(UTC+09:30) Adelaide
Cen. Australia Standard Time
(UTC+09:30) Darwin
AUS Central Standard Time
(UTC+10:00) Brisbane
E. Australia Standard Time
(UTC+10:00) Canberra, Melbourne, Sydney
AUS Eastern Standard Time
(UTC+10:00) Guam, Port Moresby
West Pacific Standard Time
(UTC+10:00) Hobart
Tasmania Standard Time
(UTC+10:00) Vladivostok
Vladivostok Standard Time
(UTC+10:30) Lord Howe Island
Lord Howe Standard Time
(UTC+11:00) Bougainville Island
Bougainville Standard Time
(UTC+11:00) Chokurdakh
Russia Time Zone 10
(UTC+11:00) Magadan
Magadan Standard Time
(UTC+11:00) Norfolk Island
Norfolk Standard Time
(UTC+11:00) Sakhalin
Sakhalin Standard Time
(UTC+11:00) Solomon Is., New Caledonia
Central Pacific Standard Time
(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky
Russia Time Zone 11
(UTC+12:00) Auckland, Wellington
New Zealand Standard Time
(UTC+12:00) Coordinated Universal Time+12
UTC+12
(UTC+12:00) Fiji
Fiji Standard Time
(UTC+12:45) Chatham Islands
Chatham Islands Standard Time
(UTC+13:00) Coordinated Universal Time+13
UTC+13
(UTC+13:00) Nuku'alofa
Tonga Standard Time
(UTC+13:00) Samoa
Samoa Standard Time
(UTC+14:00) Kiritimati Island
Line Islands Standard Time
台灣這邊的時區名稱為 Taipei Standard Time
(台北標準時間),所以如果要用命令列去設定目前使用的時區,可以這樣執行:
tzutil /s "Taipei Standard Time"
取得目前時區的命令為:
tzutil /g
在 App Service on Windows 變更時區的方法
你只要在 App Service 的 應用程式設定 (Application settings) 加入一個 WEBSITE_TIME_ZONE
組態,並且將值設定正確就可以調整完成。
這裡你必須使用 tzutil /l
列出的可用時區名稱,台灣這邊的時區就是 Taipei Standard Time
!
以下是透過 Azure CLI 設定時區的方法:
az webapp config appsettings set -g '資源群組名稱' -n '資源名稱' --settings 'WEBSITE_TIME_ZONE=Taipei Standard Time'
以下是透過 Azure CLI 刪除時區設定的方法:
az webapp config appsettings set -g '資源群組名稱' -n '資源名稱' --setting-names 'WEBSITE_TIME_ZONE'
在 App Service on Linux 變更時區的方法
你只要在 App Service 的 應用程式設定 (Application settings) 加入一個 TZ
組態,並且將值設定正確就可以調整完成。
這裡你必須從 List of tz database time zones 查到 TZ database name (時區資料庫名稱) 來當成 Linux 下可用的時區名稱,這部分跟 App Service on Windows 不太一樣,有點雷,真的遇到才知道。,台灣這邊的時區就是 Asia/Taipei
!
如果你手邊有 Linux 可以用,是可以透過以下命令找出時區資料庫的名稱清單:
timedatectl list-timezones
timedatectl list-timezones | grep Taipei
以下所全部列出,方便大家直接搜尋:
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Juba
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lubumbashi
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Timbuktu
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Adak
America/Anchorage
America/Anguilla
America/Antigua
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Jujuy
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/Salta
America/Argentina/San_Juan
America/Argentina/San_Luis
America/Argentina/Tucuman
America/Argentina/Ushuaia
America/Aruba
America/Asuncion
America/Atikokan
America/Atka
America/Bahia
America/Bahia_Banderas
America/Barbados
America/Belem
America/Belize
America/Blanc-Sablon
America/Boa_Vista
America/Bogota
America/Boise
America/Buenos_Aires
America/Cambridge_Bay
America/Campo_Grande
America/Cancun
America/Caracas
America/Catamarca
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Coral_Harbour
America/Cordoba
America/Costa_Rica
America/Creston
America/Cuiaba
America/Curacao
America/Danmarkshavn
America/Dawson
America/Dawson_Creek
America/Denver
America/Detroit
America/Dominica
America/Edmonton
America/Eirunepe
America/El_Salvador
America/Ensenada
America/Fort_Nelson
America/Fort_Wayne
America/Fortaleza
America/Glace_Bay
America/Godthab
America/Goose_Bay
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Hermosillo
America/Indiana/Indianapolis
America/Indiana/Knox
America/Indiana/Marengo
America/Indiana/Petersburg
America/Indiana/Tell_City
America/Indiana/Vevay
America/Indiana/Vincennes
America/Indiana/Winamac
America/Indianapolis
America/Inuvik
America/Iqaluit
America/Jamaica
America/Jujuy
America/Juneau
America/Kentucky/Louisville
America/Kentucky/Monticello
America/Knox_IN
America/Kralendijk
America/La_Paz
America/Lima
America/Los_Angeles
America/Louisville
America/Lower_Princes
America/Maceio
America/Managua
America/Manaus
America/Marigot
America/Martinique
America/Matamoros
America/Mazatlan
America/Mendoza
America/Menominee
America/Merida
America/Metlakatla
America/Mexico_City
America/Miquelon
America/Moncton
America/Monterrey
America/Montevideo
America/Montreal
America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha
America/North_Dakota/Beulah
America/North_Dakota/Center
America/North_Dakota/New_Salem
America/Nuuk
America/Ojinaga
America/Panama
America/Pangnirtung
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Porto_Acre
America/Porto_Velho
America/Puerto_Rico
America/Punta_Arenas
America/Rainy_River
America/Rankin_Inlet
America/Recife
America/Regina
America/Resolute
America/Rio_Branco
America/Rosario
America/Santa_Isabel
America/Santarem
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/Scoresbysund
America/Shiprock
America/Sitka
America/St_Barthelemy
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Swift_Current
America/Tegucigalpa
America/Thule
America/Thunder_Bay
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Virgin
America/Whitehorse
America/Winnipeg
America/Yakutat
America/Yellowknife
Antarctica/Casey
Antarctica/Davis
Antarctica/DumontDUrville
Antarctica/Macquarie
Antarctica/Mawson
Antarctica/McMurdo
Antarctica/Palmer
Antarctica/Rothera
Antarctica/South_Pole
Antarctica/Syowa
Antarctica/Troll
Antarctica/Vostok
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Ashkhabad
Asia/Atyrau
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Barnaul
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Chita
Asia/Choibalsan
Asia/Chongqing
Asia/Chungking
Asia/Colombo
Asia/Dacca
Asia/Damascus
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Famagusta
Asia/Gaza
Asia/Harbin
Asia/Hebron
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Istanbul
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kashgar
Asia/Kathmandu
Asia/Katmandu
Asia/Khandyga
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macao
Asia/Macau
Asia/Magadan
Asia/Makassar
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novokuznetsk
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qostanay
Asia/Qyzylorda
Asia/Rangoon
Asia/Riyadh
Asia/Saigon
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Tel_Aviv
Asia/Thimbu
Asia/Thimphu
Asia/Tokyo
Asia/Tomsk
Asia/Ujung_Pandang
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Ust-Nera
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yangon
Asia/Yekaterinburg
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Canary
Atlantic/Cape_Verde
Atlantic/Faeroe
Atlantic/Faroe
Atlantic/Jan_Mayen
Atlantic/Madeira
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Canberra
Australia/Currie
Australia/Darwin
Australia/Eucla
Australia/Hobart
Australia/LHI
Australia/Lindeman
Australia/Lord_Howe
Australia/Melbourne
Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/West
Australia/Yancowinna
Brazil/Acre
Brazil/DeNoronha
Brazil/East
Brazil/West
CET
CST6CDT
Canada/Atlantic
Canada/Central
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Pacific
Canada/Saskatchewan
Canada/Yukon
Chile/Continental
Chile/EasterIsland
Cuba
EET
EST
EST5EDT
Egypt
Eire
Etc/GMT
Etc/GMT+0
Etc/GMT+1
Etc/GMT+10
Etc/GMT+11
Etc/GMT+12
Etc/GMT+2
Etc/GMT+3
Etc/GMT+4
Etc/GMT+5
Etc/GMT+6
Etc/GMT+7
Etc/GMT+8
Etc/GMT+9
Etc/GMT-0
Etc/GMT-1
Etc/GMT-10
Etc/GMT-11
Etc/GMT-12
Etc/GMT-13
Etc/GMT-14
Etc/GMT-2
Etc/GMT-3
Etc/GMT-4
Etc/GMT-5
Etc/GMT-6
Etc/GMT-7
Etc/GMT-8
Etc/GMT-9
Etc/GMT0
Etc/Greenwich
Etc/UCT
Etc/UTC
Etc/Universal
Etc/Zulu
Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belfast
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Busingen
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey
Europe/Kaliningrad
Europe/Kiev
Europe/Kirov
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Mariehamn
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Nicosia
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
Europe/San_Marino
Europe/Sarajevo
Europe/Saratov
Europe/Simferopol
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Tirane
Europe/Tiraspol
Europe/Ulyanovsk
Europe/Uzhgorod
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Europe/Zaporozhye
Europe/Zurich
Factory
GB
GB-Eire
GMT
GMT+0
GMT-0
GMT0
Greenwich
HST
Hongkong
Iceland
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Iran
Israel
Jamaica
Japan
Kwajalein
Libya
MET
MST
MST7MDT
Mexico/BajaNorte
Mexico/BajaSur
Mexico/General
NZ
NZ-CHAT
Navajo
PRC
PST8PDT
Pacific/Apia
Pacific/Auckland
Pacific/Bougainville
Pacific/Chatham
Pacific/Chuuk
Pacific/Easter
Pacific/Efate
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Galapagos
Pacific/Gambier
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Johnston
Pacific/Kanton
Pacific/Kiritimati
Pacific/Kosrae
Pacific/Kwajalein
Pacific/Majuro
Pacific/Marquesas
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Pago_Pago
Pacific/Palau
Pacific/Pitcairn
Pacific/Pohnpei
Pacific/Ponape
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Samoa
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Truk
Pacific/Wake
Pacific/Wallis
Pacific/Yap
Poland
Portugal
ROC
ROK
Singapore
SystemV/AST4
SystemV/AST4ADT
SystemV/CST6
SystemV/CST6CDT
SystemV/EST5
SystemV/EST5EDT
SystemV/HST10
SystemV/MST7
SystemV/MST7MDT
SystemV/PST8
SystemV/PST8PDT
SystemV/YST9
SystemV/YST9YDT
Turkey
UCT
US/Alaska
US/Aleutian
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Indiana-Starke
US/Michigan
US/Mountain
US/Pacific
US/Samoa
UTC
Universal
W-SU
WET
Zulu
如果是 WSL 的話,可以用以下命令查詢所有可用的時區名稱:
cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort
以下是透過 Azure CLI 設定時區的方法:
az webapp config appsettings set -g '資源群組名稱' -n '資源名稱' --settings 'TZ=Asia/Taipei'
以下是透過 Azure CLI 刪除時區設定的方法:
az webapp config appsettings set -g '資源群組名稱' -n '資源名稱' --setting-names 'TZ'
相關連結