From 40c574f4fceda1499be943fd6fa2060e83c9ec07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20S=C3=A1nchez?= Date: Wed, 20 Oct 2021 10:04:14 +0200 Subject: [PATCH] report fix --- autoficher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoficher.py b/autoficher.py index e91406b..e1eee63 100755 --- a/autoficher.py +++ b/autoficher.py @@ -153,11 +153,11 @@ class AutoFicher(): self.sendReport('Corriendo en modo debug. No se realizará ninguna acción') if response.status_code == 200: if rj['Repeated']: - time = datetime.now().astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M") + time = datetime.strptime(rj['RepeatedTime'], "%Y-%m-%dT%H:%M:%SZ").replace( + tzinfo=pytz.utc).astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M") self.sendReport("Se ha realizado un marcaje antes a las %s" % time) else: - time = datetime.strptime(self.headers["tn-d"], "'%Y-%m-%dT%H:%M:%SZ'").replace( - tzinfo=pytz.utc).astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M") + time = datetime.now().astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M") rtext = 'fichado' if typ: