js中把数据库时间转为正常值

function timeFormatter(value) {
var da = new Date(parseInt(value.replace("/Date(", "").replace(")/", "").split("+")[0]));
return da.getFullYear() + "-" + (da.getMonth() + 1) + "-" + da.getDate()
+ " " + da.getHours() + ":" + da.getMinutes() + ":" + da.getSeconds();
}

posted @ 2016-01-04 20:45  李文平  阅读(378)  评论(0编辑  收藏  举报