hardcoded updates
This commit is contained in:
@@ -30,17 +30,17 @@ def now():
|
||||
return datetime.now(timezone)
|
||||
|
||||
|
||||
def convert_seconds(seconds):
|
||||
days = seconds // 86400 # 86400 seconds in a day
|
||||
def convert_seconds(seconds, use_days=False):
|
||||
days = seconds // 86400
|
||||
hours = (seconds % 86400) // 3600
|
||||
minutes = (seconds % 3600) // 60
|
||||
remaining_seconds = seconds % 60
|
||||
if days > 0:
|
||||
|
||||
if use_days:
|
||||
return "{} days, {:02d}:{:02d}:{:02d}".format(
|
||||
days, hours, minutes, remaining_seconds
|
||||
)
|
||||
else:
|
||||
return "{:02d}:{:02d}:{:02d}".format(hours, minutes, remaining_seconds)
|
||||
return "{:02d}:{:02d}:{:02d}".format(hours + days * 24, minutes, remaining_seconds)
|
||||
|
||||
|
||||
def extract(line):
|
||||
|
||||
Reference in New Issue
Block a user