title: time is different between javascript date and java date
body: <p>I am trying to get time from both javascript and java for same timestamp.
  But somehow, there is difference.</p>
  
  <p>in Javascript, </p>
  
  <pre><code>var date = new Date();
  date.setTime(-27000000);
  document.getElementById("demo").innerHTML =  date.getHours() + ":" + date.getMinutes(); // 0:30
  </code></pre>
  
  <p>in java, </p>
  
  <pre><code>final Date date = new Date();
  date.setTime(-27000000);
  
  System.out.println(new SimpleDateFormat("hh:mm a").format(date)); // 12:00 AM
  </code></pre>
  
  <p>If we do proper formatting, javascript result is 12:30 AM whereas java is 12:00 AM. </p>