I have a string like this (in 12 hr clock) in my XML config data file:
expires="10/27/2014 2:42:57 PM"
I want to assign that value as a (datetime) member of a class like this:
Common.SOExpiries =
DateTime.ParseExact(gSet.Attribute("expires").Value, "MM/dd/yyyy hh:mm:ss",
CultureInfo.InvariantCulture);
but I am getting the error 'String was not recognized as a valid DateTime'
what am I doing wrong here?
This is in the UK btw, so the CultureInfo should be ok