[Zope3-Users] Wrong time displayed

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jun 19 22:22:59 EDT 2007


On Sunday 11 March 2007 14:52, Florian Lindner wrote:
> I use this expression to display the time
>
> formatter = self.request.locale.dates.getFormatter('dateTime', 'medium')
> return formatter.format(date)
>
> The server time is set on UTC, no locale is set on the server. The clients
> local is de_DE and localtime is set to CET.
> Despite that a wrong time is computed, it's always one hour delay (instead
> of 19:00 it's 18:00).
>
> What's wrong?

The timezone cannot be reliably identified by the locale. It is not the 
resposibility of the formatter to convert the datetime to the correct 
timezone. This is the responsibility of your application code. By default 
datetimes are stored in UTC.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list