[Zope] Need to use a 'date' data type in sqltest

Marcel Preda marcel@punto.it
Mon, 19 Jun 2000 20:05:52 +0200


Subject: [Zope] Need to use a 'date' data type in sqltest


> I need to include a test of a date in a DTML variable referenced in a sqltest
tag in ZSQL.  From reading documentation and testing, it does not appear that
the 'date' data type is supported.
>
> Can anyone confirm/infirm this and suggest a solution/workaround?

I suppose that Zope supports every Python's type.

Maybe this will help you:

<dtml-let date_str="'2000-01-31'">
<dtml-try>
<dtml-call "REQUEST.set('DateObj',_.DateTime(date_str))">
<dtml-var DateObj>
<dtml-except>
<dtml-var "'%s is not a valid date' %(date_str)">
</dtml-try>
</dtml-let>

PM