In [5]:
import time
import datetime
from datetime import datetime #???
In [3]:
#time
time_tuple = time.strptime(txt, "%m/%d/%Y %I:%M:%S %p") # time tuple
print time_tuple
In [7]:
#date
txt = "1/11/2011 11:15:00 AM"
datetime_ = datetime.strptime(txt, "%m/%d/%Y %I:%M:%S %p")
print datetime_
print type(datetime_)
print str(datetime_)
In [ ]: