I am a little stuck with the DateIntervalPHP class . What I really want is the number of seconds elapsed between the two marks DateTime.
$t1 = new DateTime( "20100101T1200" );
$t2 = new DateTime( "20100101T1201" );
echo "difference in seconds: ".$t1->diff($t2)->format("%s");
But all I get is zero. Class is DateIntervalnot suitable for arithmetic? How can I get the “exact” number of seconds (or hours or something else) between two timestamps?
xtofl source
share