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.
我已经尝试过 yyyy/MM/dd 但这会返回 1980/1/1,这将无法通过 .NET 中的文化信息格式检查
试试这个它添加了 0 所以你将拥有 1980/01/01
DateTime dt = new DateTime(1980, 01, 01); string result = String.Format("{0:yyyy/MM/dd}", dt);
希望能帮助到你