2012/6/1 Artem Andreev <andreev.ar...@gmail.com>:
> May be it will be more practical/comfortable for django users if
> timezone.now() will return localetime?
> What do you think about this?

Hi Artem,

In fact this problem isn't limited to timezone.now(): any datetime
returned by the database will be expressed with tzinfo = UTC. All
datetimes have to be converted when they're exchanged with another
system that expects something other than UTC.

In your situation, you are supposed to adapt your serialization
function to convert datetimes according to your needs. Some APIs may
expect UTC, others may expect naive local time, others may expect
local time with a stated offset, etc. So there's no choice (UTC,
default TZ, current TZ) will satisfy everyone.

That's why I chose to stick with the sanest and least controversial
choice: UTC. Arithmetic works without surprises and performance isn't
hindered by conversions.

Best regards,

-- 
Aymeric.

-- 
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