title: how to check if update date is greater then current date in android studio java
body: <p>I want to change the background drawable of a specific table row based on their status compared to their updated date/time with the current time and check if it has been 24h since last update date/time and set a different background drawable.</p>
  <p>What I got so far works but I can't figure out how to check if its been 24h and not just greater then the current time</p>
  <pre><code>   JobRepository jobRepository = new JobRepository(a.getApplication());
          jobRepository.findEnquiry().observe(getViewLifecycleOwner(), jobsEnquiry -&gt; {
          TableRow[] tableRows = new TableRow[jobsEnquiry.size()];
  
          for (int i=0; i&lt;jobsEnquiry.size(); i++) {
              Job job = jobsEnquiry.get(i).job;
              tableRows[i] = new TableRow(a);
              tableRows[i].setId(i + 1);
              tableRows[i].setPadding(0,20,0,20);
              if(job.getStatus().equals(&quot;Left message/Awaiting reply&quot;)){
                  SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyy-MM-dd H:m:s&quot;);
                  Date updatedDate = job.getUpdatedAt();
                  Date date = job.getDate();
                  Date currentTime = Calendar.getInstance().getTime();
                  tableRows[i].setBackgroundResource(android.R.drawable.list_selector_background);
                  tableRows[i].setBackgroundResource(R.drawable.table_outline);
  
                  if (updatedDate.getTime() &lt; currentTime.getTime()){
                      tableRows[i].setBackgroundResource(android.R.drawable.list_selector_background);
                      tableRows[i].setBackgroundResource(R.drawable.table_outline_status);
                  }
  
              }
              else if(job.getStatus().equals(&quot;Action required&quot;)){
                  tableRows[i].setBackgroundResource(android.R.drawable.list_selector_background);
                  tableRows[i].setBackgroundResource(R.drawable.table_outline_status);
              }
  </code></pre>