import datetime d =datetime.datetime.strptime("01/27/2012","%m/%d/%Y").strftime('%m/%d/%Y') print d 01/27/2012