[Zope] formatting dates

Chris Beaven chris@d-designz.co.nz
Wed, 19 Mar 2003 12:57:20 +1200


Or to concatenate it to one command:
<dtml-var invc_date fmt="%m/%d/%y" null="">

I'll assume you meant 'fmt' instead of 'strftime' ;)

D. Rick Anderson wrote:

>try:
>
><dtml-if invc_date>
>  <dtml-var invc_date strftime="%m/%d/%y">
></dtml-if>
>
>If you get back 'None' on an empty field with that it will barf, hence 
>the 'if's.
>
>Rick
>
>Michael Guerrero wrote:
>
>  
>
>>Hello,
>> 
>>I am having problems formatting a date that I select from my oracle 
>>database.  The field is an oracle DATE field.  I want to display it as
>>    
>>
>
>  
>
>>MM/DD/YY.  I have tried:
>> 
>><dtml-in sql_get_invc_date>
>>  <dtml-var invc_date fmt="%m/%d/%y">
>></dtml-in>
>> 
>>The formatting works fine when I use ZopeTime but not when I use a 
>>dtml-var.
>> 
>>I appreciate your help.
>> 
>>Thanks.
>> 
>>Mike Guerrero
>>    
>>
>
>
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>  
>