Hi I have the following method and I'm passing it the value "07 Jan 2014 13:48:46" and from what I understand the TryParseExact should be matching the format "dd MMM yyyy hh:mm:ss" and returning true, however it is returning false, any ideas?
string[] formats= {"dd-MM-yyyy hh:mm:ss",
"dd MMM yyyy hh:mm:ss",
"dd MMM yyyy",
"hh-mm-ss",
"dd-MM-yyyy",
"dd-MM-yy",
};
DateTime result;
if (DateTime.TryParseExact(value, formats, CultureInfo.CurrentCulture, DateTimeStyles.None, out result))
{
return result;
}
return null;