Hi All I\'m trying to calculate elapsed time in php. The problem is not in php, it\'s with my mathematical skills. For instance: Time In: 11:35:20 (hh:mm:ss), now say the
Using PHP >= 5.3 you could use DateTime and its method DateTime::diff(), which returns a DateInterval object:
PHP >= 5.3
$first = new DateTime( '11:35:20' ); $second = new DateTime( '12:00:45' ); $diff = $first->diff( $second ); echo $diff->format( '%H:%I:%S' ); // -> 00:25:25