title: How to get current time in a format hh:mm AM/PM in Javascript?
body: <p>I have a Javascript in which I need to paste the current time in a format HH:MM AM/PM. There's one catch - I need to put the time that starts in two hours from now, so for example, instead of 7:23PM I need to put 9:23PM, etc. </p>
  
  <p>I tried to do something like: <code>var dateFormat = new Date("hh:mm a")</code> but it didn't work. I also tried to use:</p>
  
  <pre><code>var today = new Date();
  var time = today.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3")
  alert(time);
  </code></pre>
  
  <p>but all I've seen was e.g. 18:23 instead of 6:23 PM (probably because of toLocaleTimeString() and my location in Europe) - maybe there's some unified way to do that that will work all around the World?. Also, I don't know exactly how to add the 2 hours to the final result. Can you help me?
  Thanks!</p>