mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Revert "Make gametime use timezone-aware datetimes"
This reverts commit 1716944875.
This commit is contained in:
parent
1716944875
commit
5cfdfe95a6
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue