title: How to compare current date and last modified date in Android?
body: <p>I want to compare the two dates. If exceeds more then 24 hrs then I want to do some action. </p>
  
  <p>I am getting file's last modified date using this piece of code:</p>
  
  <pre><code> Date lastModDate = new Date(filename.lastModified());
   Log.d("Date", "File last modified @ : " + lastModDate.toString());
  </code></pre>
  
  <p>It is coming in the given below format: </p>
  
  <pre><code>Mon Aug 17 11:07:02
  </code></pre>
  
  <p>So my question is, in which format I need to get the current date and how to compare with difference in hours?</p>