$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;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2020-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2017-12-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案