diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-02-18 08:35:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 08:35:36 +0100 |
| commit | efb7f9ced2dcf71294353596a265e3fd67faffeb (patch) | |
| tree | b24b6127022fbe48c517d1acbe9e3c0c502391d9 /django/utils/timezone.py | |
| parent | 0d1dd6bba0c18b7feb6caa5cbd8df80fbac54afd (diff) | |
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
Diffstat (limited to 'django/utils/timezone.py')
| -rw-r--r-- | django/utils/timezone.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py index 102562b254..6d6cbf6d8f 100644 --- a/django/utils/timezone.py +++ b/django/utils/timezone.py @@ -5,7 +5,7 @@ Timezone-related classes and functions. import functools import zoneinfo from contextlib import ContextDecorator -from datetime import datetime, timedelta, timezone, tzinfo +from datetime import UTC, datetime, timedelta, timezone, tzinfo from asgiref.local import Local @@ -201,7 +201,7 @@ def now(): """ Return an aware or naive datetime.datetime, depending on settings.USE_TZ. """ - return datetime.now(tz=timezone.utc if settings.USE_TZ else None) + return datetime.now(tz=UTC if settings.USE_TZ else None) # By design, these four functions don't perform any checks on their arguments. |
