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: