Hi all, I have to to this: date - date = 20 days. (2000-5-5 - 2000-5-2 = 3 days) I checked Zope Quick Reference but couldn´t find a function which provide this. May someone has a python function and can give me this funktion. Thank you Jens ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
<dtml-var "_.DateTime('2000-5-5')-_.DateTime('2000-5-2')"> will do it (tested ;-) Chris jens ebaer wrote:
Hi all,
I have to to this: date - date = 20 days. (2000-5-5 - 2000-5-2 = 3 days)
I checked Zope Quick Reference but couldn´t find a function which provide this.
May someone has a python function and can give me this funktion.
Thank you
Jens ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
jens ebaer wrote:
Hi all,
I have to to this: date - date = 20 days. (2000-5-5 - 2000-5-2 = 3 days)
I checked Zope Quick Reference but couldn´t find a function which provide this.
<dtml-var "_.DateTime('2000-5-5') - _.DateTime('2000-5-2')"> Returns the float 3.0. -- Nick Garcia | ngarcia@codeit.com CodeIt Computing | http://codeit.com
jens ebaer wrote:
Hi all,
I have to to this: date - date = 20 days. (2000-5-5 - 2000-5-2 = 3 days)
I checked Zope Quick Reference but couldn´t find a function which provide this.
If you want to do today - somedateproperty, then do <dtml-if "_.int(ZopeTime() - somedateproperty) = 20"> otherwise, you can do <dtml-if "_.int(somedateproperty - someotherdateproperty) = 20"> HTH, -- ethan mindlace fremen mindlace@imeme.net zope -&- imap email -&- mailing list weave your web with the web at http://imeme.net
jens ebaer wrote:
Hi all,
I have to to this: date - date = 20 days. (2000-5-5 - 2000-5-2 = 3 days)
I checked Zope Quick Reference but couldn´t find a function which provide this.
May someone has a python function and can give me this funktion.
Where date2 and date1 are DateTime objects, and date2 is later than date1: <dtml-var "date2-date1"> gives you the number of days difference as a floating point number. <dtml-var "_.int(_.round(date2-date1))"> gives you the number of days as a rounded integer. (That is, half days get counted as a whole day). Make a string into a DateTime object using _.DateTime('some date string'). -- Steve Alexander Software Engineer Cat-Box limited
participants (5)
-
Chris Withers -
jens ebaer -
mindlace -
Nick Garcia -
Steve Alexander