note 77216 deleted from function.timezone-name-get by nlopess

From: Date: Sat, 01 Sep 2007 12:02:16 +0000
Subject: note 77216 deleted from function.timezone-name-get by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130006@lists.php.net to get a copy of this message
Note Submitter: mcmohd at gmail dot com ---- Try the following exmaple: <?php $dateSrc = '2007-04-19 12:50 GMT'; $dateTime = date_create( $dateSrc); $DateTimeZone = timezone_open ( 'America/Chicago' ); date_timezone_set( $dateTime, $DateTimeZone ); $NewDateTimeZone = date_timezone_get($dateTime); echo 'New timeZone is '. timezone_name_get($NewDateTimeZone); echo "\n"; # Using second function. $dateTime = new DateTime($dateSrc); $DateTimeZone = timezone_open ( 'America/Chicago' ); $dateTime->setTimezone( $DateTimeZone ); echo 'New timeZone is '. $DateTimeZone->getName (); ?> This will produce following result which may vary on your computer: New timeZone is America/Chicago New timeZone is America/Chicago For more information you can have a look at http://www.tutorialspoint.com

« previous php.notes (#130006) next »