日期加1天

直接加24 * 60 * 3600只能用在new Date()时

let next = new Date((new Date() + 24*60*3600));

自定义日期加一天

let custom = new Date('2022-6-1');
let next = new Date(custom .setDate(custom .getDate() + 1))
// Thu Jun 02 2022 00:00:00 GMT+0800 (中国标准时间) {}
// next.tolocalString()
// 2022/6/2 00:00:00

猜你喜欢

转载自blog.csdn.net/weixin_43915401/article/details/125105044
今日推荐