timezone_open

It ia an alias of DateTimeZone::__construct()and it creates new DateTimeZone object
Example

<?php
$date = date_create( ‘2007-05-17’);
$timezone = timezone_open ( ‘Australia/Perth’ );
date_timezone_set( $date, $timezone );
$dateTimeZone = date_timezone_get($date);
echo ‘TimeZone is ‘. timezone_name_get($dateTimeZone);
?>

Output

TimeZone is Australia/Perth

Share