const youWant=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
console.log(youWant,'//')
//yyyy-MM-dd hh:mm:ss
Tue Dec 01 00:00:00 GMT+08:00 1998 转成自定义字符串
最新推荐文章于 2022-03-27 19:55:47 发布