设置一年后的今天:
function setdays() {
var d = new Date();
console.log(d);
var year = d.getFullYear();
if (year % 4 === 0 && year % 100 != 0 || year % 400 === 0) {
console.log(new Date(d.setDate(d.getDate() + 366)));;
} else {
console.log(new Date(d.setDate(d.getDate() + 365)));;
}
}
setdays();