I don't have a direct answer to your question; but I thought I'd mention (in case you hadn't are ready seen them) the date-handling features built into DTML that make this kind of transformation easy. Check out Appendix A of http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.html -- Loren ----- Original Message ----- From: Graham Chiu <anon_emouse@hotmail.com> To: <zope@zope.org> Sent: March 04, 2000 06:57 PM Subject: [Zope] formatting a date string
I'm trying to convert a string from
2000/12/31 ( which is the format a date string is returned by a sql query )
to
31-DEC-2000
which is the format I need to enter date values into the database.
I figured I need to index into 'JANFEBMARAPR.... '
Now m_date is '2000/12/31', so I need to convert the 12 to an integer.
but <dtml-call "REQUEST.set('month',_.string.atoi(m_date[5:7],10))">
gives me a null value for month.
------- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )