- $Y = 2016;//獲取年,示例,真實環境從前端獲取數據
- $m = 8;//獲取月,示例,真實環境從前端獲取數據
- $month = $Y."-".$m;//當前年月
- $month_start = strtotime($month);//指定月份月初時間戳
- $month_end = mktime(23, 59, 59, date('m', strtotime($month))+1, 00);//指定月份月末時間戳
- //dump(array("month"=>$month,"month_start"=>$month_start,"month_end"=>$month_end));//輸出
當天的開始和結束前端
$current=date("y-m-d",time());
$sign['startime']=strtotime($current);
$sign['endtime']=mktime(23, 59, 59, date('m-d', strtotime($current))+1, 00);date