// datenow minus 20 seconds new Date(Date.now() - 20000);
var endDate = somedate; var startdate = new Date(endDate); var durationInMinutes = 20; startdate.setMinutes(endDate.getMinutes() - durationInMinutes);