Home >> Snippet List >> Snippet

Name
Convert minutes to hours #1
Description
Convert minutes into an HH:mm format
PHP Snippet
<?PHP
 
// convert minutes to hours:minutes
$act_elapsedHoursMins = SPRINTF("%d:%02d", ABS((int)($act_elapsed_mins/60)), ABS((int)($act_elapsed_mins%60)));
 
$sch_elapsedHoursMins = SPRINTF("%d:%02d", ABS((int)($sch_elapsed_mins/60)), ABS((int)($sch_elapsed_mins%60)));
 
?>