t3chguy
asked on
Adding two sets of minutes together php
I'm pulling the length of a video out of a database, that is in the format 00:00:00
I then want to add 15 minutes to that time to allot for total time required. I can't quite seem to get there.
$videotime = mysql_result($res2,$b, 0);
$quiztime = "00:15:00";
echo "Video time is: " . $videotime . '<br />';
echo "Quiz length is: " . $quiztime . '<br />';
// $duration = mktime ($videotime + $quiztime);
// $duration = date("i:s", $duration);
$hours_diff = ((strtotime($videotime)) + (strtotime($quiztime)));
echo date('h:i:s', $hours_diff)." Minutes";
echo '<br /><br />';
I then want to add 15 minutes to that time to allot for total time required. I can't quite seem to get there.
$videotime = mysql_result($res2,$b, 0);
$quiztime = "00:15:00";
echo "Video time is: " . $videotime . '<br />';
echo "Quiz length is: " . $quiztime . '<br />';
// $duration = mktime ($videotime + $quiztime);
// $duration = date("i:s", $duration);
$hours_diff = ((strtotime($videotime)) + (strtotime($quiztime)));
echo date('h:i:s', $hours_diff)." Minutes";
echo '<br /><br />';
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER