Convert seconds to hh:mm:ss in Python

Viewed 189325

How do I convert an int (number of seconds) to the formats mm:ss or hh:mm:ss?

I need to do this with Python code (and if possible in a Django template).

10 Answers
Related