Calculate time difference between current and future time
<p>I want to calculate time difference in milliseconds from current time of a day(11 am , 1 october,2012) and time at midnight for the same day (11 pm 59 m 59s , 1 october , 2012.</p>

<p>I have tried this </p>

<pre><code>    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.SECOND, 59);
    cal.add(Calendar.HOUR, 23);
    cal.add(Calendar.MINUTE, 59);
        cal.getTime().getTime() - today.getTime();
</code></pre>

<p>here today is the current date.</p>

<p>But when i print long values of cal and today , the time difference if of 86400 approx one day.</p>
