title: Calculate date difference in days in Android
body: <p>I want to calculate the difference between two dates in days.</p>
  
  <p>I have something like:</p>
  
  <pre><code>String deadline = "2015-08-15";
  </code></pre>
  
  <p>and I get the current date in:</p>
  
  <pre><code>String timeStamp = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());
  </code></pre>
  
  <p>For example it would be for today:</p>
  
  <blockquote>
    <p>2015-11-11</p>
  </blockquote>
  
  <p>How can I calculate the days between these two dates? And what happens if the date is past.</p>