#28275 [NEW]: mktime() b0rked for 4-4-YYYY

From: Date: Tue, 04 May 2004 17:07:38 +0000
Subject: #28275 [NEW]: mktime() b0rked for 4-4-YYYY
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59213@lists.php.net to get a copy of this message
From: escot001 at student dot ucr dot edu Operating system: FreeBSD 4.9-STABLE PHP version: 4.3.5 PHP Bug Type: Calendar related Bug description: mktime() b0rked for 4-4-YYYY Description: ------------ When feeding mktime() the parameters 4 for month, 4 for date, and any year, the begining of the UNIX epoch is returned. Reproduce code: --------------- <?php $d = 00; $m = 00; $y = 2010; // can be any date, i assume - tested 2003, 2004, 2010 while ($m < 13) { $m++; while ($d < 32) { $d++; $cur_date = date("m-d-Y", mktime(0,0,0,$m,$d,$y)); echo $cur_date; echo ("<br>"); } $d = 00; } ?> Expected result: ---------------- 03-22-2010 03-23-2010 03-24-2010 03-25-2010 03-26-2010 03-27-2010 03-28-2010 03-29-2010 03-30-2010 03-31-2010 04-01-2010 04-01-2010 04-02-2010 04-03-2010 04-04-2010 04-05-2010 04-06-2010 04-07-2010 04-08-2010 04-09-2010 04-10-2010 04-11-2010 04-12-2010 04-13-2010 04-14-2010 04-15-2010 04-16-2010 04-17-2010 04-18-2010 04-19-2010 04-20-2010 04-21-2010 04-22-2010 04-23-2010 Actual result: -------------- 03-22-2010 03-23-2010 03-24-2010 03-25-2010 03-26-2010 03-27-2010 03-28-2010 03-29-2010 03-30-2010 03-31-2010 04-01-2010 04-01-2010 04-02-2010 04-03-2010 12-31-1969 04-05-2010 04-06-2010 04-07-2010 04-08-2010 04-09-2010 04-10-2010 04-11-2010 04-12-2010 04-13-2010 04-14-2010 04-15-2010 04-16-2010 04-17-2010 04-18-2010 04-19-2010 04-20-2010 -- Edit bug report at http://bugs.php.net/?id=28275&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28275&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28275&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28275&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28275&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28275&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28275&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28275&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28275&r=support Expected behavior: http://bugs.php.net/fix.php?id=28275&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28275&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28275&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28275&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28275&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28275&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28275&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28275&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28275&r=float

« previous php.bugs (#59213) next »