English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Date & Time Function Manual
The timezone_location_get() function returns the location information of the timezone
The timezone_location_get() function returns the location information of the timezone, including country code, latitude/Longitude and comments.
timezone_location_get (DateTimeZone $object);
Serial Number | Parameters and Description |
---|---|
1 | Object (required) DateTimeZone object returned by timezone_open() |
Array containing information about the location of the timezone, false on failure.
This function was originally introduced in PHP version5.3.0 introduced and can be used in all higher versions.
DateTimeZone::getLocation() Example-
<?php $tz = new DateTimeZone("Asia/Shanghai); print_r($tz->getLocation()); print_r(timezone_location_get($tz)); ?>Test and See‹/›
Output Result
Array ( [country_code] => CN [latitude] => 31.23333 [longitude] => 121.46666 [comments] => Beijing Time ) Array ( [country_code] => CN [latitude] => 31.23333 [longitude] => 121.46666 [comments] => Beijing Time )