Frontend JavaScript de subtrair

 var d = new Date();
 d.setDate(d.getDate()-5);
DevPedrada