Hi,

today I had *very* strange effects with the following code:
        <dtml-let bla="_.DateTime('2000/08/08')">
          <dtml-var bla><br>
          <dtml-var expr="bla.parts()"><br>
          <dtml-var expr="bla.strftime('%Y/%m/%d')"><br>
        </dtml-let>

on my system it gave me:
        2000/08/08
        (2000, 8, 8, 0, 0, 0, 'GMT+2')
        2000/08/07

Well - this was not quite what I expected. :)

I tracked the problem down to the timezone: When no time is given, the
time is initialized with 00:00. So after applying gmtime in the strftime
function (DateTime.py line 1379) it got shifted out and - hoppla - we
have gone one day back in time. :)

When I apply the attached patch, the output gets correct. But there are
more usages of gmtime in the file and I don't know right now if that is
correct. Perhaps someone who has a deeper insight in date'n'time math
than me should have a look at it.

Greets, Karsten
-- 
,-,  Student of Computer Science at Chemnitz University of Technology  ,-,
| |    EMail:  [EMAIL PROTECTED]          WWW:  http://www.kapet.de/    | |
'-'  Home: [EMAIL PROTECTED]   V72 / 230    Phone: +49-177-82 35 136  '-'
--- DateTime.py-vanilla Tue Aug  8 00:47:17 2000
+++ DateTime.py Tue Aug  8 00:47:31 2000
@@ -1376,7 +1376,7 @@
         return millis
 
     def strftime(self, format):
-        return strftime(format, gmtime(self.timeTime()))
+        return strftime(format, localtime(self.timeTime()))
 
     # General formats from previous DateTime
     def Date(self):

Reply via email to