note 77216 added to function.timezone-name-get

From: Date: Mon, 20 Aug 2007 16:45:16 +0000
Subject: note 77216 added to function.timezone-name-get
Groups: php.notes 
Request: Send a blank email to php-notes+get-129644@lists.php.net to get a copy of this message
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 ---- Server IP: 203.16.234.20 Probable Submitter: 122.169.146.133 ---- Manual Page -- http://www.php.net/manual/en/function.timezone-name-get.php Edit -- https://master.php.net/note/edit/77216 Del: integrated -- https://master.php.net/note/delete/77216/integrated Del: useless -- https://master.php.net/note/delete/77216/useless Del: bad code -- https://master.php.net/note/delete/77216/bad+code Del: spam -- https://master.php.net/note/delete/77216/spam Del: non-english -- https://master.php.net/note/delete/77216/non-english Del: in docs -- https://master.php.net/note/delete/77216/in+docs Del: other reasons-- https://master.php.net/note/delete/77216 Reject -- https://master.php.net/note/reject/77216 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129644) next »