[Zope] Date/Time confusion.
Evan Simpson
evan@4-am.com
Tue, 18 Apr 2000 20:54:44 -0400
----- Original Message -----
From: Steve Drees <drees@the-bridge.net>
> <dtml-var "ZopeTime().toZone('CST')">
> <dtml-var "ZopeTime().toZone('CST').strftime('%m/%d/%Y - %H:%M')">
>
> Output
> --------------------------------------
> 2000/04/18 14:31:41.4125 Us/Central
> 04/18/2000 - 19:31
The problem is that a DateTime object converts its value to GMT before
passing it to time.strftime. Thus, all format string output including
<dtml-var ZopeTime fmt="%m/%d/%Y"> are based on GMT. I will check why this
is so, but in the meantime you can replace strftime in DateTime.DateTime
with:
def strftime(self, format):
return strftime(format, (self._year, self._month, self._day,
self._hour, self._minute, self._nearsec, 0, 0, 0))
Cheers,
Evan @ digicool & 4-am