I'm trying to manipulate dates using JavaScript on a single line, and I'm having problems with the year (not the month or day). I got this idea from the link . Did I miss something?
The code is as follows:
var newyear = new Date((new Date()).getYear(), (new Date()).getMonth(), (new Date()).getDate()+5).getFullYear();
document.write(newyear);
This gives me "110".
I'm not sure why? Thank!
source
share