|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-05-04 19:30 UTC] escot001 at student dot ucr dot edu
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 10:00:01 2025 UTC |
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