import datetime datetime.datetime.strptime('24052010', "%d%m%Y").date() datetime.date(2010, 5, 24)
import datetime t = datetime.datetime(2012, 2, 23, 0, 0) t.strftime('%m/%d/%Y') #Output '02/23/2012'