From 126884155cd239c80b0d65deb198c405e4ac8a6a Mon Sep 17 00:00:00 2001 From: ZKWolf <34097612+wolfswolke@users.noreply.github.com> Date: Thu, 25 Apr 2024 03:31:09 +0200 Subject: [PATCH] Set time to UTC --- src/logic/time_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logic/time_handler.py b/src/logic/time_handler.py index 8b48d87..2193fb2 100644 --- a/src/logic/time_handler.py +++ b/src/logic/time_handler.py @@ -34,11 +34,11 @@ def get_lifetime(challenge_type): # "expirationTime":"2019-11-25T17:59:59.000Z" # } if challenge_type == "Daily": - creation_time = datetime.datetime.now().isoformat(timespec='milliseconds') - expiration_time = (datetime.datetime.now() + datetime.timedelta(days=1)).replace(hour=23, minute=59, second=59, microsecond=0).isoformat(timespec='milliseconds') + creation_time = datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='milliseconds') + expiration_time = (datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=1)).replace(hour=23, minute=59, second=59, microsecond=0).isoformat(timespec='milliseconds') elif challenge_type == "Weekly": - creation_time = datetime.datetime.now().isoformat(timespec='milliseconds') - expiration_time = (datetime.datetime.now() + datetime.timedelta(days=7)).replace(hour=23, minute=59, second=59, microsecond=0).isoformat(timespec='milliseconds') + creation_time = datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='milliseconds') + expiration_time = (datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=7)).replace(hour=23, minute=59, second=59, microsecond=0).isoformat(timespec='milliseconds') else: return None return creation_time, expiration_time