Convert seconds to compound duration: Difference between revisions
Content deleted Content added
mNo edit summary |
mNo edit summary |
||
Line 1,033: | Line 1,033: | ||
sec = 6000000 |
sec = 6000000 |
||
week = floor(sec/60/60/24/7) |
week = floor(sec/60/60/24/7) |
||
if week > 0 see sec |
if week > 0 see sec |
||
see " seconds is " + week + " weeks" |
see " seconds is " + week + " weeks " ok |
||
day = floor(sec/60/60/24) % 7 |
day = floor(sec/60/60/24) % 7 |
||
if day > 0 see |
if day > 0 see day |
||
see " |
see " days " ok |
||
hour = floor(sec/60/60) % 24 |
hour = floor(sec/60/60) % 24 |
||
if hour > 0 see |
if hour > 0 see hour |
||
see |
see " hours" ok |
||
minute = floor(sec/60) % 60 |
minute = floor(sec/60) % 60 |
||
if hour > 0 see |
if hour > 0 see minute |
||
see |
see " minutes" + nl ok |
||
</lang> |
</lang> |
||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
<lang ruby>MINUTE = 60 |
<lang ruby>MINUTE = 60 |