[Zope] DateTime inside an in loop

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Sun, 24 Jun 2001 12:38:07 +0200


>>  > <dtml-in expr="get_records()">
>>  > <dtml-var ID>
>>  > <dtml-var expr="_.DateTime(adate).strftime('%d-%b')">
>>  > </dtml-in>
>>  >
>>  > I have tried all sorts of syntax to get a result, with no result.
>>  >
>>  > Question 1: Can someone tell me the correct syntax please?
>> Your syntax is good.
>>
>> But, if your field "adate" is defined as a date in your
>> table, it probably is already a "DateTime" object.
>> Try to remove the "_.DateTime(...)", just use "adate".

> Yes it is a date string, but I need to format it to be easy to read. I
> assumed I could do that with DateTime.

I guess Dieter meant:
<dtml-var "adate.strftime('%d-%b')">

cheers,
oliver