Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

format timedelta python

def strfdelta(tdelta, fmt):
    d = {"days": tdelta.days}
    d["hours"], rem = divmod(tdelta.seconds, 3600)
    d["minutes"], d["seconds"] = divmod(rem, 60)
    return fmt.format(**d)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #format #timedelta #python
ADD COMMENT
Topic
Name
8+7 =