安装 npm i moment -S 导入 var moment = require('moment'); 使用 moment(new Date()).format("YYYY-MM-DD") 官方文档