title: How to check if the device time is equal to the time stored in FirebaseDatabase?
body: <p>I'm storing the time at which user is posting something and giving him options to choose a time at which that post will get deleted and then storing this time too in FirebaseDatabase.</p>
  
  <p>The problem is that I'm unable to check that whether the time of the device is equal to the stored time in Firebase so that I can delete it from the database.</p>
  
  <p>I'm storing the time at which the content should get deleted in Firebase in this format: <code>04:30 PM</code> and getting it using this code:</p>
  
  <pre><code>public void showTime(int hour, int min) {
          if (hour == 0) {
              hour += 12;
              format = "AM";
          } else if (hour == 12) {
              format = "PM";
          } else if (hour &gt; 12) {
              hour -= 12;
              format = "PM";
          } else {
              format = "AM";
          }
  
          chooseDuration.setText(new StringBuilder().append(hour).append(":").append(min)
                  .append(" ").append(format));
  
      }
  </code></pre>
  
  <p>I'm successfully fetching it from database, but the problem is that I'm unable to create a algorithm which checks that if device time and the time retrieved from database is equal, that content should get deleted.</p>
  
  <p>Please help me with this.</p>