mirror of
https://github.com/django/django.git
synced 2025-08-23 18:29:12 +00:00
[3.2.x] Refs #32366 -- Avoided use of datetime.utcnow() in the documentation.
Backport of 69ffb1acf38bd34f76707468bb592eb4b164e2da from main
This commit is contained in:
parent
fab710d3ff
commit
cd84f7acfa
@ -535,10 +535,9 @@ Troubleshooting
|
|||||||
|
|
||||||
Let's reproduce this error by comparing a naive and an aware datetime::
|
Let's reproduce this error by comparing a naive and an aware datetime::
|
||||||
|
|
||||||
>>> import datetime
|
|
||||||
>>> from django.utils import timezone
|
>>> from django.utils import timezone
|
||||||
>>> naive = datetime.datetime.utcnow()
|
|
||||||
>>> aware = timezone.now()
|
>>> aware = timezone.now()
|
||||||
|
>>> naive = timezone.make_naive(aware)
|
||||||
>>> naive == aware
|
>>> naive == aware
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user