[PHP] Re: convert seconds to hours, minutes, seconds

2003-06-03 Thread Yves Daemen
It's just some mathematics: assume $time is the value in seconds: $secs= $time % 60; $totalMinutes = ( $time - $secs ) / 60; $minutes = $totalMinutes % 60; $hours = ( $totalMinutes - $minutes ) / 60; Now you can do like this: echo "$time secondes is $hours hours, $minutes minutes and $sec

[PHP] Re: convert seconds to hours, minutes, seconds

2003-06-03 Thread Jakob Mund
use the standard mathematics: like 178607 / 60 / 60 = Hours ( u have to round down to the nearest integer ) then u substract the number of hours*3600 from the 178607 seconds. then you have to divide the number you get by 60 and you got the minutes ( remember to round down to the nearest integer ).