Suppose we have the following list of date objects:
['2021-09-21T17:27:23.654Z', '2021-09-21T18:31:57.560Z', '2021-09-21T20:36:14.125Z']
.
How do we find which of these dates is the earliest and which is the latest? Is there a way to convert these dates to seconds?
When I do the following:
dts_list = ['2021-09-21T17:27:23.654Z', '2021-09-21T18:31:57.560Z', '2021-09-21T20:36:14.125Z']
dts = [datetime.fromisoformat(d) for d in dts_list]
I get the following error message:
ValueError: Invalid isoformat string: '2021-09-21T18:31:57.560Z'