title: How to get the date before 180 days?
body: <p>I want to get the exact date before 180 days using Java script. ie: If the selected date is '26-12-2012', then the output is '30-06-2012'(before 180 days).</p>
  
  <p>I've tried with:</p>
  
  <pre><code>var ndate      = date.setDate(date.getDate() - 180);
   var day1       = ndate.getDate();
   var month1     = ndate.getMonth();
   var year1      = ndate.getFullYear();
   document.entry.callback.value = day1+"-"+month1+"-"+year1;
  </code></pre>
  
  <p>It works but not exactly. When the selected date is in the month of June,  then the output Month is showed as '0'. Ie: '02-06-2012' then the result is '04-0-2012'.</p>
  
  <p>What would be the better solution for this!</p>