title: Getting only hours and minutes from date object
body: <p>I want to get a <code>JavaScript</code> code that displays only hour, minute and AM or PM. I don't want seconds.</p>
  
  <p>This is the code i have so far:</p>
  
  <pre><code>var d = new Date();
  document.getElementById("time").innerHTML = d.toLocaleTimeString();
  </code></pre>