Wiadomość napisana w dniu 2009-08-11, o godz. 08:46, przez Brian May:

> On Tue, Aug 11, 2009 at 12:08:21AM -0400, Vitaly Babiy wrote:
>> Hey guys, I am working on an application that needs to be timezone  
>> aware. Is
>> there support for this with in django I can't seem to find anything  
>> except
>> for a few third party packages. i am trying to find something that  
>> is in
>> django core.
>
> I ended up doing it myself.
>
> I found a 3rd party add-on for Django, which initially looked very  
> good, until
> I realized it didn't store date/times in UTC, and for my application  
> I need to
> be able to sort by date and time.  This requires storing the date/ 
> times in UTC.
> So I have two fields, one for the datetime in UTC, and another one  
> for the
> timezone. I have a template filter (or tag - my memory is fuzzy) to  
> convert the
> UTC time to the specified timezone for displaying.


If your app stores time in UTC (which is good habit btw), you can use  
Babel (http://babel.edgewall.org/) to display time information with  
any timezone supported by pytz.

-- 
Artificial intelligence stands no chance against natural stupidity

Jarek Zgoda, R&D, Redefine
jarek.zg...@redefine.pl


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