mirror of https://github.com/borgbackup/borg.git
helpers.format_timedelta: use timedelta.total_seconds()
This commit is contained in:
parent
389ca94407
commit
bec5051ea5
|
@ -597,8 +597,7 @@ def format_time(t):
|
|||
def format_timedelta(td):
|
||||
"""Format timedelta in a human friendly format
|
||||
"""
|
||||
# Since td.total_seconds() requires python 2.7
|
||||
ts = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
||||
ts = td.total_seconds()
|
||||
s = ts % 60
|
||||
m = int(ts / 60) % 60
|
||||
h = int(ts / 3600) % 24
|
||||
|
|
Loading…
Reference in New Issue