页面事件处理格式

前台页面事件处理格式为

<%=Convert.ToDateTime( xinwen.Rows[i]["FTime"]).ToShortDateString() %>     意思是去掉时分秒   只显示年月日

 

后台时间处理格式为

//日期格式更改
function changeDateFormat(cellval) {
var time = new Date(cellval);
var year = time.getFullYear(); //获取年
var month = time.getMonth() + 1; //获取月
var day = time.getDate(); //获取日
time = year + "-" + month + "-" + day;
return time;
}

写到后台显示区的格式为:     

{
field: 'FTime',
title: '发布日期',
formatter: function (value, row, index) {
return changeDateFormat(value)
}  

},

意思是去掉时分秒   只显示年月日

posted on 2019-12-24 11:34  透明的鱼!  阅读(184)  评论(1编辑  收藏  举报

导航