Make note of the timezone dependence of datetime.datetime.fromtimestamp.
This commit is contained in:
parent
f0ef1a648e
commit
f48e8e1fab
1 changed files with 1 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ class ExtendedRoom(DefaultRoom):
|
||||||
# get the current time as parts of year and parts of day.
|
# get the current time as parts of year and parts of day.
|
||||||
# we assume a standard calendar here and use 24h format.
|
# we assume a standard calendar here and use 24h format.
|
||||||
timestamp = gametime.gametime(absolute=True)
|
timestamp = gametime.gametime(absolute=True)
|
||||||
|
# note that fromtimestamp includes the effects of server time zone!
|
||||||
datestamp = datetime.datetime.fromtimestamp(timestamp)
|
datestamp = datetime.datetime.fromtimestamp(timestamp)
|
||||||
season = float(datestamp.month) / MONTHS_PER_YEAR
|
season = float(datestamp.month) / MONTHS_PER_YEAR
|
||||||
timeslot = float(datestamp.hour) / HOURS_PER_DAY
|
timeslot = float(datestamp.hour) / HOURS_PER_DAY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue