Cod: Selectaţi tot
function m2h($mins) {
if ($mins < 0) {
$min = Abs($mins);
} else {
$min = $mins;
}
$H = Floor($min / 60);
$M = ($min - ($H * 60)) / 100;
$hours = $H + $M;
if ($mins < 0) {
$hours = $hours * (-1);
}
$expl = explode(".", $hours);
$H = $expl[0];
if (empty($expl[1])) {
$expl[1] = 00;
}
$M = $expl[1];
if (strlen($M) < 2) {
$M = $M . 0;
}
$hours = $H . ":" . $M;
return $hours;
}
$totaltime = 1500;
$timp = m2h($totaltime);
echo $timp;
La timp va fi 25:00, adică 25 de ore şi 00 minute, aş dori să îmi arate aşa:
1:1:00 Sau 1zi/2zile , 1ora/2ore şi 00 minute
Mulţumesc!
