Timeconvertion
Posted: Thu Aug 12, 2004 3:14 am
Hi
How can I convert e.g 135 minutes to 02:15:00, without writing tons of code?
[edit]
regards tores
How can I convert e.g 135 minutes to 02:15:00, without writing tons of code?
[edit]
Code: Select all
<?php
$minutes = 135;
$mins = $minutes % 60;
$hours = ($minutes - $mins) / 60;
$mins = sprintf("%02s", $mins);
$hours = sprintf("%02s", $hours);
$timestamp = $hours.":".$mins.":00";
?>