Here, I coded this just for you. As far as I know it works.
function addtime($time1, $time2){
// By Matt Peoples
// First we need to get the position of the :. We do it here once so we
// we don't have to do it many times later.
$pos1 = strpos($time1, ":");
$pos2 = strpos($time2, ":");
// If there is no : then it's not a valid time. This will also take care
// of most stuff that isn't anything near a time.
if ((!$pos1) || (!$pos2)) return "ERROR: Time not valid";
// Next we separate out the hours and minutes.
$hours1 = substr($time1, 0, $pos1);
$minutes1 = substr($time1, $pos1 + 1, 2);
$hours2 = substr($time2, 0, $pos2);
$minutes2 = substr($time2, $pos2 + 1, 2);
// We can't have more than 59 minutes. If we do, we don't want it.
if (($minutes1 > 59) || ($minutes2 > 59)) return "ERROR: Time not valid";
// Add the times.
$resulth = $hours1 + $hours2;
$resultm = $minutes1 + $minutes2;
// If the minutes are greater than or equal to 60 then we have another
// hour that needs to be added to the time.
if ($resultm / 60 >= 1) {
$resulth++;
$resultm -= 60;
}
// If the number is less than 10 then we need to pad it with a 0 to make
// it look nice.
if ($resultm < 10) $resultm = "0" . $resultm;
// Stick the : back on there and return the result. Done!
$result = $resulth . ":" . $resultm;
return $result;
}
This will display what the added times will be. If you want to know what time it would be after the times are added you need to subtract 12 from the hours if the result hours are greater than or equal to 12 or something like that.
Here it is in action http://matt.illimited.net/phpstuff/addtimes.php
Hope this is helpful.