Convert seconds in minutes, hours, days, years ...
dsegan at STOPSPAM.gmx.net
Thu Jan 16 14:47:30 CET 2003
> Isn't there an already package that contains functions to convert a
> number of seconds into year, days, hours, minutes and seconds ?
If I understand correctly, you need the time module:
>>> import time
(2014, 9, 7, 6, 50, 8, 6, 250, 1)
(2014, 9, 7, 4, 50, 8, 6, 250, 0)
The actual number of seconds is a number of seconds since the start of
If I misunderstood, and you needed to convert seconds to fraction of
hours, days, and so forth (but just one of them), you use the builtin
(3445561, 57426.01666666667, 957.10027777777782, 39.879178240740742, 0.10918557122024986)
> Do I have to write it ?
I guess not.
More information about the Python-list