As yyyy-MM-dd is the ISO standard format for date, you can also make use of the date.isoformat() function which will return a string representing the date in ISO 8601.
Example 2:
from datetime import date
todays_date_iso_format = date.today().isoformat()
print(todays_date_iso_format)
Output:
2023-07-6
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
Thanks for your feedback! If you have time, please provide details by selecting options below.
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!