获取指定日期的 下一年 日期

var entime="2023-06-17 09:31:09";
     var unixtimestamp = new Date(endTime);
            var year = 1900 + unixtimestamp.getYear()+1;
            var month = "0" + (unixtimestamp.getMonth() + 1);
            var date = "0" + unixtimestamp.getDate();
            var hour = "0" + unixtimestamp.getHours();
            var minute = "0" + unixtimestamp.getMinutes();
            var second = "0" + unixtimestamp.getSeconds();
            var renewalTime=year + "-" + month.substring(month.length-2, month.length)  + "-" + date.substring(date.length-2, date.length)
                + " " + hour.substring(hour.length-2, hour.length) + ":"
                + minute.substring(minute.length-2, minute.length) + ":"
                + second.substring(second.length-2, second.length);

 

posted @ 2020-06-17 10:53  Jinsuo  阅读(494)  评论(0编辑  收藏  举报