I have a list of strings that I want to format into a list of dates, before getting the max date time.
The list looks like:
StrList = ['date_range Date Posted: Thu, 08 11 2018 12:12:55 GMT',
'date_range Date Posted: Thu, 08 11 2018 10:53:49 GMT',
'date_range Date Posted: Thu, 08 11 2018 09:55:08 GMT',
'date_range Date Posted: Wed, 07 11 2018 14:23:56 GMT',
'date_range Date Posted: Wed, 07 11 2018 14:23:12 GMT',
'date_range Date Posted: Wed, 07 11 2018 09:07:47 GMT',
'date_range Date Posted: Tue, 06 11 2018 11:44:51 GMT',
'date_range Date Posted: Mon, 05 11 2018 16:17:51 GMT',
'date_range Date Posted: Mon, 05 11 2018 14:07:41 GMT',
'date_range Date Posted: Mon, 05 11 2018 14:03:19 GMT',
'date_range Date Posted: Mon, 05 11 2018 13:07:10 GMT',
'date_range Date Posted: Mon, 05 11 2018 13:05:56 GMT',
'date_range Date Posted: Mon, 05 11 2018 11:41:31 GMT']
I want to get a list that contains only the extracted date and time part of each list element and then subsequently find the maximum of the date times of all the elements.
E.g. Desired output:
DateList = ['08-11-2018 12:12:55',
'08-11-2018 10:53:49 GMT',
'08-11-2018 09:55:08 GMT',
'07-11-2018 14:23:56 GMT',
'07-11-2018 14:23:12 GMT',
'07-11-2018 09:07:47 GMT',
'06-11-2018 11:44:51 GMT',
'05-11-2018 16:17:51 GMT',
'05-11-2018 14:07:41 GMT',
'05-11-2018 14:03:19 GMT',
'05-11-2018 13:07:10 GMT',
'05-11-2018 13:05:56 GMT',
'05-11-2018 11:41:31 GMT']
Then the final step will be to get the maximum date time which in this case will be:
MaxDate = 08-11-2018 12:12:55
Any help will be appreciated.