using dtml-var with fmt discount 1 day
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Displaying a value type date from MSSQLSERVER 2000
<dtml-in somezsql>
Date 1 is:<dtml-var field_date fmt="%d/%m/%Y">
Date 2 is:<dtml-var field_date >
</dtml-in>
Show
Date is: 30/11/2008
Date is: 1/12/2008
Using print in DT_Var.py I found what the error is around here, line 268
# We duplicate the code here to avoid exception handler
# which tends to screw up stack or leak
if hasattr(val, fmt):
...
line 292 --> print "4. val=%s" % val
From command line show the prints
3. fmt=%Y/%m/%d. val=2008/12/01
31. fmt=%Y/%m/%d. val=2008/12/01
311. fmt=%Y/%m/%d. val=2008/11/30
4. val=2008/11/30
4. val=2008/12/01 <-val without fmt
The error is the "_get" function, but my skins no enough for a patch
I use
Zope Version
(Zope 2.11.1-final, python 2.4.4, win32)
Python Version
2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
System Platform
win32
SOFTWARE_HOME
C:\Zope\
ZOPE_HOME
C:\Zope\2.11.1\Zope
INSTANCE_HOME
C:\Zope\
CLIENT_HOME
C:\Zope\
Network Services
ZServer.
Process Id
416 (300)
Running For
20 min 34 sec
I hope what can help you this information
Date: 1999/10/03
Final result: 02/10/1999
Using "print" over various parts show me this, in order how appear:
1.- In function DateTime._julianday (around line 198, print before "if m >12L": print y,m,d show Y=1999 - M=10 - D=03
2.- In function DateTime._julianday (print before return): the final value of "b" is "-13"
3.- In function DateTime. _calDependentSe cond2 (around line 155, print before return x): the value "x" is "3116361600" strftime( print before return): show 02-10-1999
4.- In function DateTime.strftime (print before tzdiff minus): "ltz" is "GTM-6". This is correct.
5.- In function DateTime._tzoffset (executed by tzdiff = _tzoffset(ltz, self._t) - _tzoffset(self._tz, self._t)): show
tzoffset tz=GMT-6, t=1033603200.0
tzoffset= -21600
tzoffset tz=UTC, t=1033603200.0
tzoffset= 0
tzoffset tz=UTC, t=1033581600.0
tzoffset= 0
julian Y=2002 - M=10 - D=2
b= -13
(why enter again to julianday?)
6.- In function DateTime.
help please
some tip please