[Zope] Converting an input date string

Dieter Maurer dieter@handshake.de
Sun, 3 Nov 2002 00:02:49 +0100


McDonnell, Larry writes:
 > How do I convert an input date string "10/22/02" to "2002/10/22" in a date
 > format?
You split it at "/" and rearrange the peaces:

    In Python (Script):

       month,day,year= datestring.split('/')
       return '20%02d/%02d/%02d' % (year,month,day)


Dieter