My script calculate the difference in 2 time. Like this:
lasted = datetime.strptime(previous_time, FMT) - datetime.strptime(current_time, FMT)
It returns me a timedelta object. Currently, it gives me difference in seconds.
How can I format it for display nicely?
e.g. convert "121" to "00:02:01"?
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…