On Sunday 28 August 2005 21:10, Alen Stanisic wrote: > what's the best way to obtain timezone from request object. I tried > > tz = pytz.timezone(ITZInfo(self.request)) > > but the adaptation failed.
Getting a single time zone from the request is not sensible. Requests know only about the locale. But the locale can be applicable in multiple timezones. However, the locale usually knows about the timezones that are part of the locale. The object ``request.locale.dates.timezones`` is a mapping from timezone names (in the ICU format) to ``zope.i18n.interfaces.locales.ITimeZone`` objects. Unfortunately the version of the ICU data we are using does not have very good timezone support. At some point we need to switch to a newer version, which is much better with timezones as far as I remember. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training _______________________________________________ Zope3-users mailing list [email protected] http://mail.zope.org/mailman/listinfo/zope3-users
