var date = new Date(); date.setDate(date.getDate() - 30); var dateString = date.toISOString().split('T')[0]; // "2016-06-08"