title: Convert long time difference to format HH:mm [Java]
body: <p>How can I convert the difference of the current time a given time to create a string with the time format: HH:mm ? ex. 18:36 </p>
  
  <p>I did the following but, it is not 24Hour format, it will add AM/PM to the end, and it is 3 hours off.</p>
  
  <pre><code>        java.util.Date today = new java.util.Date();
          java.sql.Timestamp ts1 = new java.sql.Timestamp(today.getTime());
  
          SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
          java.util.Date parsedDate = dateFormat.parse(time);
          java.sql.Timestamp ts2 = new java.sql.Timestamp(parsedDate.getTime());
  
          long nowTime = ts1.getTime();
          long givenTime = ts2.getTime();
  
          long timeDiff = givenTime - nowTime;
  
          //convert to string
          java.util.Date d = new java.util.Date(timeDiff);
          result = DateFormat.getTimeInstance(DateFormat.SHORT).format(d);
          //Outputs: 6:56 PM for example
  </code></pre>