PHP convert minutes to hours
Just a little function i made;
function minutes_to_hours($inmin){
$lh = floor($inmin/60);
$lm = $inmin - ($lh*60);
if ($lh > 0) return $lh.'h '.$lm.'m';
return '0h '.$lm.'m';
}
So calling minutes_to_hours(125) = 2h 5m
We are a Felixstowe Based Web Design Company. This Blog contains code and other useful articles. The Suffolk Web Design Blog is a resource for the Website - http://www.suffolk-web-design.co.uk/.
Just a little function i made;
function minutes_to_hours($inmin){
$lh = floor($inmin/60);
$lm = $inmin - ($lh*60);
if ($lh > 0) return $lh.'h '.$lm.'m';
return '0h '.$lm.'m';
}
So calling minutes_to_hours(125) = 2h 5m