How can we covert string into Datetime object

Nikhil Verma varma.nikhil22 at gmail.com
Fri May 11 07:13:35 EDT 2012


Hi All

I was going through this link
http://docs.python.org/library/datetime.html#strftime-strptime-behavior.
I practised strftime() and strptime() functions.

Finally i stuck into a situation where  i want to get the datetime object
so that i can save it in my db.
What i want is :-

I have a string let say
date_created = '11 May Friday PM '

and i want to convert it into datetime object like this
datetime.datetime(2012, 5, 11, 4, 12, 44, 24734)

Thanks in advance. Any help will be appreciated

-- 
Regards
Nikhil Verma
+91-958-273-3156
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120511/4cfb9015/attachment.html>


More information about the Python-list mailing list