I discovered that a DateTime object in PHP can be compared to another as the \">\" and \"<\" operators are overloaded.
Is it the same with DateInterval?
A
If you're working with time intervals that are not longer than a month, it's easy to convert 2 intervals to seconds and compare. $dateInterval->format("%s") only returns the seconds component so I ended up doing this:
function intervalToSeconds($dateInterval) {
$s = (
($dateInterval->format("%d")*24*60*60) +
($dateInterval->format("%h")*60*60) +
($dateInterval->format("%i")*60) +
$dateInterval->format("%s")
);
return $s;
}