title: Javascript Date issue when using setMonth
body: <p>When developing an firefox add-on the following gives different results? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var out = document.getElementById('out');
  
  out.textContent += new Date(2015, 1, 6, 16, 0, 0, 0) + '\n'; // -&gt; Date "2015-02-06T15:00:00.000Z" correct, months are zero-based
  var dt = new Date(0, 0, 0, 0, 0, 0, 0);
  dt.setFullYear(2015);
  dt.setMonth(1);
  dt.setDate(6);
  dt.setHours(16);
  out.textContent += dt + '\n'; // -&gt; Date "2015-03-06T15:00:00.000Z" ??</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;pre id="out"&gt;&lt;/pre&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is the setMonth(1) sets March in the second case.
  This happens to arbitrary dates, other dates work just fine with both approaches. Any idea why?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var out = document.getElementById('out');
  
  out.textContent += new Date(2015, 0, 30, 16, 0, 0, 0) + '\n'; // -&gt; 2015-01-30T15:00:00.000Z" months are zero-based
  var dt = new Date(0, 0, 0, 0, 0, 0, 0);
  dt.setFullYear(2015);
  dt.setMonth(0);
  dt.setDate(30);
  dt.setHours(16);
  out.textContent += dt + '\n'; // -&gt; 2015-01-30T15:00:00.000Z</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;pre id="out"&gt;&lt;/pre&gt;</code></pre>
  </div>
  </div>
  </p>