title: Issue with getMonth() Method Javascript
body: <p>getMonth() javascript method returns the month of the Date and values are (0-11) 0 for January and 11 for December.</p>
  
  <p>If today was "2015-03-01" (first day of March 2015), getMonth() should return <strong>2</strong>  but instead it returns <strong>1</strong>. Why is this? how can I solve this issue?</p>
  
  <p>Help!!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h2&gt;JavaScript Date Example&lt;/h2&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var x = new Date("2015-03-01");
  document.getElementById("demo").innerHTML = x.getMonth();
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I "Run code Snippet" It shows this:</p>
  
  <p><img src="https://i.stack.imgur.com/8HFQj.png" alt="example of result"></p>