//获取下个月的月份 public function getNextMonthDays($date){ $timestamp=strtotime($date); $arr=getdate($timestamp); if($arr[‘mon‘] == 12){ $year=$arr[‘year‘] +1; $month=$arr[‘mon‘] -11; $firstday=$year.‘-0‘.$month.‘-01‘; $lastday=date(‘Y-m‘,strtotime("$firstday +1 month -1 day")); }else{ $firstday=date(‘Y-m‘,strtotime(date(‘Y‘,$timestamp).‘-‘.(date(‘m‘,$timestamp)+1).‘-01‘)); $lastday=date(‘Y-m‘,strtotime("$firstday +1 month -1 day")); } return $lastday; }
原文地址:https://www.cnblogs.com/xieling2100-fei/p/8321132.html
时间: 2024-10-06 14:28:16