timezone_location_get


 

timezone_location_get

This is the example of timezone_location_get function used for returning location information of the timezone.

This is the example of timezone_location_get function used for returning location information of the timezone.

timezone_location_get() Function in PHP

timezone_location_get alias DateTimeZone::getLocation returns location information for a timezone including country code, latitude/longitude and comments.

Syntax of timezone_location_get() Function in PHP

public array DateTimeZone::getLocation ( void )

Parameters of timezone_location_get() Function in PHP

This function has no parameters.

Return Values

Array containing location information about timezone.

Example on timezone_location_get() Function in PHP:

<?php

$tz = new DateTimeZone("India/Kolkata");
print_r($tz->getLocation());
?>

The above example will output:

Array
(
[country_code] => India
[latitude] => 28.61 N
[longitude] => 77.23 E
[comments] => 
)

Ads