What I am trying to do is add up hours/mins/secs that span over 24 hours, for example:
12:39:25
08:22:10
11:08:50
07:33:05
What I would like it to return is "39:43:30" rather than a date from 1970. Below is the code I'm currently using (note - its from within a class, not just a function).
private function add_time($time1, $time2)
{
$first_exploded = explode(":", $time1);
$second_exploded = explode(":", $time2);
$first_stamp = mktime($first_exploded[0],$first_exploded[1],$first_exploded[2],1,1,1970);
$second_stamp = mktime($second_exploded[0],$second_exploded[1],$second_exploded[2],1,1,1970);
$time_added = $first_stamp + $second_stamp;
$sum_time = date("H:i:s",$time_added);
return $sum_time;
}
Any advise would be much appreciated.