+ 1
Help me fix my code. (Date format change)
I want to accept date in either mm/dd/YYYY format and change it to dd/mm/YYYY format. I'm not getting any output. Here's my code. import datetime dt = input() if(dt=='%m/%d/%Y'): format_str = '%m/%Y/%d' dt = datetime.datetime.strptime(dt, format_str) print(dt.date())
1 Respuesta
+ 3
if you want to change mm/dd/yyyy to dd/mm/yyyy
https://code.sololearn.com/cvFMz5I0vzOX/?ref=app
but if you want something else ...