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 [0].

[0] https://code.djangoproject.com/ticket/1480

On Wednesday, October 12, 2016 at 12:58:19 PM UTC-4, Aymeric Augustin wrote:
> > On 12 Oct 2016, at 18:22, Tim Graham <timog...@gmail.com <javascript:>> 
> wrote: 
> > 
> > is there some other approach we could take? 
> To obtain the pytz timezone for the local time, you’d need something like: 
> https://github.com/regebro/tzlocal 
> It isn’t exactly straightforward… This approach seems sub-optimal. 
> -- 
> Aymeric. 

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to