String was not recognized as a valid DateTime. : string date1="06/06/2017";
string date2="06/05/2017";
The dates are in format "mm/dd/yyyy".I need to compare two dates

string test = DateTime.ParseExact(date1, "DD/M/yyyy", CultureInfo.InvariantCulture);

iam unable to find out why Iam getting error like String was not recognized as a valid DateTime. 