mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 08:46:31 +01:00
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.
|
||||
# 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue