开发者

DateTime format string

开发者 https://www.devze.com 2023-03-05 09:08 出处:网络
DateTime date = DateTime.Parse(\"2011-05-04 14:33:41\"); //4 m开发者_JS百科ay 2011 How do I convert this date to \"20110504 14:33:41\"?Format it like this
DateTime date = DateTime.Parse("2011-05-04 14:33:41"); //4 m开发者_JS百科ay 2011

How do I convert this date to "20110504 14:33:41"?


Format it like this

string formattedDate = date.ToString("yyyyMMdd HH:mm:ss");
0

精彩评论

暂无评论...
验证码 换一张
取 消