Convert seconds in minutes, hours, days, years ...

Peter Hansen peter at engcorp.com
Thu Jan 16 09:09:26 EST 2003


Loko wrote:
> 
> Isn't there an already package that contains functions to convert a
> number of seconds into year, days, hours, minutes and seconds ?

>>> import time
>>> time.localtime(1042726065)
(2003, 1, 16, 9, 7, 45, 3, 16, 0)

(The meanings of the specific fields returned can be found in the 
documentation of course.)

-Peter




More information about the Python-list mailing list