note 94666 added to datetime.construct

From: Date: Tue, 17 Nov 2009 16:26:06 +0000
Subject: note 94666 added to datetime.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-162988@lists.php.net to get a copy of this message
Derick confirmed, that the following is expected behaviour: <?php var_dump( date_default_timezone_get() ); $dateTime = new DateTime( '23:01' ); var_dump( $dateTime->getTimezone()->getName() ); $dateTime = new DateTime( '@1234567890' ); var_dump( $dateTime->getTimezone()->getName() ); ?> Output: string(13) "Europe/Berlin" string(13) "Europe/Berlin" string(6) "+00:00" So depending on the format you use to define the DateTime object it either receives the default timezone or not. ---- Server IP: 62.2.182.223 Probable Submitter: 84.72.56.244 ---- Manual Page -- http://www.php.net/manual/en/datetime.construct.php Edit -- https://master.php.net/note/edit/94666 Del: integrated -- https://master.php.net/note/delete/94666/integrated Del: useless -- https://master.php.net/note/delete/94666/useless Del: bad code -- https://master.php.net/note/delete/94666/bad+code Del: spam -- https://master.php.net/note/delete/94666/spam Del: non-english -- https://master.php.net/note/delete/94666/non-english Del: in docs -- https://master.php.net/note/delete/94666/in+docs Del: other reasons-- https://master.php.net/note/delete/94666 Reject -- https://master.php.net/note/reject/94666 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#162988) next »