title: Calculating Time difference between two Time class of different date
body: <p>Everyone</p>
  
  <p>This question is common and I searched the forum but none of the solution seems to be working.</p>
  
  <p>My database(MySql) Framework(Hibernate) return me a Time Object and I want to get the difference in time between the Time Object and the System current time.</p>
  
  <p>This is my code:</p>
  
  <pre><code>Time time=a.getTime();
  System.out.println(time);
  Time currentTime=new Time((new Date()).getTime());
  System.out.println(currentTime);
  long diff=time.getTime()-currentTime.getTime();
  System.out.println(diff);
  executor.schedule(caller,diff,TimeUnit.MILLISECONDS);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>03:51:46
  03:25:12
  -1372548806938
  </code></pre>
  
  <p>Expected Output</p>
  
  <pre><code>03:51:46
  03:25:12
  1594000
  </code></pre>
  
  <p>I guess this is because the date in which time object created are different.
  How can I get the expected output.</p>
  
  <p>Note:As I have already constructed the database I dont want to change the return type of Object a i.e Object a will return Time.</p>