title: JavaScript setDate returning wrong dates
body: <p>I'm getting a date from a string, parsing it to get the day, month and year constituants and use these to instance a Date object.</p>
  
  <p>What I am trying to achieve is to increment the date by one day.
  It all works fine except that the setDate method insists on returning me invalid dates sometimes...</p>
  
  <p>For example, if I add 1 day to the 28th February 2011, it will return me 29th February 2011... a date which actually doesn't exist.</p>
  
  <p>Is that a bug/limitation of the JavaScript's native Date/Time API, or am I just doing something wrong? I find it hard to believe that it behaves that way without checking the validity of the date.</p>
  
  <pre><code> var myDate = new Date(2011, 2, 28);
   alert(myDate);
   myDate.setDate(myDate.getDate() + 1);
   alert(myDate); // 29 February 2011 !
  </code></pre>
  
  <p>Thanks.</p>