Recently, I wrote this function for my purpose.
See if this helps you.
Assuming that argument 'dte' input format is -->> "03-11-2011"
[CODE]
import datetime, string
def str_to_dt(dte):
dte = str(dte)
dte = string.strip(dte)
if len(dte) == 10:
y = int(dte[6:])
m = int(dte[3:5])
d = int(dte[:2])
return datetime.date(y, m, d)
[/CODE]
This returns output in "python datetime.date" format.
--Vineet