我在MySQL数据库中录制了stored date
。如何比较stored date
是否超过10天?
存储的日期格式为YYYY-m-d
(2015.01.01)
$today = date('Y-m-d');
foreach ($result as $val){
$dbDate = $val["storedDate"];
}
答案 0 :(得分:3)
$today = date('Y-m-d');
foreach ($result as $val){
if((time() - strtotime($val["storedDate"])) > (60 * 60 * 24 * 10)){
//do something
}
}