获取input框里面的时间,并且加一天

 var str = $("#EndTime").val();  //命名一个变量保存获取的input里面的时间
            // 创建日期对象
            var date = new Date(str);
            //// 加一天
            date.setDate(date.getDate() + 1);
            str = date.getFullYear() + '-'
                // 因为js里month从0开始,所以要加1
                + (parseInt(date.getMonth()) + 1) + '-'
                + date.getDate();
发布了21 篇原创文章 · 获赞 3 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/qq_40039641/article/details/79019373