I want to find date by subtracting X number of days from a particular date in JavaScript. My JavaScript function accepts 2 parameters. One is the date value and the other i
function date_by_subtracting_days(date, days) { return new Date( date.getFullYear(), date.getMonth(), date.getDate() - days, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds() ); }