note 97724 modified in datetime.construct by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 May 2010 14:17:06 +0000 |
| Subject: | note 97724 modified in datetime.construct by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168968@lists.php.net to get a copy of this message | ||
"The $timezone parameter and the current timezone are ignored when the $time parameter [â¦]
is a UNIX timestamp."
Watch out â this means that these two are NOT equivalent, they result in different timezones
(unless your current timezone is GMT):
<?php
$d = new DateTime(); $d->setTimestamp($t);
echo $o->format('O');
// +0200
$d = new DateTime('@' . $t);
echo $o->format('O');
// +0000
?>
--was--
"The $timezone parameter and the current timezone are ignored when the $time parameter [â¦]
is a UNIX timestamp."
Watch out â this means that these two are NOT equivalent, they result in different timezones
(unless your current timezone is GMT):
$d = new DateTime(); $d->setTimestamp($t);
echo $o->format('O');
// +0200
$d = new DateTime('@' . $t);
echo $o->format('O');
// +0000
http://php.net/manual/en/datetime.construct.php