Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Feb 16, 2025
1 parent d5fae47 commit 0d5a468
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions transmission_rpc/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import datetime


def format_timedelta(delta: datetime.timedelta) -> str:
"""
Format datetime.timedelta into <days> <hours>:<minutes>:<seconds>.
"""
minutes, seconds = divmod(delta.seconds, 60)
hours, minutes = divmod(minutes, 60)
return f"{delta.days:d} {hours:02d}:{minutes:02d}:{seconds:02d}"

0 comments on commit 0d5a468

Please sign in to comment.