//当天开始时间
$start_time=strtotime(date("Y-m-d",time()));
//当天结束之间
$end_time=$start_time+60*60*24;
echo $start_time; 1541001600
echo $end_time; 1541088000
$start_time=date("Y-m-d H:i:s",$start_time);
$end_time=date("Y-m-d H:i:s",$end_time);
echo $start_time; 1541001600 //2018-11-01 00:00:00
echo $end_time; 1541088000 //2018-11-02 00:00:00
未经允许不得转载:肥猫博客 » php获取当天的开始时间和结束时间