摘要: using System.Globalization; System.DateTime currentTime =DateTime.Now; // string strYMD= dt.GetDateTimeFormats('D')[0].ToString();//2005年11月5日 string strYMD = currentTime.GetDateTimeFormats('D')[0].ToString();//2010年7月19日 string strYMD2 = currentTime.ToLongDateString().ToString();//2010年7月19日 string shortTime = currentTime.ToShortDateString().ToString();//2010-7-19 string date1 = String.Format("yyyy-MM-dd",DateTime.Now); //error string year 阅读全文
posted @ 2010-07-19 21:36 叮当小马 阅读(4730) 评论(0) 推荐(0)