[Zope] Re: DateTime strftime problem

Jürgen Herrmann Juergen.Herrmann at XLhost.de
Wed Nov 9 17:18:53 EST 2005


[ Dieter Maurer wrote:]
> Jürgen Herrmann wrote at 2005-11-9 13:38 +0100:
>>zope 2.7.8's DateTime::strftime() looks like this:
>>
>>def strftime(self, format):
>>  # Format the date/time using the *local timezone representation*.
>>  return strftime(format, safelocaltime(self.timeTime()))
>>
>>it seems that my assumption about strftime's behaviour was incorrect.
>>why do we have time zones at all, if strftime always uses the machine's
>>local time zone?
>
> Zope's "strftime" is simply broken.
>
> Forget about it. It should be simple to implement your own
> version in Python (and I think someone already did).
> Once you did, donate the implementation to Zope....
>
> --
> Dieter
>
ok, i guess i can fix strftime. will take some time to change the tests
and add some comments. i'd like to report with the patch here first and
get some comments, to avoid "don't do"s...

already came across another python bug in strptime, that reports a format
error, if %Z (timezone *omg*) is in the format string and you give
it value different to UTC...

this IS getting interesting :)

thanks for all your help...

regards, juergen
_______________________________________________________________________

>> XLhost.de - eXperts in Linux hosting <<

Jürgen Herrmann
Bruderwöhrdstraße 15b, DE-93051 Regensburg

Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027
WEB:  http://www.XLhost.de


More information about the Zope mailing list