title: Adding a week to Date in JavaScript: rounding error or daylight savings?
body: <p>I am trying to add seven days to a Data object, however at some stage I start getting strange results.</p>
  
  <pre><code>var currDate = new Date(2011, 2, 28)
    , oldTicks = currDate.getTime()
    , newTicks = oldTicks + (86400000 * 7)
    , nextWeek = new Date(newTicks)
  console.log('Old ticks: ' + oldTicks)
  console.log('New ticks: ' + newTicks)
  console.log('New date : ' + nextWeek)
  </code></pre>
  
  <p>The output I get, both Chrome/FF is: </p>
  
  <pre><code>Old ticks: 1301230800000
  New ticks: 1301835600000
  log: New date : Sun Apr 03 2011 23:00:00 GMT+1000 (EST)
  </code></pre>
  
  <p>Expected to get:</p>
  
  <pre><code>log: New date : Mon Apr 04 2011 23:00:00 GMT+1000 (EST)
  </code></pre>
  
  <p>As you can see, instead of adding 7 days, just 6 were added. The code above, however, works fine with other dates, say 2011 Apr 28 or 2011 May 28.</p>