[Zope] date comparison

Kapil Thangavelu kthangavelu@earthlink.net
Wed, 11 Oct 2000 11:53:10 -0700


michael angelo ruberto wrote:
> 
> i want to create an index page that displays whether or not a page has been
> updated in the past 7 days or the past 20 days. however, i can't figure out
> how to get the bobobase_modification_date to compare with ZopeTime. can
> someone give me a clue before i rush blindly down Zope's undocumented dark
> alleys.
> 
> mike

untested

<ul>
<dtml-in "objectValues['DTMLDocument']">
<dtml-if "ZopeTime()-7 < bobo_base_modifcation_time">
	<li><b>New</b><dtml-var absolute_url></li>
<dtml-elif "ZopeTime()-20 < bobo_base_modifcation_time">
	<li><b>Somewhat New</b><dtml-var absolute_url></li>
<dtml-else>
	<li><b>Old</b><dtml-var absolute_url></li>
</dtml-if>
</dtml-in>
</ul>

kapil