I’m trying to use DateTime.ParseExact, but I keep getting an error thrown back
String was not recognized as a valid DateTime.
Looking at the screenshot below, I’ve stored my item in the dateToParse variable (just for reference purposes).
but at the bottom, where I’m trying to set the Date, it doesn’t want to play nicely.
Date = DateTime.ParseExact(rawDescription[4], "MM'/'dd'/'yyyy", null)
I also tried it without the single quotes and with a specified culture
Date = DateTime.ParseExact(rawDescription[4], "MM/dd/yyyy", CultureInfo.InvariantCulture)

Any idea what’s going wrong?
var dateToParse = rawDescription[4];is showing a space before the first character. Adding a call toTrimwill fix the issue.