Well what I was thinking is that your settings.TIME_ZONE can be set to what
ever you want. If we get a datetime that is timezone aware we covert it to
what your settings say. If a datetime is not timezone aware we just save it
to the database. And when you pull the object out of the database the dates
will all be what your settings timezone is set to. I would need help with
out PostgreSQL side of things since I have never used it, and other DB
testing.

Also on a side note I think it would be helpful to have the ORM return all
datetime with the tzinfo set to whatever the settings are. That way when you
need to mess with the timezone you don't have to do something like this for
every datetime you need to adjust:

utc_date = obj.created_at.replace(tzinfo=pytz.UTC)



About backward compatibility:
I don't think introducing this will cause any problems since if you pass the
ORM a datetime that is naive it will just assume that it is the correct
timezone.

Thanks,
Vitaly Babiy


On Tue, Aug 17, 2010 at 7:09 AM, David De La Harpe Golden <
david.delaharpe.gol...@ichec.ie> wrote:

> On 17/08/10 04:24, Russell Keith-Magee wrote:
>
> > 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).
>
>
> Just noting existence of Brian Rosner's django-timezones as a datum,
> you're very probably already aware of its existence, just mentioning it.
>
> http://github.com/brosner/django-timezones
>
> Not saying it's perfect, just that it exists and helps us (with some
> bugfixing) deal with our time zone requirements.  But we use postgresql.
>
> We always use django settings.TIME_ZONE = 'UTC', settings.TIME_ZONE is
> what django will currently assume - or tell (postgresql "SET TIME ZONE")
> the database to use. We _do not_ use settings.TIME_ZONE to determine
> what final presentation timezone to use for presentation of our (non
> naive via django-timezones) app-internal datetimes to users.
>
> --
> 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<django-developers%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

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