0

I have monthe date, year for ex : January 1,2018 or June 14,2018, now i want to convert them as 01/01/2018, 06/14/2018. can anybody help me on this using python.

Srikanth
  • 65
  • 1
  • 1
  • 7

1 Answers1

0

I have found the answer,

oldformat = 'June 13, 2018'
datetimeobject = datetime.strptime(oldformat,'%B %d, %Y')

newformat = datetimeobject.strftime('%m/%d/%Y')
print newformat
Srikanth
  • 65
  • 1
  • 1
  • 7