note 41737 deleted from function.date by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 21 Apr 2004 15:47:48 +0000 |
| Subject: | note 41737 deleted from function.date by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68453@lists.php.net to get a copy of this message | ||
Note Submitter: masa2@webpalvelut.com
----
First day of month and last day of month. Very quick.
<?
function lastDayOfMonth($timestamp = ''){
if($timestamp=='') $timestamp=time();
return(
mktime(0,0,0,
date("m",$timestamp)+1,
1,
date("Y",$timestamp)
)-3600*24);
}
function firstDayOfMonth($timestamp=''){
if($timestamp=='') $timestamp=time();
return(mktime(0,0,0,
date("m",$timestamp),
1,
date("Y",$timestamp)
));
}
$timestamp = mktime(0,0,0,2,12,2004);
print date("d.m.Y",firstDayOfMonth($timestamp)) . "<br>";
print date("d.m.Y",lastDayOfMonth($timestamp)) . "<br>";
?>