日期:2014-05-18 浏览次数:20803 次
string str = "2012/3/31 14:34:22"; str = Convert.ToDateTime(str).ToString("yyyyMMdd")); //str结果:20120331
------解决方案--------------------
DateTime.Now.ToString("yyyyMMddHHmmss")
HH大写是24小时制,小写是12小时制
------解决方案--------------------
string s = "2012/3/31 14:34:22";
Response.Write(DateTime.Parse(s).ToString("yyyyMMdd"));