title: How to find day difference between 2 timestamp in java
body: <p>I want to calculate how many day difference between 2 timestamps, but i do not want to consider the time difference.</p>
  
  <p>For example :</p>
  
  <pre><code>long time1 = 1546258765000  (Mon 31 December 2018 13:19:25)
  long time2 = 1546005915367 (Fri 28 December 2018 15:05:15)
  </code></pre>
  
  <p>The result should be 3, 3 days left for expire... 
  Due to time I get 2 from this method:</p>
  
  <pre><code>TimeUnit.DAYS.convert(time1 - time2 , TimeUnit.MILLISECONDS))
  </code></pre>
  
  <p>I just need to set the time same for both time1 and time2, and then go back to timestamp and calculate like this... but I am not sure what is the best way to do it. </p>