From 5cfdfe95a6b6d9a6ba6dfa58482aeef9a3ff8c4f Mon Sep 17 00:00:00 2001 From: Tim Chaplin Date: Mon, 18 Jan 2021 15:53:50 -0500 Subject: [PATCH] Revert "Make gametime use timezone-aware datetimes" This reverts commit 171694487501aa5eded17093cf0ada1eebed3761. --- evennia/utils/gametime.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/utils/gametime.py b/evennia/utils/gametime.py index d9b5a9b0e0..b280a83999 100644 --- a/evennia/utils/gametime.py +++ b/evennia/utils/gametime.py @@ -8,7 +8,7 @@ total runtime of the server and the current uptime. import time from calendar import monthrange -from datetime import datetime, timedelta, timezone +from datetime import datetime, timedelta from django.conf import settings from evennia import DefaultScript @@ -180,14 +180,14 @@ def real_seconds_until(sec=None, min=None, hour=None, day=None, month=None, year """ - current = datetime.fromtimestamp(gametime(absolute=True), timezone.utc) + current = datetime.fromtimestamp(gametime(absolute=True)) s_sec = sec if sec is not None else current.second s_min = min if min is not None else current.minute s_hour = hour if hour is not None else current.hour s_day = day if day is not None else current.day s_month = month if month is not None else current.month s_year = year if year is not None else current.year - projected = datetime(s_year, s_month, s_day, s_hour, s_min, s_sec, tzinfo=timezone.utc) + projected = datetime(s_year, s_month, s_day, s_hour, s_min, s_sec) if projected <= current: # We increase one unit of time depending on parameters