Skip to content
New issue

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

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

Already on GitHub? # to your account

Switch to timezone names instead of utc offsets #45

Merged
merged 1 commit into from
Apr 1, 2021
Merged

Conversation

lanjelot
Copy link
Collaborator

@lanjelot lanjelot commented Mar 29, 2021

So this actually bit me last weekend during Volga, I thought I still had time left but the ctf had actually ended an hour ago. This was because in France we switched to summer daylight saving during Sat->Sun night and my profile was still set to UTC+1 on Sunday when I should have changed it to UTC+2 on Sunday morning. To address this issue, i propose we switch to timezone names.

The switch will unfortunately reset everyone's timezone setting in their profile to UTC. It is actually best to reset everyone's timezone to UTC and ask everyone to set their timezone again with the correct timezone name because we cannot possibly find out for sure the correct timezone name from the member's offset as more than one possible timezone name usually would match a specific offset. For example UTC+1 would have more than one matching candidate: Atlantic/Canary, Europe/Longon etc. (and actually wouldnt even yield Europe/Paris). The only alternative I can think of is for the dba to manually update every member's timezone offset to the most plausible timezone name based on the member's Country.

N.B:

  • The module pytz actually already comes installed by default with django.
  • I copy/pasted the timezone name choices from pytz.common_timezones
  • The default timezone name is UTC for any new member created, and every existing member will have their timezone reset to UTC by the migration.

Thoughts?

@hugsy
Copy link
Owner

hugsy commented Mar 29, 2021

Awesome, using a proper timezone is indeed more suited.

I'll be testing soon. Thanks

@hugsy hugsy merged commit 1dfe07d into master Apr 1, 2021
@hugsy hugsy deleted the use-tznames branch April 1, 2021 04:25
@hugsy hugsy added this to the 0.1 milestone Jun 21, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants