note 75905 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:34:22 +0000 |
| Subject: | note 75905 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128541@lists.php.net to get a copy of this message | ||
Note Submitter: vritzka~gmail~com
----
//this returns timestamps from 1st of given month and last
//day of given month
// example:
//$month = 01
// $year = 2007
function get_month_range($month,$year) {
//get timestamp first day of the month
$start = strtotime($year . "-" . $month . "-01",time());
//hww many days in that month?
$days_of_month = date(t,$start);
//get timestamp last day of month
$end = strtotime($year . "-" . $month . "-" . $days_of_month . "
23:59:59",time());
return array($start, $end);
}