Commit 9a52a570 authored by Hugo Posnic's avatar Hugo Posnic

Simplify last_sync calculation

parent 5964d359
......@@ -635,12 +635,9 @@ class PacmanMirrors:
:return: elapsed_time
"""
total_seconds = (point_in_time - timestamp).total_seconds()
total_minutes = total_seconds // 60
elapsed_hours = total_minutes // 60
elapsed_minutes = total_minutes % 60
elapsed_time = "{}:{}".format(
str(int(elapsed_hours)).zfill(2),
str(int(elapsed_minutes)).zfill(2))
hrs = str(int(total_seconds / 3600)).zfill(2)
mins = str(int(total_seconds % 3600 / 60)).zfill(2)
elapsed_time = "{}:{}".format(hrs, mins)
return elapsed_time
@staticmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment