From b807ffbba88b8c6e282e2e871477c0aad2d3799a Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 7 Sep 2019 22:02:08 +0100 Subject: force timezone info on to badge dates --- modules/badges.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/badges.py b/modules/badges.py index 502401cf..854e6ff2 100644 --- a/modules/badges.py +++ b/modules/badges.py @@ -10,7 +10,7 @@ DATE_FORMAT = "%Y-%m-%d" class Module(ModuleManager.BaseModule): def _now(self): - return datetime.datetime.utcnow() + return datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) def _parse_date(self, dt: str): if dt.lower() == "today": @@ -24,7 +24,7 @@ class Module(ModuleManager.BaseModule): year=int(match.group(1)), month=int(match.group(2)), day=int(match.group(3)) - ) + ).replace(tzinfo=datetime.timezone.utc) def _date_str(self, dt: datetime.datetime): return datetime.datetime.strftime(dt, DATE_FORMAT) -- cgit v1.3.1-10-gc9f91