I runned into few examples where people share code for calculating the difference between two days.
Eg.
$now = new DateTime(); $itemDate->diff($n
r - Sign "-" when the difference is negative, empty when positive a - Total number of days as a result of a DateTime::diff() or (unknown) otherwise.
As an example,
diff($now)->format("%r%a"); echo $x; ?>
Output: string(4) "-287"