[Zope] Dates

aZaZel azazel@chiaroscuro.com
Mon, 12 Feb 2001 17:59:25 +0100


Alejandro Pancani wrote:

> I'm wondering if anybody know how  to calculate the days betwen two dates or
> any way to loop betwen two dates


You can use a syntax like this:


<dtml-var "_.str(_.int(date1.earliestTime() - date2.earliestTime()))">
This isn't an absolute value ..you can put an _.abs (blabla) around the 
_.int to obtain an absolute value and check the dates with

<dtml-if "date1.greaterThan (date2)">
....

to loop between two dates

<dtml-let days="_.abs(_.int(date1.earliestTime() - date2.earliestTime()))">


<dtml-in "_.range(days)">


do your task here


</dtml-in>



I hope this helps


azazel

.