指定年月月初月末时间戳

$month = I('month');
if(empty($month)){//没有设置月份,取当月数据
$month = date('Y-m');
}
$year = gmdate("Y", strtotime($month));
$month_start = strtotime($month);//指定月份月初时间戳
$month_end = mktime(23, 59, 59, date('m', strtotime($month))+1, 0,$year);//指定月份月末时间戳

猜你喜欢

转载自www.cnblogs.com/tangqiang2/p/9244438.html