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.
我正在尝试解析这个日期字符串,但它给出了一个让我发疯的格式异常。任何人都可以帮忙吗?
string date = "05032013123020"; string format = "ddMMyyyyHHmmss"; DateTime result = DateTime.ParseExact(date, format, null);
粘贴字符串后 date = "05032013123020"; 到 Notepad++ 你可以看到以下结果:
字符串日期=“US05032013123020”;
这就是您在解析时遇到错误的原因