Working on ticket #29984, I noticed that the following raises:

from datetime import datetime
import pytz
from django.utils.timezone import make_aware

euberlin = pytz.timezone('Europe/Berlin')s a
dt1 = datetime(2018, 10, 24, tzinfo=euberlin)
dt2 = make_aware(datetime(2018, 10, 24))
assert dt1 == dt2


It is certainly necessary to have make_aware, because datetime may come in 
without a timezone.  I'm familiar with the various solutions - user picks a 
timezone in their profile, and/or JavaScript detects the timezone in the 
browser and provides that to the backend at some point.  I'm even urging a 
coworker to fix his public Django webapp to implement the latter solution.

However, it is disturbing that the datetimes are not equal.   Can someone 
explain why not?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/46a382ef-2b19-4b81-87b8-babb1f93b9cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to