title: Subtract days, months, years from a date in JavaScript
body: <p>Does anybody know of a simple way of taking a date (e.g. Today) and going back X days, X months and X years?</p>
  
  <p>I have tried that:</p>
  
  <pre><code>var date = new Date();
  $("#searchDateFrom").val((date.getMonth() -1 ) + '/' + (date.getDate() - 6) + '/' + (date.getFullYear() - 1));
  </code></pre>
  
  <p>But I got a negative date, for example today the output was:</p>
  
  <blockquote>
    <p>3/-3/2015</p>
  </blockquote>
  
  <p>Any advise?</p>
  
  <p>Thanks.</p>