subtrair datas javascript frontend code example Example: subtrair datas javascript frontend var d = new Date(); d.setDate(d.getDate()-5);