$thismonth = date('m');
$thisyear = date('Y');
if ($thismonth == 1) {
$lastmonth = 12;
$lastyear = $thisyear - 1;
} else {
$lastmonth = $thismonth - 1;
$lastyear = $thisyear;
}
$lastStartDay = $lastyear . '-' . $lastmonth . '-1';
$lastEndDay = $lastyear . '-' . $lastmonth . '-' . date('t', strtotime($lastStartDay));
$b_time = strtotime($lastStartDay);//上个月的月初时间戳
$e_time = strtotime($lastEndDay);//上个月的月末时间戳
return $b_time.$e_time;
posted on 2019-03-21 15:03  baraka  阅读(738)  评论(0编辑  收藏  举报