1var myCurrentDate=new Date();
2var myPastDate=new Date(myCurrentDate);
3 myPastDate.setDate(myPastDate.getDate() - 8);//myPastDate is now 8 days in the past
1var date = new Date();
2date.setDate(date.getDate() + days);
3date.setMonth(date.getMonth() + months);
4date.setFullYear(date.getFullYear() + years);
5console.log((date.getMonth() ) + '/' + (date.getDate()) + '/' + (date.getFullYear()));
1var dateOffset = (24*60*60*1000) * 5; //5 days
2var myDate = new Date();
3myDate.setTime(myDate.getTime() - dateOffset);
4