Make note of the timezone dependence of datetime.datetime.fromtimestamp.

This commit is contained in:
Griatch 2017-02-28 00:07:05 +01:00
parent f0ef1a648e
commit f48e8e1fab

View file

@ -133,6 +133,7 @@ class ExtendedRoom(DefaultRoom):
# get the current time as parts of year and parts of day.
# we assume a standard calendar here and use 24h format.
timestamp = gametime.gametime(absolute=True)
# note that fromtimestamp includes the effects of server time zone!
datestamp = datetime.datetime.fromtimestamp(timestamp)
season = float(datestamp.month) / MONTHS_PER_YEAR
timeslot = float(datestamp.hour) / HOURS_PER_DAY