How do I put the current date into a list in the format I want?
import datetime
today = datetime.date.today()
lst=[]
lst.append(today)
lst[0]
>>> datetime.date(2018, 6, 22)
print(lst[0]) #found this code on another post (I have no idea how it works)
>>> 2018-06-22
I am trying to get "2018-06-22", which is the output of print(lst[0]), into my list but I can only get "datetime.date(2018, 6, 22)". Thanks in advance!
Update:
lst.append(str(today))
Using this code gets me the same results and I have no idea how it works.