Complete the following function that converts a US date to a European date. Days and months are padded (if necessary) to become two digits each.
Example: europeanize('4/7/14')
returns '07/04/12'
Example: europeanize('02/27/08')
returns '27/02/08'
This is what I have so far. I am trying to get the current date to return a European date. Am I on the right track?
import datetime
today = datetime.date.today()
european_date = "2/12/2020"
def europeanize(date):
if today == european_date:
return european_date
print(today.strftime("%d/%m/%Y"))