Would you be comfortable recommending that package for anyone who needs the
autodetection? This seems to work:
from tzlocal import get_localzone
TIME_ZONE = get_localzone().zone
What would change compared to the behavior of TIME_ZONE=None is that Django
will set os.environ['TZ'] (except on Windows). I don't really understand
the use case where doing that may have been a problem .
On Wednesday, October 12, 2016 at 12:58:19 PM UTC-4, Aymeric Augustin wrote:
> > is there some other approach we could take?
> To obtain the pytz timezone for the local time, you’d need something like:
> It isn’t exactly straightforward… This approach seems sub-optimal.
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 post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.