How do I convert String into Date object

MrPink tdsimpson at gmail.com
Sat Aug 13 15:14:14 EDT 2011


Is this the correct way to convert a String into a Date?
I only have dates and no time.

import time, datetime

oDate = time.strptime('07/27/2011', '%m/%d/%Y')
print oDate

Thanks,



More information about the Python-list mailing list