js 指定日期加一天

https://blog.csdn.net/qq_34755231/article/details/52619114

function dateAdd(startDate) {
        startDate = new Date(startDate);
        startDate = +startDate + 1000*60*60*24;
        startDate = new Date(startDate);
        var nextStartDate = startDate.getFullYear()+"-"+(startDate.getMonth()+1)+"-"+startDate.getDate();
        return nextStartDate;
    }

这里的startDate是我从别的地方传过来的,可以自定义时间, startDate = +startDate + 1000*60*60*24;当时间为月末,这里会自动加一个月。
--------------------- 
作者:抠脚灬大汉 
来源:CSDN 
原文:https://blog.csdn.net/qq_34755231/article/details/52619114 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/MyNameIsXiaoLai/article/details/86654252