title: Find total hours between two Dates
body: <p>I have two Date objects and I need to get the time difference so I can determine the total hours between them. They happen to be from the same day. The result I would like would have the hours and minutes.</p>
  <p>When I use .toString() on my Date object I get this: Fri Dec 18 08:08:10 CST 2009</p>
  <p>I've tried the following:</p>
  <pre><code>long diff = (this.endDate.getTime() - this.startDate.getTime()) / (60 * 60 * 1000);
  </code></pre>
  <p>But this only gives me hours, not the minutes.
  I know this is a simple problem, but I can't figure it out atm.</p>
  <p>Edits:
  Final solution for those interested. Thanks to Michael Brewer-Davis</p>
  <pre><code>Period p = new Period(this.startDate, this.endDate);
  long hours = p.getHours();
  long minutes = p.getMinutes();
      
  String format = String.format(&quot;%%0%dd&quot;, 2);
      
  return Long.toString(hours) + &quot;:&quot; + String.format(format, minutes);
  </code></pre>