You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function add_years(dt,n)
|
|
{
|
|
return new Date(dt.setFullYear(dt.getFullYear() + n));
|
|
}
|
|
|
|
dt = new Date();
|
|
console.log(add_years(dt, 10).toString());
|
|
|
|
dt = new Date(2014,10,2);
|
|
console.log(add_years(dt, 10).toString());
|