Convert seconds to compound duration: Difference between revisions

Content added Content deleted
(add REXX)
m (→‎Python: Procedural: copy-paste error fixed.)
Line 159: Line 159:
===Python: Procedural===
===Python: Procedural===
<lang python>>>> def duration(seconds):
<lang python>>>> def duration(seconds):
times= []
t= []
for dm in (60, 60, 24, 7):
for dm in (60, 60, 24, 7):
seconds, m = divmod(seconds, dm)
seconds, m = divmod(seconds, dm)