日期:2014-05-18 浏览次数:20802 次
DateTime.Now.Year; DateTime.Now.Month; DateTime.Now.Day; DateTime.Now.Hour; DateTime.Now.Minute; DateTime.Now.Second;
------解决方案--------------------
同意上面的.
------解决方案--------------------
Convert.ToDateTime(DateTime.Now.Year.ToString()+"-"+DateTime.Now.Month.ToString()+"-"+DateTime.Now.Day.ToString());
Convert.ToDateTime(DateTime.Now.Hour.ToString()+"-"+DateTime.Now.Minute.ToString()+"-"+DateTime.Now.Second.ToString());
就行了.
------解决方案--------------------
直接
第一个
String.Format("yy-MM-dd")
第二个
String.Format("HH-mm-ss")