ID: 41912
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: Debian GNU/Linux
PHP Version: 5.2.3
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2007-07-06 08:21:10] [EMAIL PROTECTED]
Description:
------------
date() interprets a Unix timestamp as GMT and converts it to the
default timezone. In my opinion it should not convert timezones.
(bug report requested by Derick Rethans).
Reproduce code:
---------------
<?php
date_default_timezone_set('Europe/Amsterdam');
$date = new DateTime('now', new DateTimeZone('GMT'));
echo 'DateTime::format(): '.$date->format('Ymd, H:i:s')."\n";
echo 'date() of unixtime: '.date('Ymd, H:i:s',
$date->format('U'))."\n";
?>
Expected result:
----------------
DateTime::format(): 20070706, 07:38:45
date() of unixtime: 20070706, 07:38:45
Actual result:
--------------
DateTime::format(): 20070706, 07:38:45
date() of unixtime: 20070706, 09:38:45
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41912&edit=1