hardcoded updates

This commit is contained in:
buenosairesam
2025-05-08 22:58:56 -03:00
parent 706ed2039c
commit 0b9f23fafd
4 changed files with 18 additions and 32 deletions

View File

@@ -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):