php日期所在月的第一天日期和最后一天
/**
* 日期所在月的第一天日期
* @return int
*/
public function getfirstdayofmonth ($format = 'timestamp') {
$day = $this->getpart('yy') . '-' . $this->getpart('mm') .
'-' . '01';
if ($format=='timestamp') {
$day = (int)$this->totimestamp($day);
}
return $day;
}
/**
* 日期所在月的最后一天日期
* @return int
*/
public function getlastdayofmonth ($format = 'timestamp') {
$day = $this->getpart('yy') . '-' . $this->getpart('mm') .
'-' . $this->daysofmonth();
if ($format=='timestamp') {
$day = (int)$this->totimestamp($day);
}
return $day;
}