|
Posted by larry on 12/05/06 14:41
wesley@ispace.co.za wrote:
> Hi
>
> I have searched through the archives but did not find a solution to
> this. Is there a way to get the last day of the month. In other words,
> can you determine the last date of the current month without having to
> check the Month and leap year to confirm?
>
> Is there also a way to determine the date, one month from now without
> actually checking the date and the Leap year?
>
> Thanks
> Wes
$mn = date("m");
$yr = date("Y");
$testdate = mktime(0,0,0,$mn,1,$yr); //first date in selected month
as unix timestamp
$firstday = date(w,$testdate); // what day does month start on?
$numdays = date(t,$testdate); // number of days in this month
$daystop= mktime(0,0,0,$mn,$numdays,$yr); // what day is the last
day??
Larry
Navigation:
[Reply to this message]
|