<?php
/* - - - - - - - - - - - - - - - - -
Object oriented style
- - - - - - - - - - - - - - - - - */
arr|false public arr DateTimeZone::getLocation ( )
?>
<?php
/* - - - - - - - - - - - - - - - - -
Procedural style
- - - - - - - - - - - - - - - - - */
arr|false timezone_location_get ( DateTimeZone $object )
where,
$object = Object returned by timezone_open function
?>
<?php
setlocale(LC_ALL, "pt_BR.utf-8", "portuguese-brazil", "ptb");
$obj_tz01 = new DateTimeZone("America/Sao_Paulo");
$arr_loc01 = timezone_location_get($obj_tz01);
foreach($arr_loc01 as $arrl01 => $al01)
{
echo $arrl01 . ' => ' . $al01 . '<br><br>';
}
?>
Timezone NAME | Timezone NAME |
Africa/Abidjan | Africa/Accra |
Africa/Algiers | Africa/Asmara |
Africa/Bangui | Africa/Banjul |
Africa/Blantyre | Africa/Brazzaville |
Africa/Cairo | Africa/Casablanca |
Africa/Conakry | Africa/Dakar |
Africa/Djibouti | Africa/Douala |
Africa/Freetown | Africa/Gaborone |
Africa/Johannesburg | Africa/Juba |
Africa/Khartoum | Africa/Kigali |
Africa/Lagos | Africa/Libreville |
Africa/Luanda | Africa/Lubumbashi |
Africa/Malabo | Africa/Maputo |
Africa/Mbabane | Africa/Mogadishu |
Africa/Nairobi | Africa/Ndjamena |
Africa/Nouakchott | Africa/Ouagadougou |
Africa/Sao_Tome | Africa/Tripoli |
Africa/Windhoek | America/Adak |
America/Anguilla | America/Antigua |
America/Argentina/Buenos_Aires | America/Argentina/Catamarca |
America/Argentina/Jujuy | America/Argentina/La_Rioja |
America/Argentina/Rio_Gallegos | America/Argentina/Salta |
America/Argentina/San_Luis | America/Argentina/Tucuman |
America/Aruba | America/Asuncion |
America/Bahia | America/Bahia_Banderas |
America/Belem | America/Belize |
America/Boa_Vista | America/Bogota |
America/Cambridge_Bay | America/Campo_Grande |
America/Caracas | America/Cayenne |
America/Chicago | America/Chihuahua |
America/Creston | America/Cuiaba |
America/Danmarkshavn | America/Dawson |
America/Denver | America/Detroit |
America/Edmonton | America/Eirunepe |
America/Fort_Nelson | America/Fortaleza |
America/Godthab | America/Goose_Bay |
America/Grenada | America/Guadeloupe |
America/Guayaquil | America/Guyana |
America/Havana | America/Hermosillo |
America/Indiana/Knox | America/Indiana/Marengo |
America/Indiana/Tell_City | America/Indiana/Vevay |
America/Indiana/Winamac | America/Inuvik |
America/Jamaica | America/Juneau |
America/Kentucky/Monticello | America/Kralendijk |
America/Lima | America/Los_Angeles |
America/Maceio | America/Managua |
America/Marigot | America/Martinique |
America/Mazatlan | America/Menominee |
America/Metlakatla | America/Mexico_City |
America/Moncton | America/Monterrey |
America/Montserrat | America/Nassau |
America/Nipigon | America/Nome |
America/North_Dakota/Beulah | America/North_Dakota/Center |
America/Ojinaga | America/Panama |
America/Paramaribo | America/Phoenix |
America/Port_of_Spain | America/Porto_Velho |
America/Punta_Arenas | America/Rainy_River |
America/Recife | America/Regina |
America/Rio_Branco | America/Santarem |
America/Santo_Domingo | America/Sao_Paulo |
America/Sitka | America/St_Barthelemy |
America/St_Kitts | America/St_Lucia |
America/St_Vincent | America/Swift_Current |
America/Thule | America/Thunder_Bay |
America/Toronto | America/Tortola |
America/Whitehorse | America/Winnipeg |
America/Yellowknife | Antarctica/Casey |
Antarctica/DumontDUrville | Antarctica/Macquarie |
Antarctica/McMurdo | Antarctica/Palmer |
Antarctica/Syowa | Antarctica/Troll |
Arctic/Longyearbyen | Asia/Aden |
Asia/Amman | Asia/Anadyr |
Asia/Aqtobe | Asia/Ashgabat |
Asia/Baghdad | Asia/Bahrain |
Asia/Bangkok | Asia/Barnaul |
Asia/Bishkek | Asia/Brunei |
Asia/Choibalsan | Asia/Colombo |
Asia/Dhaka | Asia/Dili |
Asia/Dushanbe | Asia/Famagusta |
Asia/Hebron | Asia/Ho_Chi_Minh |
Asia/Hovd | Asia/Irkutsk |
Asia/Jayapura | Asia/Jerusalem |
Asia/Kamchatka | Asia/Karachi |
Asia/Khandyga | Asia/Kolkata |
Asia/Kuala_Lumpur | Asia/Kuching |
Asia/Macau | Asia/Magadan |
Asia/Manila | Asia/Muscat |
Asia/Novokuznetsk | Asia/Novosibirsk |
Asia/Oral | Asia/Phnom_Penh |
Asia/Pyongyang | Asia/Qatar |
Asia/Riyadh | Asia/Sakhalin |
Asia/Seoul | Asia/Shanghai |
Asia/Srednekolymsk | Asia/Taipei |
Asia/Tbilisi | Asia/Tehran |
Asia/Tokyo | Asia/Tomsk |
Asia/Urumqi | Asia/Ust-Nera |
Asia/Vladivostok | Asia/Yakutsk |
Asia/Yekaterinburg | Asia/Yerevan |
Atlantic/Bermuda | Atlantic/Canary |
Atlantic/Faroe | Atlantic/Madeira |
Atlantic/South_Georgia | Atlantic/St_Helena |
Australia/Adelaide | Australia/Brisbane |
Australia/Currie | Australia/Darwin |
Australia/Hobart | Australia/Lindeman |
Australia/Melbourne | Australia/Perth |
Europe/Amsterdam | Europe/Andorra |
Europe/Athens | Europe/Belgrade |
Europe/Bratislava | Europe/Brussels |
Europe/Budapest | Europe/Busingen |
Europe/Copenhagen | Europe/Dublin |
Europe/Guernsey | Europe/Helsinki |
Europe/Istanbul | Europe/Jersey |
Europe/Kiev | Europe/Kirov |
Europe/Ljubljana | Europe/London |
Europe/Madrid | Europe/Malta |
Europe/Minsk | Europe/Monaco |
Europe/Oslo | Europe/Paris |
Europe/Prague | Europe/Riga |
Europe/Samara | Europe/San_Marino |
Europe/Saratov | Europe/Simferopol |
Europe/Sofia | Europe/Stockholm |
Europe/Tirane | Europe/Ulyanovsk |
Europe/Vaduz | Europe/Vatican |
Europe/Vilnius | Europe/Volgograd |
Europe/Zagreb | Europe/Zaporozhye |
Indian/Antananarivo | Indian/Chagos |
Indian/Cocos | Indian/Comoro |
Indian/Mahe | Indian/Maldives |
Indian/Mayotte | Indian/Reunion |
Pacific/Auckland | Pacific/Bougainville |
Pacific/Chuuk | Pacific/Easter |
Pacific/Enderbury | Pacific/Fakaofo |
Pacific/Funafuti | Pacific/Galapagos |
Pacific/Guadalcanal | Pacific/Guam |
Pacific/Kiritimati | Pacific/Kosrae |
Pacific/Majuro | Pacific/Marquesas |
Pacific/Nauru | Pacific/Niue |
Pacific/Noumea | Pacific/Pago_Pago |
Pacific/Pitcairn | Pacific/Pohnpei |
Pacific/Rarotonga | Pacific/Saipan |
Pacific/Tarawa | Pacific/Tongatapu |
Pacific/Wallis | UTC |
ed48 |
<?php
setlocale(LC_ALL, "en_GB", "eng", "english-uk", "uk");
$obj_tz02 = new DateTimeZone("Europe/London");
$arr_loc02 = timezone_location_get($obj_tz02);
foreach($arr_loc02 as $k02 => $v02)
echo $k02 . ' => ' . $v02 . '<br><br>';
?>
<?php
setlocale(LC_ALL, "en_GB", "eng", "english-uk", "uk");
$obj_tz03 = new DateTimeZone("UTC");
$arr_loc03 = timezone_location_get($obj_tz03);
foreach($arr_loc03 as $k03 => $v03)
echo $k03 . ' => ' . $v03 . '<br><br>';
?>
<?php
$loc04 = setlocale(LC_ALL, "en_GB", "eng", "english-uk", "uk");
$obj_tz04 = new DateTimeZone();
// Attention - beware of this line of code
// Fatal error is expected -
// - regardless of the version of PHP used
// Remember that this type of error interrupts
// the programming flow
$arr_loc04 = timezone_location_get($obj_tz04);
print_r($arr_loc04);
?>
<?php
$tz05 = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, 'US');
foreach($tz05 as $zn05)
{
$objtz05 = new DateTimeZone($zn05);
$loc05 = $objtz05->getLocation();
echo '[ ' . $loc05['country_code'] . ']<br>' .
$zn05 . '<br>' . $loc05['comments'] .
'<br>( ' . $loc05['latitude'] . ', ' .
$loc05['longitude'] . ' )<br><br>';
}
?>