From: phil at adigital dot com dot mx
Operating system: Win XP and Linux FC4
PHP version: 5.1.2
PHP Bug Type: Date/time related
Bug description: date() doesnt five right date sometimes
Description:
------------
date("Y-m-d H:i:s", 1175403600);
shows: 2007/4/1 00:00:00
Should be: 2007/3/1 23:00:00
the hour is shift 1 hour in PHP from march/11/2007 to april/1/2007 (20
days of 1 hour diff !)
The same problem repeat 2008, 2009, 2010, 2011, etc, but the beginning of
problem is +/- 5 days and ending problem too +/- 5 days
It seems the problem is not occuring before 3/1/2007
I thought first it was maybe a daylight savings problem
BUT:
- it happens on our redhat 8 servers in US (ev1), local servers (FC4) AND
windows XP
- the start and end date of the problem is quite random in a period ,
daylights are quite fixed
- It doesnt happen before 3/1/2007
SO i guess it's a bad bug somewhere
the result *must* be same as unix_timestamp C++ function no ?
It is not
Thx !
Reproduce code:
---------------
print date("Y-m-d H:i:s", 1175403600); // bad +1 hour
print date("Y-m-d H:i:s", 1238417200); // bad +1 hour
print mktime(0,0,0,4,1,2007);
Expected result:
----------------
2007/3/1 23:00:00
2009-03-30 06:46:40
1175407200
Actual result:
--------------
2007/4/1 00:00:00
2009-03-30 07:46:40
1175403600
--
Edit bug report at http://bugs.php.net/?id=36688&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36688&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36688&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36688&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36688&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36688&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36688&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36688&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36688&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36688&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36688&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36688&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36688&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36688&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36688&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36688&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36688&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36688&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36688&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36688&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36688&r=mysqlcfg