title: Get Meridian from time in Javascript
body: <p>I have following time <strong>"Mon Jun 22 03:45:24 PDT 2015"</strong> how can I get Meridian using Javascript.
  I was doing this:</p>
  
  <pre><code>d= Mon Jun 22 03:45:24 PDT 2015;
  var hours = d.getHours();
  var meridiem = "AM";
  
  if (d.getHours() &gt; 12) {
     hours = d.getHours() % 12;
     if (hours == 2) {
        hours = 12;
     }
     meridiem = "PM";
  }
  </code></pre>
  
  <p>But its not working in IE 8.</p>