ID:               35699
 Updated by:       [EMAIL PROTECTED]
 Reported By:      iquito at gmx dot net
-Status:           Open
+Status:           Assigned
 Bug Type:         Date/time related
 Operating System: Debian Sarge
 PHP Version:      5.1.1
-Assigned To:      
+Assigned To:      derick


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

[2005-12-16 06:11:58] iquito at gmx dot net

Description:
------------
strtotime() doesn't seem to handle leap years before 1970 correctly,
all dates in a leap year are off by one day when converted by
strtotime().

Reproduce code:
---------------
/* shows 1964-06-07 instead of 1964-06-06 */

echo date('Y-m-d', strtotime('1964-06-06'));

/* shows the correct date, 1963-06-06, thus confirming that it has
something to do with leap years, non-leap-years aren't affected. */

echo date('Y-m-d', strtotime('1963-06-06'));

/* curiously, also dates in january and february of a leap year are
affected by this bug */

echo date('Y-m-d', strtotime('1964-01-06')); // returns 1964-01-07

Expected result:
----------------
echo date('Y-m-d', strtotime('1964-06-06')); // should return
1964-06-06 !

Actual result:
--------------
echo date('Y-m-d', strtotime('1964-06-06')); // returns 1964-06-07 !


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


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

Reply via email to