Possible Duplicate:
DateTime.ParseExact string format exception
FormatException
was found !
I tried to convert a string to DateTime
.
string dateString1 = "5/22/1985 12:00:00 AM";
DateTime myDate =
DateTime.ParseExact(dateString1,
"mm-dd-yyyy",
System.Globalization.CultureInfo.InvariantCulture);
It gives me an error, but when I try to convert a string in this format
string dateString2 = "10-10-2000";
This second string is working just fine but the dateString1
does not work!