62,046
社区成员
发帖
与我相关
我的任务
分享
string strrq = "20080901"
string strN = "";
string strY = "";
string strr = "";
strN = strrq.Substring(0, 4);
strY = strrq.Substring(4, 2);
strr = strrq.Substring(6, 2);
strN = strN.PadRight(5, '-');
strY = strY.PadRight(3, '-');
string strrqtext= strN + strY + strr;
string dd= "20080901";
DateTime dt= DateTime.ParseExact(dd, "yyyyMMdd", null);
string dd= "20080901 ";
DateTime dt= DateTime.ParseExact(dd, "yyyy-MM-dd", null);
string dd= "20080901";
DateTime dt= DateTime.ParseExact(dd, "yyyyMMdd", null);
Response.Write(dt.ToShortDateString());
string dd = "2008<br>09<xx>01";
DateTime dt = DateTime.ParseExact(dd, "yyyy<br>MM<xx>dd", null);