I have some client code that sends date in the following format "1/31/2013 11:34:28 AM";
I am trying to cast it into DateTime object
string dateRequest = "1/31/2013 11:34:28 AM";
DateTime dateTime = DateTime.Parse(dateRequest);
this throws
String was not recognized as a valid DateTime.
how can i cast it?
DateTime.Parseoverloads that accept a culture and pass a fixed value. E.g.CultureInfo.InvariantCulture.