下载:
https://www.npmjs.com/网站上下载silly-datetime
安装
npm i silly-datetime --save
javascript
var sd = require('silly-datetime');
console.log(new Date()); //2024-04-18T04:40:38.505Z
var d=sd.format(new Date(), 'YYYY-MM-DD HH:mm');
console.log(d); //2024-04-18 12:40