[Zope] Format date fields

Andrew Milton akm at theinternet.com.au
Thu Jan 13 19:00:00 EST 2005


+-------[ Zorze ]----------------------
| Hi,
| I'am new to Zope so please excuse me about some stupid questions.
| 
| How can I format a date field from in a DTML from ZSQL Method e.i.:
| 
| It shows 2005-01-12 22:49:33:00
| 
| but I want to show just 2005-01-12


Try these;

<dtml-var "theDate.strftime('%Y-%m-%d')">

or

<dtml-var "theDate.strftime('%F')"> (same as above, just shorter).

| or  change de order of the date 
| :01-12-2005.

<dtml-var "theDate.strftime('%d-%m-%Y')">

-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list