function getDate(str_time) {

var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/');

var r = (str_time || '').match(re);

var format = r ? new Date(((r[1] || '') + r[2]) * 1) : null;

return r ? new Date(((r[1] || '') + r[2]) * 1) : null;

}

function formatDate(now) {

var year = now.getYear()+1900;

var month = now.getMonth() + 1;

var date = now.getDate();

var hour = now.getHours();

var minute = now.getMinutes();

var second = now.getSeconds();

return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;

}

var d=formatDate(getDate('/Date(1426056463000)/'));

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐