[Zope] formatting dates

Ashley Lloyd ashleylloyd@hotmail.com
Tue, 18 Mar 2003 18:40:49 +0000

I'm only a newbie, so someone please correct me if I'm wrong here.

I had the same problem formatting dates retrieved from an Interbase 
database, and ended up writing a python script (which I don't have to hand, 
sorry), which took in the retrieved date, convert it to a string, split the 
string into year, month, day, and then returned a string version of the date 
in the format I wanted.
Something like:

# Can't remember if the above was necessary, but if in doubt...

return dateString

You then, instead of <dtml-var invc_date fmt="%m/%d/%y">
place <dtml-var "convertDate(invc_date)">

(This can be done better than this, but I am only a newbie, and it is off 
the top of my head, and all of my notes are in work!).


Surf together with new Shared Browsing