I just edit my question I have have two time format i want the difference between them
For example
$time1 = new DateTime('09:00:59');
$time2 = new DateTime('100:30:00');
$interval = $time1->diff($time2);
echo $interval->format('%h:%i:%s second(s)');
?>
Its working fine below 24 hour showing me fatal error if i am increasing time2
$time2 = new DateTime('100:30:00');
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [datetime.--construct]: Failed to parse time string (100:30:00) at position 0 (1): Unexpected character' in D:\xampp\htdocs\datetime.php:3 Stack trace: #0 D:\xampp\htdocs\datetime.php(3): DateTime->__construct('100:30:00') #1 {main} thrown in D:\xampp\htdocs\datetime.php on line 3
Is there any other way or i can edit the same I have try a lot but not find out the soloution I just want the diffrence using any method Thanks
strtotime
but that is for timestamps, so 24 would be the cap as that is 12 midnight So you would need to include days? – Aravona