Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我收到此错误:字符串未被识别为有效的日期时间。
DateTime date = DateTime.ParseExact("4/29/2013", "MM/dd/yyyy", null);
使用 oneM而不是MM匹配一个或两个数字的月份值的格式。
M
MM
这d几天也是如此。
d
DateTime date = DateTime.ParseExact("4/29/2013", "M/dd/yyyy", null); DateTime aDate = DateTime.ParseExact("4/2/2013", "M/d/yyyy", null);