user image

Preeti Tripathi

Job Interview Skills
English
2 years ago

66. Write a program for converting dates from the yyyy-mm-dd format to the dd-mm-yyyy format.

user image

Abhishek Mishra

2 years ago

The date string can be converted using the re module as illustrated below:import redef transform_date_format(date): return re.sub(r'(\d{4})-(\d{1,2})-(\d{1,2})', '\\3-\\2-\\1', date)

Recent Doubts

Close [x]