Re: Script to convert # of seconds to HH:mm
| From: | mjriding at wcoil dot com | Date: | Mon, 19 Mar 2001 22:26:02 +0000 |
| Subject: | Re: Script to convert # of seconds to HH:mm | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44637@lists.php.net to get a copy of this message | ||
How about something like this:
$secs = number of seconds;
$hours = intval($secs/360);
$minutes = intval(($secs-$hours*360)/60)
$seconds = $secs - $hours*360 - $minutes * 60;
Hope this helps.
Michael Ridinger
On Mon, 19 Mar 2001, Yoshi Melrose wrote:
> Can someone direct me or send me a script that will convert number of
> seconds into a format readable as HH:mm? I've tried making it myself, but it
> gets all messed up in the calculations. Thanks!!!!
>
> Yoshi
>
>
>