I suspect I'm not understanding something. Can someone explain the following? DTML Method ------------------------------------- <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 -steve ---- drees@the-bridge.net http://www.the-bridge.net/~drees "A problem well stated, is a problem half-solved." - C. Kettering
----- 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
strftime returns the date and time in GMT. I was also confused in the beginning. Now i'm just annoyed by this "feature" :-) Steve Drees wrote:
I suspect I'm not understanding something. Can someone explain the following?
DTML Method -------------------------------------
<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
participants (3)
-
Evan Simpson -
Soren Roug -
Steve Drees