#40743 [Opn->Asn]: DateTime ignores the TimeZone object passed to the constructor

From: Date: Tue, 06 Mar 2007 23:40:03 +0000
Subject: #40743 [Opn->Asn]: DateTime ignores the TimeZone object passed to the constructor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110020@lists.php.net to get a copy of this message
 ID:               40743
 Updated by:       derick@php.net
 Reported By:      ddb at bitxtender dot de
-Status:           Open
+Status:           Assigned
 Bug Type:         Date/time related
 Operating System: Win XP
 PHP Version:      5.2.1
-Assigned To:      
+Assigned To:      derick


Previous Comments:
------------------------------------------------------------------------

[2007-03-06 23:27:24] ddb at bitxtender dot de

Description:
------------
when you create a new DateTime object the timezone object you pass
along in the constructor is ignored.
setting the timezone using setTimeZone works as expected.
also tested with 5.2-dev and 6.0-dev

Reproduce code:
---------------
$dt = new DateTime('@' . time(), new DateTimeZone('Europe/Berlin'));
echo $dt->format(DATE_RFC822);

Expected result:
----------------
Tue, 07 Mar 07 01:22:55 +0100

Actual result:
--------------
Tue, 07 Mar 07 00:22:55 +0000


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40743&edit=1


Thread (12 messages)

« previous php.bugs (#110020) next »