From 049536d2b100a190aa571a1350b804861471c5fc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 8 Jun 2021 01:51:53 +0200 Subject: [PATCH] ultime fix tz --- src/utils/time.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/time.py b/src/utils/time.py index 64442a2..4e75dda 100644 --- a/src/utils/time.py +++ b/src/utils/time.py @@ -73,9 +73,10 @@ def timedeltaToString(time): def getAge(date): """Recupère un âge précisément à la seconde près""" - heureAjouter = int(str(UTCDatetimeToCustomDatetime(intToDatetime(nowUTC()))).split('+')[1].split(':')[0]) - joursRestants = intToDatetime(nowUTC()) - date - years = joursRestants.total_seconds() / (365.242 * 24 * 3600) + now = intToDatetime(nowUTC()) + heureAjouter = int(str(UTCDatetimeToCustomDatetime(now)).split('+')[1].split(':')[0]) + joursRestants = now - date + years = joursRestants.total_seconds() / (365.242 * 24 * 60 * 60) months = (years - int(years)) * 12 days = (months - int(months)) * (365.242 / 12) hours = (days - int(days)) * 24 @@ -95,7 +96,7 @@ def ageLayout(tuple): affichage = [5] if tuple[4] > 0: affichage = [4, 5] - for i in range(3, 0, -1): + for i in range(3, -1, -1): if tuple[i] > 0: affichage = [i, i + 1, i + 2] for i in affichage: