//1632298522000 时间戳-可用 const date = new Date(1632298522000) const Y = date.getFullYear() const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) const H = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() const Min = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() const S = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() const dateTime = Y + '年' + M + '月' + D + '日' + H + '时' + Min + '分' + S + '秒' console.log(dateTime,'解析成:2021年09月22日16时15分22秒')