I have datetime strings that look can like any the following:
"1 13 2009 2300", "1 14 2009 0", "1 14 2009 100"
that I need to parse into a DateTime.
I have tried:
string[] sExpectedFormats = {"M d yyyy Hmm", "M d yyyy hmm", "M d yyyy 0"};
DateTime dtReportDateTime = DateTime.ParseExact(sReportDateTime,
sExpectedFormats,
System.Globalization.CultureInfo.InvariantCulture,
System.Globalization.DateTimeStyles.None);
but it fails on the third one "1 14 2009 100". I am not sure what format to use for that?
To clarify, I get this data in a feed as a date part "1 14" and a time part "100", so am concatenating it so I can parse into a DateTime.
Thanks