Share on Google+Share on Google+

timezone_location_get

Advertisement
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] => 
)

Advertisements

Posted on: August 29, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.