Skip to content

Convert a date to its ISO-8601 equivalent in Python

Advertisements

from datetime import datetime
print(datetime(2020, 12, 15).isoformat())

#2020-12-15T00:00:00

See also  Python code snippet - How to add button in tkinter?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.