#27921: Documentation of make_aware() with is_dst is misleading
-------------------------------------+-------------------------------------
Reporter: Kevin | Owner: nobody
Christopher Henry |
Type: Bug | Status: new
Component: | Version: master
Documentation |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
A recent [http://stackoverflow.com/questions/42399438/django-make-aware-
usage/42407744 StackOverflow question] prompted me to look into what
`make_aware()` does with non-existent datetimes.
The
[https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.timezone.make_aware
documentation] says:
> Setting `is_dst` to `True` or `False` will avoid the exception by moving
the hour backwards or forwards by 1 respectively. For example,
`is_dst=True` would change a nonexistent time of 2:30 to 1:30 and
`is_dst=False` would change the time to 3:30.
It appears that pytz in fact keeps the wall-clock time of 2:30 the same,
and instead shifts the timezone to make the datetime valid.
I'm not sure if it's better to describe what pytz does more precisely, or
just to leave out that degree of detail (since pytz's documentation is
itself not very precise on this point).
--
Ticket URL: <https://code.djangoproject.com/ticket/27921>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.26042e9a2ecd0d123909424a2126c46d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.