You are here: Re: date arithmetic « All PHP « IT news, forums, messages
Re: date arithmetic

Posted by Steve on 12/05/06 16:08

<wesley@ispace.co.za> wrote in message
news:1165327854.453492.250300@f1g2000cwa.googlegroups.com...
| 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?
|

$lastOfMonth = date(
'm/d/Y',
strtotime(
'-1 second',
strtotime(
'+1 month',
strtotime(
date('m') .
'/01/' .
date('Y') .
' 00:00:00'
)
)
)
);
echo '<pre>' . $lastOfMonth . '</pre>';

 

Navigation:

[Reply to this 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

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