代碼php
//計算出當天的開始時間、結束時間 $year = date("Y"); $month = date("m"); $day = date("d"); $dayBegin = mktime(0,0,0,$month,$day,$year);//當天開始時間戳 $dayEnd = mktime(23,59,59,$month,$day,$year);//當天結束時間戳 $dayStrBegin=date("Y-m-d H:i:s",$dayBegin); $dayStrEnd=date("Y-m-d H:i:s",$dayEnd);
output:code
2015-08-27 00:00:00
2015-08-27 23:59:59class