DateTime('2002/01/18 21:34:18.4746 GMT+1' ).strftime('%m') should work. In your example you just assign a *representation* of the date to a string instead of passing the representation to the constructor of the DateTime class. - aj ----- Original Message ----- From: "Steffen Hausmann" <Steffen@Hausmann-family.de> To: <zope@zope.org> Sent: Thursday, January 24, 2002 09:20 Subject: [Zope] turn string into date
Hi,
I have a problem with a python script...
I want to know the month of a date. Therefor I use 'lastDate.strftime( '%m' )'. If I catch the date with 'lastDate = DateTime()' everything works fine, but if I define it manually ( 'lastDatee = 2002/01/18 21:34:18.4746 GMT+1' ), I am getting an attribute error:
Error Type: AttributeError Error Value: strftime
How can I turn the string into a date, so that strftime works again?
MfG Steffen -- Es gibt keine perfekten Menschen, nur perfekte Absichten.
_______________________________________________ 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 )