At this stage, we just have some small applications using SQLite. I've
noticed that I am always getting UTC despie what I set with time_zone. By
last night I'd accepted the idea of using UTC internally and started looking
into pytz to faciliate interface conversion, so I think I'm on the same
track your suggesting. Still confused by the difference between view and
admin. Thanks for your feedback.

Brian


On Wed, Nov 11, 2009 at 12:22 PM, David De La Harpe Golden <
david.delaharpe.gol...@ichec.ie> wrote:

>
> BEC wrote:
>
> > Any idea on what is going on here? I'm particularly perplexed as to
> > why the admin page and my view are giving different times.
> >
>
> That does sound weird.
>
> What database are you using?
>
> Not an immediate help, but the sane way to handle timezones in django in
> my experience:
>
> (0) don't use windows on the server, if you are, set the system clock to
> utc and live with it.
> (1) preferably be using postgresql (good timezone handling)
> (2) set django settings TIME_ZONE = 'UTC' and work in utc internally.
> django will [try to, bearing in mind Graham's post] set TZ - and will
> also tell postgresql to expect and return times in utc over the wire
> (explicitly executes a "SET TIME ZONE" command in the connection).
> django models.DateTimeFields become "timestamp with time zone"
> postgresql fields, so your database now uses UTC timestamps that say
> they are UTC and everything just works.  Only now everything's in UTC...
> so...
>
> (3) use django-timezones (django helpers around pytz) to localize
> user-facing time and accept local time inputs
> http://github.com/brosner/django-timezones/
>
> Even though my apps only really operate in one timezone, it's a $%^£ing
> DST timezone (as is America/New_York), so the above is a real win.
>
> Of course, you may be stuck dealing with a legacy db with non-utc
> time.
>
>
>
>
>
>
>
>
>
>
>
> >
>

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

Reply via email to