var currentDate = new Date();
// 获取明天的日期
var tomorrow = new Date(currentDate);
tomorrow.setDate(currentDate.getDate() + 1);
// 设置为早上八点
tomorrow.setHours(8, 0, 0, 0);
var year = tomorrow.getFullYear();
var month = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
var day = tomorrow.getDate().toString().padStart(2, '0');
var hours = tomorrow.getHours().toString().padStart(2, '0');
var minutes = tomorrow.getMinutes().toString().padStart(2, '0');
var seconds = tomorrow.getSeconds().toString().padStart(2, '0');
var formattedDateTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
console.log(formattedDateTime);
02-20
1321
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交