sum of time and average of time in hh:mm:ss format javascript php
Answers
Answered by
1
How to sum N number of time (HH:MM Format)?
php time sum
I am using the following sample code to calculate sum of two different time values. Now I want to get the sum of N number of time values.
// numbers for testing $o="12:59"; $p="0:58"; // display for testing echo "$o<br />"; echo "$p<br />"; echo AddPlayTime($o,$p); // FUNCTION - ADD HOURS and MINUTES function AddPlayTime ($oldPlayTime, $PlayTimeToAdd) { $old=explode(":",$oldPlayTime); $play=explode(":",$PlayTimeToAdd); $hours=$old[0]+$play[0]; $minutes=$old[1]+$play[1]; if($minutes > 59){ $minutes=$minutes-60; $hours++; } if($minutes < 10){ $minutes = "0".$minutes; } if($minutes == 0){ $minutes = "00"; } $sum=$hours.":".$minutes; return $sum; }
Plzz mark as brainliest answer
php time sum
I am using the following sample code to calculate sum of two different time values. Now I want to get the sum of N number of time values.
// numbers for testing $o="12:59"; $p="0:58"; // display for testing echo "$o<br />"; echo "$p<br />"; echo AddPlayTime($o,$p); // FUNCTION - ADD HOURS and MINUTES function AddPlayTime ($oldPlayTime, $PlayTimeToAdd) { $old=explode(":",$oldPlayTime); $play=explode(":",$PlayTimeToAdd); $hours=$old[0]+$play[0]; $minutes=$old[1]+$play[1]; if($minutes > 59){ $minutes=$minutes-60; $hours++; } if($minutes < 10){ $minutes = "0".$minutes; } if($minutes == 0){ $minutes = "00"; } $sum=$hours.":".$minutes; return $sum; }
Plzz mark as brainliest answer
Answered by
1
Answer:
hiii how are you dear Mark me as brilliant Please
Similar questions