Maison > développement back-end > tutoriel php > liste de sortie php de tous les fuseaux horaires

liste de sortie php de tous les fuseaux horaires

*文
Libérer: 2023-03-18 14:18:02
original
3332 Les gens l'ont consulté

Cet article présente principalement la méthode par laquelle PHP génère une liste de fuseaux horaires dans le monde et personnalise une variable de tableau pour stocker les informations de fuseau horaire dans le monde. J'espère que cela aide tout le monde.

La méthode spécifique de mise en œuvre est la suivante :


<?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);
?>
Copier après la connexion

Recommandations associées :

Explication détaillée de l'utilisation de l'horodatage PHP (UNIX)

Paramètres du format d'heure PHP

php Outils d'heure et de date Constellations/Routes/Zodiaques

Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal