How can I convert integer to time in minutes e.g. 5
would give 30mins
. I've tried
<?php
$toMin = 5;
echo date('i', ($toMin*60)).'mins';
?>
But it only returns 05mins
How can I convert integer to time in minutes e.g. 5
would give 30mins
. I've tried
<?php
$toMin = 5;
echo date('i', ($toMin*60)).'mins';
?>
But it only returns 05mins
so something like:
$time='7.5'; //, 8.3, 2.2.
$x=explode('.',$time);
$min=60*($x[1]/10);
echo $x[0] .'hours and '.$min.'mins';