1function monthDiff(d1, d2) {
2 var months;
3 months = (d2.getFullYear() - d1.getFullYear()) * 12;
4 months -= d1.getMonth();
5 months += d2.getMonth();
6 return months <= 0 ? 0 : months;
7}
1var newDate = new Date(date.setMonth(date.getMonth()+8));
2
3var jan312009 = new Date(2009, 0, 31);
4var eightMonthsFromJan312009 = jan312009.setMonth(jan312009.getMonth()+8);
5//@SUJAY