I would like to find total time spent on a project given that the user enters the "start time" and "stop time". I have been able to access the time spent but it comes as an array of Date Interval.
I want to just format the results to "H:i:s" (Hour:Minute:Seconds)
Here's the code from my controller
I have already declare the use of Carbon Class(use Carbon/Carbon;) at the top of the controller
$start = Carbon::parse($request->strt_time);
$end = Carbon::parse($request->stp_time);
$time_spent = $end->diff($start);
$spent_time = $time_spent->format('H:i:s');
I expect the output to be 00:00:00 but I am getting a string "H:i:s"