HTML + JavaScript Date Setters funciton setting differnt date other than the input
<p>Consider the following code of HTML &amp; JavaScript</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
    &lt;script&gt;
        var str = "20990229";
        var showDate = new Date();
        showDate.setFullYear(str.substring(0, 4))
        showDate.setMonth(parseInt(str.substring(4, 6), 10) - 1)
        showDate.setDate(str.substring(6, 8))
        document.write(showDate)
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>Output</strong>: </p>

<blockquote>
  <p>Fri Mar 01 2099 16:02:52 GMT+0530 (India Standard Time) </p>
</blockquote>

<p>The output is not the correct one, where I am going wrong is not known.</p>

<p>Could anyone tell me where I am going wrong?</p>
