- print_r: documentation ( source)
<?php
$date1 = new DateTime('2005-01-01T00:00:00+00:00');
$date2 = new DateTime('2004-12-26T23:59:59+00:00');
//$date2 = DateTime::createFromFormat('YmdHis', '2004' . $date1->format('md') . '235959');
$diff = $date2->diff($date1);
print_r($diff);