I have a product where I convert some external datetimes to zope DateTime() objects. I save them as UTC as zopes DateTime does by default. But when these are rendered, the time is offset by two hours. A few weeks ago, it wasn't that bad. It was only one hour, but then summertime came along ;-) So it seems that there is some magic going on where Zope tries to take locale and summertime into account. Is this configurable somewhere. In Zope, Python, as a command switch or in a config file? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
Max M wrote:
I have a product where I convert some external datetimes to zope DateTime() objects. I save them as UTC as zopes DateTime does by default.
But when these are rendered, the time is offset by two hours.
Ok. I was unclear here. I convert from datetime objects (python) to DateTime (zope) objects. The datetime objects are in UTC format. So are the DateTime objects. On an external system I enter a time of 11:00. The external system then saves the value as 9:00 UTC, which is correct. Taking summertime and time zone offset into account. When I convert to DateTime objects, they are saved as "9:00 Universal". So that is correct too. The DateTime objects are then displayed in Zope/Plone in UTC time. I would expect Zope to represent them in the systems locale 'danish' and display them as 11:00 I have set the "locale danish" directive in my zope.conf, but that doens't change anything. Does anybody have an idea as to what to try out next? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
Max M wrote:
When I convert to DateTime objects, they are saved as "9:00 Universal". So that is correct too.
Ok. Turned out that I have misunderstood zopes DateTime(). It saves in UTC, but it still needs a timezone. So converting datetime objects to the local timezone and then converting to DateTime objects also as local timezone did the trick. hmmm -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
On Thu, Apr 07, 2005 at 02:44:38PM +0200, Max M wrote:
Max M wrote:
When I convert to DateTime objects, they are saved as "9:00 Universal". So that is correct too.
Ok. Turned out that I have misunderstood zopes DateTime().
It saves in UTC, but it still needs a timezone.
So converting datetime objects to the local timezone and then converting to DateTime objects also as local timezone did the trick.
hmmm
Maybe this is relevant: http://www.zope.org/Collectors/CMF/325 ... crap, I never merged the fix. I should really make it a habit to read the CMF issues nag mail :-0 -- Paul Winkler http://www.slinkp.com
On Thu, Apr 07, 2005 at 11:22:39AM -0400, Paul Winkler wrote:
Maybe this is relevant: http://www.zope.org/Collectors/CMF/325
... crap, I never merged the fix.
OK, now this is merged to the trunk and CMF-1_5-branch. -- Paul Winkler http://www.slinkp.com
participants (2)
-
Max M -
Paul Winkler