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.
我正在尝试获取文件夹重命名的自定义日期。
有没有办法以这种格式显示今天的日期:20130629
谢谢
DateTime.Today.ToString("yyyyMMdd");
MSDN:自定义日期和时间格式字符串
只需使用:DateTime.Now.ToString("yyyyMMdd")
DateTime.Now.ToString("yyyyMMdd")