[google-appengine] Re: handling timezones - problem using sample code

2009-01-24 Thread Alexander Kojevnikov
Replace 'datetime_module' with 'datetime' everywhere and add this line on top of your Python file: import datetime On Jan 25, 12:18 pm, jones34 wrote: > I'm trying to use timezones in my app. I understand the GAE decided > that this isn't something they really want to support well.  I'm > tryi

[google-appengine] Re: handling timezones - problem using sample code

2009-01-25 Thread jones34
Thanks, but it still doesn't work. How do you convert the gae timestamp? It doesn't understand astimezone. On Jan 25, 2:42 am, Alexander Kojevnikov wrote: > Replace 'datetime_module' with 'datetime' everywhere and add this line > on top of your Python file: > > import datetime > > On Jan 25, 1

[google-appengine] Re: handling timezones - problem using sample code

2009-01-25 Thread Alexander Kojevnikov
> Thanks,  but it still doesn't work. How do you convert the gae > timestamp?  It doesn't understand astimezone. > 'astimezone' is a method of datetime.datetime class. Which type is your 'utc_time' variable? Could you post the code where it's initialised? --~--~-~--~~~-

[google-appengine] Re: handling timezones - problem using sample code

2009-01-25 Thread jones34
I'm trying simply to display a GAE timestamp in local (eastern time). I tried this, but it failed two different ways: note.create_date_time.replace(tzinfo=pytz.utc).astimezone (Eastern_tzinfo()). the display is attempted by invoking note.create_date _time in a template file in m

[google-appengine] Re: handling timezones - problem using sample code

2009-01-26 Thread ryan
it's not a direct answer to your question, but http://timezones.appspot.com/ has some relevant info and code snippets. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group,

[google-appengine] Re: handling timezones - problem using sample code

2009-01-26 Thread jones34
I appreciate the pointer, but I've read the documentation and it, frankly, sucks. It's really dismaying that a company with the resources of Google is doing such a piss-poor job at delivering this toolkit. First of all, this simple thing should be trivial to solve - one line of code. The point

[google-appengine] Re: handling timezones - problem using sample code

2009-01-26 Thread Stephen Judd
I'm able to import pytz fine in GAE...depending on what you need: from pytz import timezone from pytz import common_timezones import pytz then try: note.create_date_time.replace(tzinfo=pytz.utc).astimezone(timezone('US/Eastern')) Steve On Sun, Jan 25, 2009 at 9:49 PM, jones34 wrote: > > I'm t

[google-appengine] Re: handling timezones - problem using sample code

2009-01-26 Thread ryan
On Jan 25, 6:49 pm, jones34 wrote: > > If I deploy the code to GAE, I get a failure trying to import pytz. are you including the pytz source with your app? pytz isn't provided automatically in production. (it's not provided in the sdk either, but i'm guessing you have it installed on the machine