#18636 [Opn->Bgs]: Where is February?

From: Date: Tue, 30 Jul 2002 08:44:18 +0000
Subject: #18636 [Opn->Bgs]: Where is February?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15549@lists.php.net to get a copy of this message
ID: 18636 Updated by: rasmus@php.net Reported By: mypsycho101@hotmail.com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: WinNT PHP Version: 4.2.2 New Comment: Uh, look at the date of this bug report. Then think about how many days are in February. Then look at your code. Previous Comments: ------------------------------------------------------------------------ [2002-07-30 04:41:02] mypsycho101@hotmail.com I wanted to list all the months, days and years. The script that I used written below. $year = date("Y"); $month = date("m"); $mday = date("d"); get_date($month,$mday,$year,"airway_month","airway_day","airway_year"); function get_date($month,$day,$year,$moname,$dayname,$yearname) { //get the month print "<select name=\"$moname\">\n<option value=\"0\">Month</option>"; for ($m=1;$m<=12;$m++) { if ($m <10) $nm = "0".$m; else $nm=$m; print "<option value=\"".$nm."\">".date("F",mktime(0,0,0,$m,$day,$year))."</option>\n"; } print "</select>\n/\n"; // get the day print "<select name=\"$dayname\">\n<option value=\"0\">Date</option>\n"; $limit = 31; for ($d=1;$d<=$limit;$d++) { if ($d < 10) $nd= "0".$d; else $nd = $d; print "<option value=\"".$nd."\">".$nd."</option>\n"; } print "</select>\n/\n"; // get the year $yr_strt = $year - 1; $yr_end = $year + 5; print "<select name=\"$yearname\">\n<option value=\"0\">Year</option>\n"; for ($y=$yr_strt;$y<=$yr_end;$y++) { echo "<option value=\"".$y."\">".$y."</option>\n"; } print "</select>\n"; } When I view my HTML source, the month of February is not displayed. Instead there would be two instances of March. I would appreciate if you would inform me if there is something wrong with the script or function. Thank you. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18636&edit=1

« previous php.bugs (#15549) next »