From: phpbugs at rootcrew dot net
Operating system: Linux (Ubuntu/Debian)
PHP version: 5.3CVS-2008-02-12 (snap)
PHP Bug Type: Date/time related
Bug description: date_create with '@'timestamp ignores timezone
Description:
------------
using "date_create('@'.$timestamp)" ignores the default timezone setting,
giving the timezone as second parameter does not work either.
tested with 5.2.3-1ubuntu6.3, 5.2.0-8+etch10
and tested with snapshot: 5.3-200802121930
Reproduce code:
---------------
$t= time();
$tz= date_default_timezone_get();
$d1= date_create(date("c", $t));
$d2= date_create("@$t"); // ignores default timezone
$d3= date_create("@$t", new DateTimeZone($tz)); // ignores timezone too
echo "default timezone: $tz\n";
echo $d1->format(DATE_RFC2822)."\n";
echo $d2->format(DATE_RFC2822)."\n";
echo $d3->format(DATE_RFC2822)."\n";
Expected result:
----------------
default timezone: Europe/Berlin
Tue, 12 Feb 2008 22:11:23 +0100
Tue, 12 Feb 2008 22:11:23 +0100
Tue, 12 Feb 2008 22:11:23 +0100
Actual result:
--------------
default timezone: Europe/Berlin
Tue, 12 Feb 2008 22:11:23 +0100
Tue, 12 Feb 2008 21:11:23 +0000
Tue, 12 Feb 2008 21:11:23 +0000
--
Edit bug report at http://bugs.php.net/?id=44106&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=44106&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44106&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44106&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44106&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44106&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44106&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44106&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44106&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44106&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44106&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44106&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44106&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44106&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44106&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=44106&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=44106&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44106&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44106&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44106&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44106&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44106&r=mysqlcfg