DateTimeZone::getName

It returns the name of the timezone
Example

<?php
$date = new DateTime(‘2007-05-17’);
$timezone = timezone_open ( ‘Australia/Perth’ );
$date->setTimezone( $timezone );
echo ‘TimeZone is ‘. $timezone->getName();
?>

Output

TimeZone is Australia/Perth

Share