How can i parse a string like this: \"2/22/2015 9:54:02 AM\" to a DateTime instance?
i am currently using the DateTime.ParseExact method but without the AM/PM i.e:>
try this:
if (date.Contains("AM") || date.Contains("PM")) return DateTime.ParseExact(date, "dd.MM.yyyy h:mm:ss tt", CultureInfo.InvariantCulture); return DateTime.ParseExact(date, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture);