David Fraser
davidf at sjsoft.com
Fri Sep 5 09:39:24 EST 2003
Dustin Mitchell wrote: >On Thu, Sep 04, 2003 at 04:12:39PM -0600, Guy Davis wrote: > > >>We currently use time.strftime() in our CGI code after setting the TZ >>environment variable to the user's timezone. Since I'm trying to move >>us away from the mod_python.cgi_handler to our own custom handler, in >>order to allow concurrent request handling, I was wondering how to get >>around the problem of having to update the TZ env var. >> >> > >If you can look up the time zone offset, you can adjust the timezones >by simply adding the required number of seconds. I know this isn't a >very good solution, but it's what I use for the small stuff I do. > >I would be very interested in how you determine the user's locale? Is >there any trick to interpreting request headers? Or is it a user >prefererence for your site? > > This is not for the time zone, but we have enhanced the gettext module to be able to support multiple locales, and to localize strings per-session. The user selects a language, the session object passes that to the localize function David
|