Answers for "datetime.timedelta format to string python"

0

datetime.timedelta format to string python

s = 13420
hours, remainder = divmod(s, 3600)
minutes, seconds = divmod(remainder, 60)
print '{:02}:{:02}:{:02}'.format(int(hours), int(minutes), int(seconds))
# result: 03:43:40
Posted by: Guest on June-10-2021

Code answers related to "datetime.timedelta format to string python"

Python Answers by Framework

Browse Popular Code Answers by Language