php date question
by "Michael Gerholdt" <gerholdt(at)fredonia.edu>
|
Date: |
Sun, 31 Mar 2002 17:58:01 -0500 |
To: |
"hwg-languages" <hwg-languages(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
Hi, php users,
This generally works just fine, but when you get to the 31st of a month, my
code for last month returns the same month as my code for this month ...
namely, this month.
There must be something I've got wrong.
The code:
<!-- previous month -->
<? $i = date("M",mktime(0,0,0,date("m")-1,date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>"> <?=$i?>
<BR>
<!-- this month -->
<? $i = date("M",mktime(0,0,0,date("m"),date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>" checked> <?=$i?>
</td>
<td align="left" valign="top" class="comic">
<!-- next month -->
<? $i = date("M",mktime(0,0,0,date("m")+1,date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>"> <?=$i?>
<BR>
<!-- every month -->
<input type="radio" name="month" value="%"> All
Thanks,
Mike
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA