note 94666 deleted from datetime.construct by danielc
| From: | danielc@php.net | Date: | Sat, 24 Apr 2010 20:09:26 +0000 |
| Subject: | note 94666 deleted from datetime.construct by danielc | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168595@lists.php.net to get a copy of this message | ||
Note Submitter: thomas at koch dot ro
----
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.