Skip to content

Commit

Permalink
[Utils] Fixed precedence issue for removing leading zeroes
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Jul 13, 2021
1 parent 2a48033 commit e0e8b03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chat_downloader/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def seconds_to_time(seconds, format='{}:{:02}:{:02}', remove_leading_zeroes=True
h, remainder = divmod(abs(int(seconds)), 3600)
m, s = divmod(remainder, 60)
time_string = format.format(h, m, s)
return ('-' if seconds < 0 else '') + re.sub(r'^0:0?', '', time_string) if remove_leading_zeroes else time_string
return ('-' if seconds < 0 else '') + (re.sub(r'^0:0?', '', time_string) if remove_leading_zeroes else time_string)


def microseconds_to_timestamp(microseconds, format='%Y-%m-%d %H:%M:%S'):
Expand Down

0 comments on commit e0e8b03

Please sign in to comment.