moment(Date.now()).subtract(3, 'd'); year code example Example: moment(endDate).subtract(1, 'month') moment().subtract(7, 'days');