首頁 > 後端開發 > php教程 > php輸出所有時區列表

php輸出所有時區列表

*文
發布: 2023-03-18 14:18:02
原創
3328 人瀏覽過

本文主要介紹了php輸出全球各個時區清單的方法,自訂了一個陣列變數用於存放全球各個時區資訊。希望對大家有幫助。

具體實作方法如下:


<?php
$timezones =
array (
 &#39;(GMT-12:00) International Date Line West&#39; => &#39;Pacific/Wake&#39;,
 &#39;(GMT-11:00) Midway Island&#39; => &#39;Pacific/Apia&#39;,
 &#39;(GMT-11:00) Samoa&#39; => &#39;Pacific/Apia&#39;,
 &#39;(GMT-10:00) Hawaii&#39; => &#39;Pacific/Honolulu&#39;,
 &#39;(GMT-09:00) Alaska&#39; => &#39;America/Anchorage&#39;,
 &#39;(GMT-08:00) Pacific Time (US & Canada); Tijuana&#39; => &#39;America/Los_Angeles&#39;,
 &#39;(GMT-07:00) Arizona&#39; => &#39;America/Phoenix&#39;,
 &#39;(GMT-07:00) Chihuahua&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) La Paz&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) Mazatlan&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) Mountain Time (US & Canada)&#39; => &#39;America/Denver&#39;,
 &#39;(GMT-06:00) Central America&#39; => &#39;America/Managua&#39;,
 &#39;(GMT-06:00) Central Time (US & Canada)&#39; => &#39;America/Chicago&#39;,
 &#39;(GMT-06:00) Guadalajara&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Mexico City&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Monterrey&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Saskatchewan&#39; => &#39;America/Regina&#39;,
 &#39;(GMT-05:00) Bogota&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-05:00) Eastern Time (US & Canada)&#39; => &#39;America/New_York&#39;,
 &#39;(GMT-05:00) Indiana (East)&#39; => &#39;America/Indiana/Indianapolis&#39;,
 &#39;(GMT-05:00) Lima&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-05:00) Quito&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-04:00) Atlantic Time (Canada)&#39; => &#39;America/Halifax&#39;,
 &#39;(GMT-04:00) Caracas&#39; => &#39;America/Caracas&#39;,
 &#39;(GMT-04:00) La Paz&#39; => &#39;America/Caracas&#39;,
 &#39;(GMT-04:00) Santiago&#39; => &#39;America/Santiago&#39;,
 &#39;(GMT-03:30) Newfoundland&#39; => &#39;America/St_Johns&#39;,
 &#39;(GMT-03:00) Brasilia&#39; => &#39;America/Sao_Paulo&#39;,
 &#39;(GMT-03:00) Buenos Aires&#39; => &#39;America/Argentina/Buenos_Aires&#39;,
 &#39;(GMT-03:00) Georgetown&#39; => &#39;America/Argentina/Buenos_Aires&#39;,
 &#39;(GMT-03:00) Greenland&#39; => &#39;America/Godthab&#39;,
 &#39;(GMT-02:00) Mid-Atlantic&#39; => &#39;America/Noronha&#39;,
 &#39;(GMT-01:00) Azores&#39; => &#39;Atlantic/Azores&#39;,
 &#39;(GMT-01:00) Cape Verde Is.&#39; => &#39;Atlantic/Cape_Verde&#39;,
 &#39;(GMT) Casablanca&#39; => &#39;Africa/Casablanca&#39;,
 &#39;(GMT) Edinburgh&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Greenwich Mean Time : Dublin&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Lisbon&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) London&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Monrovia&#39; => &#39;Africa/Casablanca&#39;,
 &#39;(GMT+01:00) Amsterdam&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Belgrade&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Berlin&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Bern&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Bratislava&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Brussels&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Budapest&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Copenhagen&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Ljubljana&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Madrid&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Paris&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Prague&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Rome&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Sarajevo&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) Skopje&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) Stockholm&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Vienna&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Warsaw&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) West Central Africa&#39; => &#39;Africa/Lagos&#39;,
 &#39;(GMT+01:00) Zagreb&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+02:00) Athens&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Bucharest&#39; => &#39;Europe/Bucharest&#39;,
 &#39;(GMT+02:00) Cairo&#39; => &#39;Africa/Cairo&#39;,
 &#39;(GMT+02:00) Harare&#39; => &#39;Africa/Johannesburg&#39;,
 &#39;(GMT+02:00) Helsinki&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Istanbul&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Jerusalem&#39; => &#39;Asia/Jerusalem&#39;,
 &#39;(GMT+02:00) Kyiv&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Minsk&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Pretoria&#39; => &#39;Africa/Johannesburg&#39;,
 &#39;(GMT+02:00) Riga&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Sofia&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Tallinn&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Vilnius&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+03:00) Baghdad&#39; => &#39;Asia/Baghdad&#39;,
 &#39;(GMT+03:00) Kuwait&#39; => &#39;Asia/Riyadh&#39;,
 &#39;(GMT+03:00) Moscow&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:00) Nairobi&#39; => &#39;Africa/Nairobi&#39;,
 &#39;(GMT+03:00) Riyadh&#39; => &#39;Asia/Riyadh&#39;,
 &#39;(GMT+03:00) St. Petersburg&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:00) Volgograd&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:30) Tehran&#39; => &#39;Asia/Tehran&#39;,
 &#39;(GMT+04:00) Abu Dhabi&#39; => &#39;Asia/Muscat&#39;,
 &#39;(GMT+04:00) Baku&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:00) Muscat&#39; => &#39;Asia/Muscat&#39;,
 &#39;(GMT+04:00) Tbilisi&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:00) Yerevan&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:30) Kabul&#39; => &#39;Asia/Kabul&#39;,
 &#39;(GMT+05:00) Ekaterinburg&#39; => &#39;Asia/Yekaterinburg&#39;,
 &#39;(GMT+05:00) Islamabad&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:00) Karachi&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:00) Tashkent&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:30) Chennai&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) Kolkata&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) Mumbai&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) New Delhi&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:45) Kathmandu&#39; => &#39;Asia/Katmandu&#39;,
 &#39;(GMT+06:00) Almaty&#39; => &#39;Asia/Novosibirsk&#39;,
 &#39;(GMT+06:00) Astana&#39; => &#39;Asia/Dhaka&#39;,
 &#39;(GMT+06:00) Dhaka&#39; => &#39;Asia/Dhaka&#39;,
 &#39;(GMT+06:00) Novosibirsk&#39; => &#39;Asia/Novosibirsk&#39;,
 &#39;(GMT+06:00) Sri Jayawardenepura&#39; => &#39;Asia/Colombo&#39;,
 &#39;(GMT+06:30) Rangoon&#39; => &#39;Asia/Rangoon&#39;,
 &#39;(GMT+07:00) Bangkok&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Hanoi&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Jakarta&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Krasnoyarsk&#39; => &#39;Asia/Krasnoyarsk&#39;,
 &#39;(GMT+08:00) Beijing&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Chongqing&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Hong Kong&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Irkutsk&#39; => &#39;Asia/Irkutsk&#39;,
 &#39;(GMT+08:00) Kuala Lumpur&#39; => &#39;Asia/Singapore&#39;,
 &#39;(GMT+08:00) Perth&#39; => &#39;Australia/Perth&#39;,
 &#39;(GMT+08:00) Singapore&#39; => &#39;Asia/Singapore&#39;,
 &#39;(GMT+08:00) Taipei&#39; => &#39;Asia/Taipei&#39;,
 &#39;(GMT+08:00) Ulaan Bataar&#39; => &#39;Asia/Irkutsk&#39;,
 &#39;(GMT+08:00) Urumqi&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+09:00) Osaka&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Sapporo&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Seoul&#39; => &#39;Asia/Seoul&#39;,
 &#39;(GMT+09:00) Tokyo&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Yakutsk&#39; => &#39;Asia/Yakutsk&#39;,
 &#39;(GMT+09:30) Adelaide&#39; => &#39;Australia/Adelaide&#39;,
 &#39;(GMT+09:30) Darwin&#39; => &#39;Australia/Darwin&#39;,
 &#39;(GMT+10:00) Brisbane&#39; => &#39;Australia/Brisbane&#39;,
 &#39;(GMT+10:00) Canberra&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Guam&#39; => &#39;Pacific/Guam&#39;,
 &#39;(GMT+10:00) Hobart&#39; => &#39;Australia/Hobart&#39;,
 &#39;(GMT+10:00) Melbourne&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Port Moresby&#39; => &#39;Pacific/Guam&#39;,
 &#39;(GMT+10:00) Sydney&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Vlapostok&#39; => &#39;Asia/Vlapostok&#39;,
 &#39;(GMT+11:00) Magadan&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+11:00) New Caledonia&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+11:00) Solomon Is.&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+12:00) Auckland&#39; => &#39;Pacific/Auckland&#39;,
 &#39;(GMT+12:00) Fiji&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Kamchatka&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Marshall Is.&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Wellington&#39; => &#39;Pacific/Auckland&#39;,
 &#39;(GMT+13:00) Nuku\&#39;alofa&#39; => &#39;Pacific/Tongatapu&#39;,
);
print_r($timezones);
?>
登入後複製

#相關推薦:

##php 時間戳(UNIX)用法詳解

PHP 時間格式化參數

php 時間日期工具類星座/幹支/生肖

以上是php輸出所有時區列表的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板