On Feb 21, 12:02 pm, Aymeric Augustin
<aymeric.augus...@polytechnique.org> wrote:
> os.environ['TZ'] controls the ouptut of functions such as 
> datetime.fromtimestamp().
>
> If you're running with USE_TZ = True, you should use the UTC versions, e.g. 
> datetime.utcfromtimestamp() in your own code. However, you may be relying on 
> third party code that hasn't been adapted for time zone support yet.
>
> For such code to work properly, it's better to keep settings.TIME_ZONE == 
> os.environ['TZ'] == your "main" time zone == what the user sees by default.

I guess this is true. Maybe this is about different viewpoints about
having true multi-timezone applications, where having UTC as default
would make sense. More to the point: in true multi-timezone setting
any default time zone for output will be incorrect, so UTC makes as
much sense as any. Then again, you can just configure it to that.

I have been thinking this from the viewpoint of the developer. For the
developer seeing non-aware datetimes in UTC would probably make more
sense than seeing them in local timezone. I guess logging is going to
be using the os.environ['TZ'] time zone for example. However, this is
the developer viewpoint. I agree getting correct displayed value for
the user is more important.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to