I know similar questions have been asked such as here: DateTime string conversion with both month name and AM/PM
Indeed, I am having a very similar problem but even when I follow the answers to the question above it still doesn't seem to work for me. I'm trying to execute the following piece of code:
dateTime = DateTime.ParseExact(dateString + " " + yearString + " " +
timeString, "MMMM dd yyyy HH:mm tt",
System.Globalization.CultureInfo.InvariantCulture);
Where 'dateString' is "September 25" 'yearstring' is "2017" 'timestring' is "6:30 PM"
The Exception that gets thrown when executing this code is FormatException String was not recognized as a valid DateTime. In my date string above I am inserting a single white space for each use of quotes.