基础类库 date const date = new Date() // 示例1 console.log(formatToDateTime(date)) // 输出 "2022-01-01 12:00:00" // 示例2 console.log(formatToData(date)) // 输出 "2022-01-01"