mirror of
https://github.com/django/django.git
synced 2025-10-02 23:04:53 +00:00
Fixed #32365 -- Made zoneinfo the default timezone implementation.
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
This commit is contained in:
parent
7132d17de1
commit
306607d5b9
27 changed files with 635 additions and 280 deletions
|
@ -4,7 +4,10 @@ import re
|
|||
from datetime import datetime, timedelta
|
||||
from importlib import import_module
|
||||
|
||||
import pytz
|
||||
try:
|
||||
import zoneinfo
|
||||
except ImportError:
|
||||
from backports import zoneinfo
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
|
@ -967,8 +970,8 @@ class DateTimePickerShortcutsSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
error_margin = timedelta(seconds=10)
|
||||
|
||||
# If we are neighbouring a DST, we add an hour of error margin.
|
||||
tz = pytz.timezone('America/Chicago')
|
||||
utc_now = datetime.now(pytz.utc)
|
||||
tz = zoneinfo.ZoneInfo('America/Chicago')
|
||||
utc_now = datetime.now(zoneinfo.ZoneInfo('UTC'))
|
||||
tz_yesterday = (utc_now - timedelta(days=1)).astimezone(tz).tzname()
|
||||
tz_tomorrow = (utc_now + timedelta(days=1)).astimezone(tz).tzname()
|
||||
if tz_yesterday != tz_tomorrow:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue