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.ParseExact("2/2/2002", "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture)
正在提高System.FormatException。
System.FormatException
如果有人能告诉我我做错了什么,我将不胜感激。
它应该是d/M/yyyy
d/M/yyyy
DateTime.ParseExact("2/2/2002", "d/M/yyyy", System.Globalization.CultureInfo.InvariantCulture)
异常的原因是它转换了两个位置,dd但找到的字符串是2/.
dd
2/