- 安装
yarn add moment
- 使用
const moment = require('moment')
let currentTime = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')
console.log(currentTime)
yarn add moment
const moment = require('moment')
let currentTime = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')
console.log(currentTime)