title: java Calendar get hour before the next day
body: <p>I have a date : 21/08/2013 17:05:06
  And I would like to know the number of milliseconds before 22/08/2013 00:00:00</p>
  
  <p>Is it possible to do that with Calendar object please ?
  Thanks</p>
  
  <p><strong>EDIT :</strong> </p>
  
  <p>My solution found :</p>
  
  <pre><code>Calendar cal2 = Calendar.getInstance(TimeZone.getDefault());
                  cal2.setTimeInMillis(prevCalBatt.getTimeInMillis());
                  cal2.add(Calendar.DAY_OF_MONTH,1); //add a day
                  cal2.set(Calendar.HOUR_OF_DAY, 0); //set time to midnight
                  cal2.set(Calendar.MINUTE, 0);
                  cal2.set(Calendar.SECOND, 0);
                  cal2.set(Calendar.MILLISECOND, 0);
  
                  timeBetweenBoth+=(cal2.getTimeInMillis()-prevCalBatt.getTimeInMillis());
  </code></pre>