1 function GetDateByShiJianChuo(timespan) { 2 var date = new Date(parseInt(timespan.replace("/Date(", "").replace(")/", ""))); 3 var dateStr = date.toLocaleDateString(); 4 dateStr = dateStr.replace("/", "-").replace("/", "-"); 5 return dateStr; 6 //console.log(date.toLocaleDateString());//2017/4/12 7 //console.log(date.toDateString());//Wed Apr 12 2017 8 //console.log(date.toLocaleString());//2017/4/12 上午12:00:00 9 //console.log(date.toLocaleTimeString());//上午12:00:00 10 }