String to Date function?

Peter Hansen peter at engcorp.com
Wed May 28 14:10:02 EDT 2003


Arsenal wrote:
> 
> I want to convert a string of format like "Mon Nov 25 21:32:11 2002"
> to a date in Python. According the lib. ref, i tried strptime(string[,
> format]) . But python complained that the time module doesnt have this
> function. Any advice appreciated!

You're probably running under Windows, which I believe doesn't have
the function.

Check out http://www.python.org/dev/doc/devel/whatsnew/node18.html which
notes that there's a pure Python version in Python 2.3, which is to
be released fairly shortly.

-Peter




More information about the Python-list mailing list