PHP | timezone_location_get() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The timezone_location_get() function is an inbuilt function in PHP which is used to return the location information for the given timezone. The date time object is sent as a parameter to the timezone_location_get() function and it returns location information related to the timezone on success or False on failure. Syntax: timezone_location_get( $object ) Parameters: This function accepts single parameter $object which is mandatory. It is used to specify the DateTimeZone object. Return Value: This function returns the location information for a given timezone on success or False on failure. Exception: The timezone_location_get() function is an alias of DateTimeZone::getLocation() function. Below programs illustrate the timezone_location_get() function in PHP: Program 1: php <?php // Opening a timezone $timeZone = timezone_open("Asia/Kolkata"); // Displaying the location details of a timezone echo "Location Details of the Specified Timezone: \n"; print_r(timezone_location_get($timeZone)); ?> Output: Location Details of the Specified Timezone: Array ( [country_code] => IN [latitude] => 22.53333 [longitude] => 88.36666 [comments] => ) Program 2: php <?php // Declaring a timezone $timeZone = new DateTimeZone("Asia/Kolkata"); // Displaying the location details of a timezone echo ("Location Details of the Specified Timezone:\n"); print_r($timeZone->getLocation()); ?> Output: Location Details of the Specified Timezone: Array ( [country_code] => IN [latitude] => 22.53333 [longitude] => 88.36666 [comments] => ) Related Articles: PHP | timezone_open() Function PHP | timezone_version_get() Function Reference: https://www.php.net/manual/en/function.timezone-location-get.php Comment More infoAdvertise with us Next Article PHP | timezone_offset_get() Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-date-time PHP-function +1 More Practice Tags : Misc Similar Reads PHP | timezone_offset_get() Function The timezone_offset_get() function is an inbuilt function in PHP which is used to return the timezone offset from GMT. The date time object and the date-time are sent as a parameter to the timezone_offset_get() function and return the timezone offset in seconds on success or False on failure. Syntax 2 min read PHP | timezone_offset_get() Function The timezone_offset_get() function is an inbuilt function in PHP which is used to return the timezone offset from GMT. The date time object and the date-time are sent as a parameter to the timezone_offset_get() function and return the timezone offset in seconds on success or False on failure. Syntax 2 min read PHP | timezone_offset_get() Function The timezone_offset_get() function is an inbuilt function in PHP which is used to return the timezone offset from GMT. The date time object and the date-time are sent as a parameter to the timezone_offset_get() function and return the timezone offset in seconds on success or False on failure. Syntax 2 min read PHP | timezone_name_get() Function The timezone_name_get() function is an inbuilt function in PHP which is used to return the name of the timezone. The date time object is sent as a parameter to the timezone_name_get() function and it returns the name of the timezone on success or False on failure. Syntax: string timezone_name_get( $ 2 min read PHP | timezone_name_get() Function The timezone_name_get() function is an inbuilt function in PHP which is used to return the name of the timezone. The date time object is sent as a parameter to the timezone_name_get() function and it returns the name of the timezone on success or False on failure. Syntax: string timezone_name_get( $ 2 min read PHP | timezone_name_get() Function The timezone_name_get() function is an inbuilt function in PHP which is used to return the name of the timezone. The date time object is sent as a parameter to the timezone_name_get() function and it returns the name of the timezone on success or False on failure. Syntax: string timezone_name_get( $ 2 min read Like