js转换后台接受的日期格式

var html = "--";
if(data.createTime!=null&&data.createTime!=""){
Date.prototype.toLocaleString = function() {
return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() ;
};
var unixTimestamp = new Date(data.createTime) ;
commonTime = unixTimestamp.toLocaleString();

html=commonTime;
}
return html;

友情链接:https://www.cnblogs.com/zhanghaoliang/p/5997619.html
posted @ 2019-08-17 11:31  Sea。  阅读(993)  评论(0编辑  收藏  举报