Fix login/out announcement bug based on server time settings

This commit is contained in:
Kami Hines 2020-10-03 21:13:16 -07:00
parent bec7151b9e
commit cc9ec55fef

View file

@ -1262,7 +1262,10 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
]
except Exception:
logger.log_trace()
now = timezone.localtime()
if settings.USE_TZ:
now = timezone.localtime()
else:
now = timezone.now()
now = "%02i-%02i-%02i(%02i:%02i)" % (now.year, now.month, now.day, now.hour, now.minute)
if _MUDINFO_CHANNEL:
_MUDINFO_CHANNEL.tempmsg(f"[{_MUDINFO_CHANNEL.key}, {now}]: {message}")