title: Javascript getFullYear, getMonth, getDate not working
body: <p>I'm sorry I might be flamed for this but as a newbie I would like to make this work it is on Dates. I have this code:</p>
  
  <pre><code>var date = new Date('Apr 21, 2015');
  </code></pre>
  
  <p>and when I alert using this code:</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 date = new Date('Apr 21, 2015');
      alert(date.getFullYear());
      alert(date.getMonth());
      alert(date.getDate ());</code></pre>
  </div>
  </div>
  </p>
  
  <p>it displays NaN. Can someone suggest me how to do this?</p>