From dbf4a7865139199a27a581666a6320d18badc883 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 19 Apr 2022 21:03:23 +0100 Subject: [PATCH] Fix datetime parsing --- handler/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler/util.py b/handler/util.py index d589592..76c43cb 100644 --- a/handler/util.py +++ b/handler/util.py @@ -123,10 +123,11 @@ def last_online_recent(date): date[1].replace(":", "") date = "+".join(date_split) date_string = "%Y-%m-%dT%H:%M:%S%z" + now = datetime.now(timezone.utc) else: date_string = "%Y-%m-%dT%H:%M:%S.%fZ" + now = datetime.now() date_parsed = datetime.strptime(date, date_string) - now = datetime.now(timezone.utc) sec_ago_date = (now - date_parsed).total_seconds() return sec_ago_date < 172800