问题
In python how can I simply convert an integer of seconds into (h:m:s) using the datetime module?
i.e. 500000 ---> 138:53:20
Please, no tuple hackery.
回答1:
Maybe this answer from SO will do:
>>> import datetime
>>> str(datetime.timedelta(seconds=500000))
'5 days, 18:53:20'
来源:https://stackoverflow.com/questions/25193464/convert-seconds-to-datetime-timedelta