add 3 months to current date javascript code example

Example 1: javascript date 3 months ago

var d = new Date();
d.setMonth(d.getMonth() - 3);

Example 2: javascript after 2 months date find

var newDate = new Date(date.setMonth(date.getMonth()+8));

var jan312009 = new Date(2009, 0, 31);
var eightMonthsFromJan312009  = jan312009.setMonth(jan312009.getMonth()+8);
//@SUJAY

Example 3: javascript date 3 months ago

var someDate = new Date(); // add arguments as needed
someDate.setTime(someDate.getTime() - 3*28*24*60*60);
// assumes the definition of "one month" to be "four weeks".