Reply to Re: date arithmetic

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация