I have this method which shall return the day of the week (Wed):
protected string GetDayOfWeek(string dateTimeString)
{
DateTime result = DateTime.Parse(dateTimeString);
string dayOfWeek = Enum.GetName(typeof(DayOfWeek), result.DayOfWeek);
return dayOfWeek;
}
I have a breakpoint on the line DateTime result to check the incoming string which gives:
"Wed, 12 Mar 2014 00:00:00 GMT"
The above method is giving me error:
"FormatException not handled by the user code" String not recognised as a valid dateTime.
What am I doing wrong? I cannot pick it up.