作者:Shimmoon | 来源:互联网 | 2023-10-11 00:33
#获取当前月的天数$month_now_daysdate(t);#获取某月的天数$month_certain_daysdate(t,strtotime(1993-8-1));#
$month_now_days = date('t');
$month_certain_days = date('t',strtotime('1993-8-1'));
$next_month_now_date = date('Y-m-d',strtotime('next month'));
$last_month_now_date = date('Y-m-d',strtotime('last month'));
$now_month_first_date = date('Y-m-1');
$now_month_last_date = date('Y-m-d',strtotime(date('Y-m-1',strtotime('next month')).'-1 day'));
$last_month_first_date = date('Y-m-1',strtotime('last month'));
$last_month_end_date = date('Y-m-d',strtotime(date('Y-m-1').'-1 day'));
$next_month_first_date = date('Y-m-1',strtotime('next month'));
$next_month_last_date = date('Y-m-d',strtotime(date('Y-m-1',strtotime('next month')).'+1 month -1 day'));
$firstday = date('Y-m-01', strtotime($date));
$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));
return array($firstday, $lastday);