Home >Backend Development >PHP Tutorial >Calculate the start point and end point timestamp of the day and get the data of the day_PHP tutorial
[php] /*
*+ ----------------------------------
* Calculate the start point and end point timestamp of the day and go to the data of the day
*+--------------------------------
*/
$daybegin=strtotime(date("Ymd"));
$dayend=$begin+86400;
$query = "SELECT * FROM `info` WHERE addtime<$dayend AND addtime>$daybegin";
/*
*+ ----------------------------------
* Calculate the start point and end point timestamp of the day and get the data of the day
*+ ----------------------------
*/
$daybegin=strtotime(date("Ymd"));
$dayend=$begin+86400;
$query = "SELECT * FROM `info` WHERE addtime<$dayend AND addtime>$daybegin";