标签:io ar for on 2014 cti bs ef new
//自定义日期类型转化函数ChangeDateFormat,将//Date(1294499956278+0800)//形式的函数转化为2014-5-2形式
function ChangeDateFormat(jsondate) {
jsondate = jsondate.replace("/Date(", "").replace(")/", "");
if (jsondate.indexOf("+") > 0) {
jsondate = jsondate.substring(0, jsondate.indexOf("+"));
} else if (jsondate.indexOf("-") > 0) {
jsondate = jsondate.substring(0, jsondate.indexOf("-"));
}
var date = new Date(parseInt(jsondate, 10));
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
return date.getFullYear() + "-" + month + "-" + currentDate;
}
标签:io ar for on 2014 cti bs ef new
原文地址:http://www.cnblogs.com/tong775131501/p/4107508.html