javascript get days since date code example
Example 1: javascript subtract days from date
var myCurrentDate=new Date();
var myPastDate=new Date(myCurrentDate);
myPastDate.setDate(myPastDate.getDate() - 8);//myPastDate is now 8 days in the past
Example 2: new date() in javascript 3 days from now
var dt = new Date();
dt.setDate(dt.getDate() + 3);