how to change todays date formate in python

Solutions on MaxInterview for how to change todays date formate in python by the best coders in the world

showing results for - "how to change todays date formate in python"
Sara
17 Jul 2020
1>>> datetime.today().strftime('%Y-%m-%d-%H:%M:%S')
2'2021-01-26-16:50:03'
3
Simon
09 Feb 2017
1>>> from datetime import datetime
2>>> datetime.today().strftime('%Y-%m-%d')
3'2021-01-26'
4