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