Source Code:
(back to article)
from datetime import datetime # get the current date now = datetime.now() # format the date as YYYY-MM-DD date_string = now.strftime("%Y-%m-%d") print(date_string)
Result:
Report an issue