获取当前月起始时间:
1.
$time=time();
$start=date('Y-m-01',$time);//获取指定月份的第一天
$end=date('Y-m-t',$time); //获取指定月份的最后一天
2.
$beginThismonth=mktime(0,0,0,date('m'),1,date('Y'));
$endThismonth=mktime(23,59,59,date('m'),date('t'),date('Y'));
3.
$start_time=Carbon::now()->startOfMonth();
$end_time=Carbon::now()->endOfMonth();
获取当前星期:
$start=Carbon::now()->startOfWeek();
$end=Carbon::now()->endOfWeek();
获取当日起始时间:
$start_time=Carbon::now()->startOfDay();
$end_time=Carbon::now()->endOfDay();
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
$endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;