Corrected as of 25.06.2019:
var newDate = new Date(date.setMonth(date.getMonth()+8));
Old
From here:
var jan312009 = new Date(2009, 0, 31);
var eightMonthsFromJan312009 = jan312009.setMonth(jan312009.getMonth()+8);
More Related Contents:
- new Date(2015,2,30) and new Date(‘2015-2-30’)
- How do I format a date in JavaScript?
- Calculate age given the birth date in the format YYYYMMDD
- How do I get the difference between two Dates in JavaScript?
- Convert UTC Epoch to local date
- How to validate date with format “mm/dd/yyyy” in JavaScript?
- How to subtract date/time in JavaScript? [duplicate]
- Compare two dates with JavaScript
- Get time of specific timezone [duplicate]
- Function to convert timestamp to human date in javascript [duplicate]
- Check if one date is between two dates
- How do I calculate how many seconds between two dates?
- javascript Date timezone issue
- Get the current year in JavaScript
- Get week of the month
- Convert normal date to unix timestamp
- why does javascript getMonth count from 0 and getDate count from 1?
- Inserting and Querying Date with MongoDB and Nodejs
- how to compare two string dates in javascript?
- Javascript countdown using absolute timezone?
- Why does Javascript getYear() return a three digit number?
- Date.toISOString() but local time instead of UTC
- Elegant method to generate array of random dates within two dates
- Javascript date parsing on Iphone
- create javascript date UTC
- Getting the date of next Monday
- Java date format to JavaScript date format
- Generate random date between two dates and times in Javascript
- Convert iso timestamp to date format with Javascript?
- How to convert Moment.js date to users local timezone?