PHP datetime
$EndDate = date_create(%MYSQL DATETIME FORMAT%); date_add($EndDate,new DateInterval('P7D')); //Add 7 days $Now = date_create(date('Y-m-d H:i:s')); //$DiffDate = date_diff($Now,$EndDate); //Returns larger-than-zero integer //echo $DiffDate->format('%d'); if ($EndDate>$Now) { $Larger=true; } else { $Larger=false; }