json date convert

function getDateTime(jsondate) {
var date = new Date(parseInt(jsondate.replace("/Date(", "").replace(")/", ""), 10));
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hh = date.getHours();
var mm = date.getMinutes();
var ss = date.getSeconds();
return year + "-" + month + "-" + day + " " + hh + ":" + mm + ":" + ss;
}

getDateTime("\/Date(1385827200000+0800)\/")

上一篇:多文件上传 file-uploader.js


下一篇:正则基础之——捕获组(capture group)