i have date in string in this format
eg. 1/20/21011 i need to convert it into the date object
eg. 1/20/21011 i need to convert it into the date object
>>> import time
>>> s = "1/20/2011 10:30:00 AM"
>>> time.strptime(s, "%m/%d/%Y %I:%M:%S %p")
(2011, 1, 20, 10, 30, 0, 3, 20, -1)
>>> time.strptime("1/20/2011 10:30:00 PM", "%m/%d/%Y %I:%M:%S %p")
(2011, 1, 20, 22, 30, 0, 3, 20, -1)
>>>
Comment