Date calculations from 2 custom fields

I don’t know how much this will help, but when I’ve done date/time comparisons, I’ve always had to convert them to UNIX timestamps first (converts the date/time to a numeral, which you can compare as less than/greater than/equal to the next number), and then after the difference is sorted, convert it back with date().

A simple example (not of your code, but of a quickie I did for a client a couple of years ago) was to do this:

$today = date('d-m-Y');                       // today's date
$today = strtotime($today);                    // UNIX conversions  

I’ve never had luck doing date comparisons without converting them to UNIX first.