[Zope] formatting dates

D. Rick Anderson ruger@comnett.net
Tue, 18 Mar 2003 10:30:35 -0800


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