I want to get time difference in HH:MM:SS format below is the code
if time diff in seconds it should display l like 00:00:35 In minutes :00:30:35 In Hrs :01:30:35
use
$hours = $interval->format('%H'); $minutes = $interval->format('%I'); $seconds = $interval->format('%S');
and concat both three for one variable
or use $interval->format('%H:%I:%S') for single output
$interval->format('%H:%I:%S')
//output 00:30:35