Have a date string and want to find the format string needed to parse it?

Read more 👉 https://trey.io/l4b84k

#Python

Converting a string to a datetime

The datetime.strptime class method can parse a date/time string into a datetime object.

@treyhunner as I believe I mentioned the last time you posted this, the best strategy is to use Python 3.11+ and standard ISO 8601 format strings. In that case, the ”fromisoformat()” methods will handle everything for you. 😊

https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat

datetime — Basic date and time types

Source code: Lib/datetime.py The datetime module supplies classes for manipulating dates and times. While date and time arithmetic is supported, the focus of the implementation is on efficient attr...

Python documentation