function formatDate(dt) {
var year = dt.getFullYear();
var month = dt.getMonth() + 1;
var date = dt.getDate();
var hour = dt.getHours();
var minute = dt.getMinutes();
var second = dt.getSeconds();
return year + "-" + month + "-" + date;
}
function Test(time) {
var t= time.slice(6, 19)
var NewDtime = new Date(parseInt(t));
return formatDate(NewDtime);
}
转自https://zhidao.baidu.com/question/271783390.html