note 40151 added to function.date
| From: | panania at 3ringwebs dot com | Date: | Mon, 23 Feb 2004 16:33:04 +0000 |
| Subject: | note 40151 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65600@lists.php.net to get a copy of this message | ||
1st and Last day of the month
$monthdays = array(1=>31, 3=>31, 4=>30, 5=>31, 6=>30, 7=>31, 8=>31, 9=>30,
10=>31, 11=>30, 12=>31);
$date = mktime( 0, 0, 0, date("m"), 1, date("y"));
$leap = date("L", $date);
// if it is a leap year set February to 29 days, otherwise 28
$monthdays[2] = ($leap ? 29 : 28);
$dateStart = date("g/1/y")
$dateEnd = date("g/".$monthdays[date("g")]."/y")
Hope it saves you time,
Peter
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40151
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40151&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40151&report=yes
Search -- http://master.php.net/manage/user-notes.php