I have following date time formatted string.
04-AUG-2022
I need to convert it into following date format. 04 August 2022
. how can I do that, I tried following code.
string date = "04-AUG-2022";
DateTime d = DateTime.ParseExact(date, "dd-MMMM-yyyy",
CultureInfo.InvariantCulture);
But it shows,
System.FormatException: 'String '04-AUG-2022' was not recognized as a valid DateTime`