无法在c#中将字符串转换为日期

use*_*851 -1 c# asp.net-mvc datetime

我有约会时间:

string validDate = formCollection["ValidDate"];
Run Code Online (Sandbox Code Playgroud)

ValidDate值为:

06/24/2014
Run Code Online (Sandbox Code Playgroud)

如果我想转换validDateir.ValidDate我得到一个例外.

InterestRate ir = new InterestRate();

ir.ValidDate = Convert.ToDateTime(validDate);
Run Code Online (Sandbox Code Playgroud)

例外:

An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code

Additional information: String was not recognized as a valid DateTime.
Run Code Online (Sandbox Code Playgroud)

我试过以下.但仍然有例外:

DateTime resultDate = DateTime.ParseExact(validDate , "dd/MM/yyyy", CultureInfo.InvariantCulture);
Run Code Online (Sandbox Code Playgroud)

我到底错过了什么?

Tho*_*que 5

您的日期是格式MM/dd/yyyy(2014年6月24日),但您正在尝试将其解析为dd/MM/yyyy