Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TIME_ZONE/USE_TZ settings don't appear to work correctly #3522

Open
InspectorCaracal opened this issue Apr 28, 2024 · 0 comments
Open
Labels
bug An actual error or unwanted behavior. needs-triage Yet to be looked at and verified as an a real issue/feature that could be worked on

Comments

@InspectorCaracal
Copy link
Contributor

InspectorCaracal commented Apr 28, 2024

Describe the bug

When setting TIME_ZONE to a specific timezone and USE_TZ to False, datetimes created are the correct timezone, and correctly stored as naive datetimes.

However, when USE_TZ is True, times are all recorded in UTC and displayed as the UTC clock time regardless of the TIME_ZONE setting.

Note: This may be a bug in the timestamping of the Msg object specifically, I did not investigate more deeply.

To Reproduce

Steps to reproduce the behavior:

  1. Define settings TIME_ZONE="EST" and USE_TZ=False, then page yourself.
  2. Check the date_created property of the most recent Msg object; it should be the correct current time in EST.
  3. Change USE_TZ to True and page yourself again.
  4. Check the date_created property of the most recent Msg object; it will be the current time in UTC, with the UTC timestamp.
  5. Check the page output for recent pages: it displays that most recent page as the UTC time, not the settings-defined timezone.

Expected behavior

The second situation should, I believe, be creating a datetime of e.g. 2024-04-28 00:15:21.894696-05:00 - the current time in EST, with the EST timezone offset - rather than the current outcome of 2024-04-28 05:15:21.894696+00:00 - the same time, but in UTC with the UTC offset.

The strangest part of it all is that the first situation is correctly altering the server's time to the specified timezone. My game's currently set timezone is not my current timezone and it is the correct offset from my computer's time.

Environment, Evennia version, OS etc

Evennia 3.2.0 (I realize this is outdated, didn't have a newer install handy to run)

Additional context

This issue appears to be preventing #3503 from being implemented correctly

@InspectorCaracal InspectorCaracal added bug An actual error or unwanted behavior. needs-triage Yet to be looked at and verified as an a real issue/feature that could be worked on labels Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An actual error or unwanted behavior. needs-triage Yet to be looked at and verified as an a real issue/feature that could be worked on
Projects
None yet
Development

No branches or pull requests

1 participant