Skip to content

Commit

Permalink
Use datetime.timezone.utc as Django 5.0 removed the alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
perry committed Dec 5, 2023
1 parent 7c7fb63 commit f9bfcd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_rq/templatetags/django_rq.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import datetime

from django import template
from django.utils import timezone
from django.utils.html import escape
Expand All @@ -10,7 +12,7 @@
def to_localtime(time):
"""Converts naive datetime to localtime based on settings"""

utc_time = time.replace(tzinfo=timezone.utc)
utc_time = time.replace(tzinfo=datetime.timezone.utc)
to_zone = timezone.get_default_timezone()
return utc_time.astimezone(to_zone)

Expand Down

0 comments on commit f9bfcd1

Please sign in to comment.