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

Review Django timezone settings #785

Open
jsjiang opened this issue Nov 8, 2024 · 0 comments
Open

Review Django timezone settings #785

jsjiang opened this issue Nov 8, 2024 · 0 comments

Comments

@jsjiang
Copy link
Contributor

jsjiang commented Nov 8, 2024

A note from Django:

The default value of USE_TZ will change from False to True in Django 5.0.

Set USE_TZ to False in your project settings if you want to keep the current default behavior.
USE_TZ = False

Investigate if we need to set USE_TZ to True.

It is interesting to notice that Django/Python and mySQL perform DST and standard time conversion when converting the timestamp (seconds_since_epoch) to date/time string.

Here are the timestamps taken from the following proc-cleanup-async-queues log entry:

  • log entry was created: on 11/08 at 09:42:00 PST,
  • the timestamp range for the select query is between t1=1730482920 and t2=1731087720
    • t2 is current timestamp, t1 = t2 - 606024*7 (a week in seconds)
    • this maps to date/time range: date1=2024-11-01 10:42:00 and date2=2024-11-08 09:42:00
      • note: date1 is PST while date2 is PDT

The date/time strings can be generated by using select from_unixtime(1730482920), from_unixtime(1731087720) and the datetime.fromtimestamp(seconds_since_epoch) function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant