时间:2020-12-18 02:30:08 | 栏目:JavaScript代码 | 点击:次
关键代码如下所示:
function formatDate(NewDtime) var dt = new Date(parseInt(NewDtime.slice(6, 19))); 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 + " " + hour + ":" + minute + ":" + second; }