On Tue, Aug 17, 2010 at 12:13 AM, Vitaly Babiy <vbabi...@gmail.com> wrote:
> Hey,
> I been doing a lot with timezone aware dates and I noticed that the mysql
> store will not allow you to store a datetime aware datetime. I was wondering
> if there is a reason why not convert theses dates to whatever is in the
> settings using astimezone. And then save that date.

A good reason? No. :-)

The practical reason is that the current implementation is old and
naive. Django's date/datetime/time fields were added very early in the
life of Django, so the current implementation is essentially the
simplest implementation that could possibly work at the time -- which
means no fancy handling when it comes to timezones.

Adding timezone sensitivity to Django's time/datetime fields is
something that has been on the project to-do list for almost as long
as I've been associated with the project (coming up on 5 years). If
you're interested in tackling this problem, here's a couple of things
to keep in mind:

 * Backwards compatibility. Suddenly introducing a 'convert to local
timezone' behavior (or similar) will break any existing install.
 * The interaction between application timezone and database server timezone.
 * MySQL. Postgres supports timezones in date fields. MySQL doesn't.
We need to have a solid answer for how this feature will work on
databases that don't support timezone handling.

Also worth noting: by strange coincidence, you're the second person in
24 hours that has asked this question; FunkyBob was asking about
timezone support on IRC. This is something I'd love to see addressed;
if there are a couple of motivated people interested in the problem,
it may help to team up to solve it.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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