diff --git a/django/forms/utils.py b/django/forms/utils.py index 9bdaffa44b..73fca86325 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -174,6 +174,5 @@ def to_current_timezone(value): to naive datetimes in the current time zone for display. """ if settings.USE_TZ and value is not None and timezone.is_aware(value): - current_timezone = timezone.get_current_timezone() - return timezone.make_naive(value, current_timezone) + return timezone.make_naive(value) return value diff --git a/django/views/generic/dates.py b/django/views/generic/dates.py index 1673a7a263..3da05cf8e5 100644 --- a/django/views/generic/dates.py +++ b/django/views/generic/dates.py @@ -267,7 +267,7 @@ class DateMixin: if self.uses_datetime_field: value = datetime.datetime.combine(value, datetime.time.min) if settings.USE_TZ: - value = timezone.make_aware(value, timezone.get_current_timezone()) + value = timezone.make_aware(value) return value def _make_single_date_lookup(self, date): diff --git a/tests/postgres_tests/test_ranges.py b/tests/postgres_tests/test_ranges.py index f368736384..923e43b0ea 100644 --- a/tests/postgres_tests/test_ranges.py +++ b/tests/postgres_tests/test_ranges.py @@ -100,7 +100,7 @@ class TestRangeContainsLookup(PostgreSQLTestCase): datetime.datetime(year=2016, month=2, day=2), ] cls.aware_timestamps = [ - timezone.make_aware(timestamp, timezone.get_current_timezone()) + timezone.make_aware(timestamp) for timestamp in cls.timestamps ] cls.dates = [