时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串"/>
js格式化标准时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串
var nowTime = new Date(); // Date Thu Dec 02 2021 16:10:53 GMT+0800 (中国标准时间)let time = nowTime.getFullYear() + '-' + (nowTime.getMonth() + 1) + '-' +nowTime.getDate() + ' ' + nowTime.getHours() + ':' + nowTime.getMinutes() + ':' + nowTime.getSeconds();console.log(time); // 2021-12-2 16:10:53
// 一天的时间86400000
var yesterdsay = new Date(new Date().getTime() - 86400000);
更多推荐
js格式化标准时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串
发布评论