Quote:
Originally Posted by <VeCo>
PHP Code:
seconds % 60 // returns seconds seconds / 60 // returns minutes seconds / 60 / 60 // returns hours
|
If the time is actually 1 hour 15 minutes and 32 seconds your code will return 1 hour 75 minutes and 32 seconds. That is OK if you are not going to only use minutes and seconds but not if you want to use all three.
This is the correct method when wanting to use days, hours, minutes, and seconds (days can easily be omitted):
PHP Code:
iDays = iTimeLeft / 86400
iHours = iTimeLeft % 86400 / 3600
iMinutes = iTimeLeft % 3600 / 60
iSeconds = iTimeLeft % 60
__________________