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.Now.ToString() 在应用程序中显示当前时间。在某些计算机中它看起来不错,但在其他计算机中,时间显示出有趣的值。例如,它显示 2010/11/09\0؎鹖撗䄠ϗ퉌؎鵢 任何想法如何解决它?
请检查机器的日期格式。它应该与支持应用程序的格式相同。
转换时可以给它一个格式:
DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss");
这不好笑..转到控制面板并更改Regional and Language Options settings..然后再试一次
Regional and Language Options settings
或使用文化信息