php获取当天的00:00:00~23:59:59

 这是转换后的格式:

$todayStart= date('Y-m-d 00:00:00', time()); //2016-11-01 00:00:00

$todayEnd= date('Y-m-d 23:59:59', time()); //2016-11-01 23:59:59

这是时间戳格式:

$year = date("Y");
$month = date("m");
$day = date("d");
$start = mktime(0,0,0,$month,$day,$year);//当天开始时间戳
$end= mktime(23,59,59,$month,$day,$year);//当天结束时间戳

 

你可能感兴趣的:(分享)