Here is my string "Wednesday 15th of April 2020 07:36:46 AM CDT"
.
Here is my code for parsing it:
var dtf = "dddd d MMMM yyyy HH:mm:ss tt zz";
var x = "Wednesday 15th of April 2020 07:36:46 AM CDT"
.Replace("st ", " ")
.Replace("th ", " ")
.Replace(" of ", " ")
.Trim();
DateTime.ParseExact(x, dtf, CultureInfo.InvariantCulture);
But it does not parse:
Unhandled exception. System.FormatException: String 'Wednesday 15 April 2020 07:36:46 AM CDT' was not recognized as a valid DateTime.
I think I have the format wrong.
How can I parse this date-time?