C# c“DateTime.ParseExactException in specific date”;年月日;

C# c“DateTime.ParseExactException in specific date”;年月日;,c#,.net,C#,.net,我的代码如下所示: DateTime.ParseExact(d, "dd/MM/yy", CultureInfo.InvariantCulture); 当日期为“2010年11月31日”时,例外情况: System.FormatException: The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar. 被抛出 在“31/10/10”

我的代码如下所示:

DateTime.ParseExact(d, "dd/MM/yy", CultureInfo.InvariantCulture);
当日期为“2010年11月31日”时,例外情况:

System.FormatException: The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.
被抛出


在“31/10/10”或“31/12/10”的情况下,它运行良好,为什么会发生这种情况?

11月只有30天,所以11月31日不存在。

11月只有30天

11月只有30天。还有谁刚刚读过童谣?!哦,我没有检查,这是用户输入