title: How to use the current time in app to made an action (delete data from the data base) according to current time
body: <p>I want to delete information from the app at six in the morning every day.
  I could not do this in Android Studio and I would be happy if someone could help me.</p>
  
  <p>my code below-</p>
  
  <pre><code>Calendar calendar = Calendar.getInstance();
         @SuppressLint("SimpleDateFormat") SimpleDateFormat format = new 
            SimpleDateFormat("HH:mm");
          String time = format.format(calendar.getTime());
         if (time.equals("06:00")) {
             mydb.deleteAllNames();
              mydb.deleteAllTasks();
          }
  </code></pre>