Moment.js https://www.jianshu.com/p/94686fd4ae92 var newTime = moment(time).format("YYYY-MM-DD HH:mm:ss");