/Date......的日期格式化

var date = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var date= date.getFullYear() + "-" + month + "-" + currentDate;

posted @ 2018-03-30 10:58  就爱敲代码  阅读(260)  评论(0编辑  收藏  举报