add a function to format a time into a duration. Can't use date() because 0 doesn't give us 00:00:00 it gives 19:00:00

This commit is contained in:
Isaac Connor 2019-01-21 11:16:14 -05:00
parent b24b930f65
commit fbc236128e
1 changed files with 4 additions and 0 deletions

View File

@ -2446,4 +2446,8 @@ function getAffectedIds( $name ) {
return $ids;
}
function format_duration($time, $separator=':') {
return sprintf('%02d%s%02d%s%02d', floor($time/3600), $separator, ($time/60)%60, $separator, $time%60);
}
?>