From:             [EMAIL PROTECTED]
Operating system: Debian GNU/Linux
PHP version:      5.2.3
PHP Bug Type:     Unknown/Other Function
Bug description:  date() interprets Unix timestamp as GMT and converts it to 
the default timezone

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 bug report at http://bugs.php.net/?id=41912&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41912&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41912&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41912&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41912&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41912&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41912&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41912&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41912&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41912&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41912&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41912&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41912&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41912&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41912&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41912&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41912&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41912&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41912&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41912&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41912&r=mysqlcfg

Reply via email to