Re: date
| From: | Richard Lynch | Date: | Tue, 31 Jul 2001 08:47:11 +0000 |
| Subject: | Re: date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60374@lists.php.net to get a copy of this message | ||
> how do i check that the current date is the end of month ?
In PHP?
$now = date('m/d/Y');
$parts = explode('/', $now);
list($month, $day, $year) = $parts;
$tomorrow = mktime($month, $day + 1, $year);
if ($month != date('m', $tomorrow)){
echo "LAST DAY!<BR>\n";
}
Probably can be done in SQL as well.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm