UnknownTimeZoneError

B

Brian

I'm running App Engine with Django. I'm having troubles executing
timezone conversion via pytz. I have looked at the Google example
implementation. The following works in IDLE:

2009-03-22 11:02:41.578000
2009-03-22 06:02:41.578000-05:00

I have tried to run the following in my app (modules imported, too):

def tz(request):
timestamp = datetime.datetime.utcnow()
translated = timestamp.replace(tzinfo=pytz.utc).astimezone
(timezone
('US/Central'))
return respond(request, user, 'tz',
{'translated':translated,'timestamp':timestamp})

When I pull up the page, I get the following error:
UnknownTimeZoneError at /tz
'US/Central'
Request Method: GET
Request URL: http://localhost:8080/tz
Exception Type: UnknownTimeZoneError
Exception Value: 'US/Central'

Does this not work in App Engine for some reason?
 
A

Aahz

[posted & e-mailed]

I'm running App Engine with Django. I'm having troubles executing
timezone conversion via pytz.

What version of Python are you using? IIRC, GAE uses Python 2.3. Do
other timezones work? I suspect you might get more responses from a GAE
forum.
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"...string iteration isn't about treating strings as sequences of strings,
it's about treating strings as sequences of characters. The fact that
characters are also strings is the reason we have problems, but characters
are strings for other good reasons." --Aahz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,508
Members
48,193
Latest member
DannyRober

Latest Threads

Top