-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
django.utils.timezone.utc was removed in Django 5.0 #4231
django.utils.timezone.utc was removed in Django 5.0 #4231
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4231 +/- ##
=======================================
Coverage 87.84% 87.84%
=======================================
Files 291 291
Lines 16145 16145
=======================================
Hits 14182 14182
Misses 1963 1963 |
@@ -1,4 +1,4 @@ | |||
from datetime import timedelta | |||
from datetime import timedelta, timezone as datetime_timezone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do
from datetime.timezone import utc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work. datetime
is wired / weird that way.
% python3.12
Python 3.12.1 (main, Dec 7 2023, 20:45:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime.timezone import utc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'datetime.timezone'; 'datetime' is not a package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay whatever this is in tests anyway so it does not really matter.
d406043
to
10a4d29
Compare
548389c
to
b6e6bd3
Compare
@@ -1,4 +1,4 @@ | |||
from datetime import timedelta | |||
from datetime import timedelta, timezone as datetime_timezone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay whatever this is in tests anyway so it does not really matter.
https://docs.djangoproject.com/en/stable/releases/5.0/#features-removed-in-5-0
https://docs.djangoproject.com/en/stable/releases/4.1/#id2