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/templatetags | |
| 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/templatetags')
| -rw-r--r-- | django/templatetags/tz.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/django/templatetags/tz.py b/django/templatetags/tz.py index f2cee2d3fe..5efd3c7fcf 100644 --- a/django/templatetags/tz.py +++ b/django/templatetags/tz.py @@ -1,7 +1,5 @@ import zoneinfo -from datetime import datetime -from datetime import timezone as datetime_timezone -from datetime import tzinfo +from datetime import datetime, tzinfo from django.template import Library, Node, TemplateSyntaxError from django.utils import timezone @@ -33,7 +31,7 @@ def utc(value): """ Convert a datetime to UTC. """ - return do_timezone(value, datetime_timezone.utc) + return do_timezone(value, datetime.UTC) @register.filter("timezone") |
