#40743 [NEW]: DateTime ignores the TimeZone object passed to the constructor
From: ddb at bitxtender dot de
Operating system: Win XP
PHP version: 5.2.1
PHP Bug Type: Date/time related
Bug description: DateTime ignores the TimeZone object passed to the constructor
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 bug report at http://bugs.php.net/?id=40743&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40743&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40743&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40743&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40743&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40743&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40743&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40743&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40743&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40743&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40743&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40743&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40743&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40743&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40743&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40743&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40743&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40743&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40743&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40743&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40743&r=mysqlcfg
Thread (12 messages)
- ddb at bitxtender dot de
- derick@php.net#40743 [Opn->Asn]: DateTime ignores the TimeZone object passed to the constructor
- derick@php.net#40743 [Asn]: DateTime ignores the TimeZone object passed to the constructor
- artur at jedlinski dot pl#40743 [Com]: DateTime ignores the TimeZone object passed to the constructor
- derick@php.net#40743 [Asn->Csd]: DateTime ignores the TimeZone object passed to the constructor
- kavi at postpro dot netBug #40743 [Com]: DateTime ignores the TimeZone object passed to the constructor
- cataphract@php.netBug #40743 [Csd]: DateTime ignores the TimeZone object passed to the constructor
- cataphract@php.netBug #40743 [Csd->ReO]: DateTime ignores the TimeZone object passed to the constructor
- derick@php.netBug->Req #40743 [ReO]: DateTime ignores the TimeZone object passed to the constructor
- kavi at postpro dot netReq #40743 [Com]: DateTime ignores the TimeZone object passed to the constructor
- heiglandreas@php.netReq #40743 [Com]: DateTime ignores the TimeZone object passed to the constructor
- heiglandreas@php.netReq #40743 [ReO->Nab]: DateTime ignores the TimeZone object passed to the constructor