I have a unicode string for example u'Mar232012'. I want to convert it to the format MM/DD/YYYY using python in the post efficient and reliable manner.
import datetime
datetime.datetime.strptime(u'Mar232012', '%b%d%Y').strftime('%m/%d/%Y')
prints '03/23/2012'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With