say $d1->ymd . ' is ' . ('earlier than', 'equal to', 'later than')[DateTime->compare( $d1, $d2 ) + 1] . ' ' . $d2->ymd;