Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #format #string #python
ADD COMMENT
Topic
Name
4+9 =