import datetime
from datetime import timedelta
todays_date = datetime.datetime.today()
todays_date = todays_date.strftime('%Y-%m-%d')
goal:
I want to return: 2022-4-9 Currently returning: 2022-04-09
I tried doing this, but it gives me an Invalid format string error
:
todays_date = todays_date.strftime('%Y-%-m-%-d')
The documentation that I looked at is located here:
https://www.programiz.com/python-programming/datetime/strftime
What am I doing wrong?