Python Program to convert date into a specified format

import datetime
import dateutil.parser

input_date = '10th May 1996'
parsed_date = dateutil.parser.parse(input_date)

output_date = datetime.datetime.strftime(parsed_date, '%d-%m-%Y')
print(output_date)
#outputs 10-05-1996



Comments