2012年4月5日
摘要: aspx页面源码为:<%=dt.Rows[i]["S_DATE1"].ToString()%>但是这样页面上不知会显示年月日,而且还显示时分秒,现在我们不需要时分秒,只需要在页面上年月日足矣。首先想到的是这样:1.在cs文件中建一个方法,用来对时间转换protected string FormatDate(DateTime datetime) { return datetime.ToShortDateString().ToString(); }2.aspx页面中<%=FormatDate(Convert.ToDateTime(dt.Rows[i][&quo 阅读全文
posted @ 2012-04-05 12:43 LitDev 阅读(929) 评论(0) 推荐(0) 编辑