[Zope] R: [Zope] Newbie: Date checking?
Marcel Preda
marcel@punto.it
Thu, 6 Jul 2000 16:33:59 +0200
----- Original Message -----
From: Andy Gates <Andy.Gates@bristol.ac.uk>
To: <zope@zope.org>
Sent: Thursday, July 06, 2000 4:06 PM
Subject: [Zope] Newbie: Date checking?
> A quicky for you Zopistas: I have some dates in a database, which
> govern when a story becomes live and when it expires. I need to do a
> test along the lines of:
>
> dtml-in stories
> if (startdate is past) and (expirydate is future)
> show the story
> /if
> /in
>
> I have seen the fmt parameters isPast and isFuture and this gives me a
> true/false response: <dtml-var startdate fmt=isPast> but how do I use
> that in an if test?
>>>>>>>>>> I keep (as usual) getting syntax errors.
:)
<dtml-if "_.DateTime(startdate).isPast() and _.DateTime(expirydate).isFuture()">
...
...
</dtml-if>
PM