var timestamp = Date.parse(new Date());
var date = new Date(timestamp);
var Y =date.getFullYear();
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
console.log("当前时间:" + Y + '年' + M+ '月' + D+ '日' );
11-15
221
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-04
273
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-16
255
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-13
8067
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-20