RE: [Zope] date-time manipulation
Hi, Your code is syntactically correct, but the ZopeTime() function has sub-second precision. The result of subtracting one date object from another is a floating-point number of days. Take the integer portion thus: <dtml-if "_.int(ZopeTime() - created) == 14"> <p>Time's up! </dtml-if> and you've got the number of full days that have elapsed. There's a wealth of information on DateTime objects in lib/python/DateTime/DateTime.html hth, -- Marcus
-----Original Message----- From: mindlace [mailto:mindlace@imeme.net] Sent: 04 April 2000 03:09 To: zope@zope.org Subject: [Zope] date-time manipulation
Zopistas,
I have a date-time property called "created" in a dtml document. What I need to do is something like this:
<dtml-if "(ZopeTime() - created) == 14days"> <p>Time's up! </dtml-if>
How do I do this?
Thanks,
Ethan Fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
_______________________________________________ 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 )
participants (1)
-
Marcus Collins