title: Compare dates from string without time
body: <p>I need to compare whether a date is after another date. For example, today is 12 January 2020. First, I tried this:</p>
  
  <pre><code>SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  Date pDate = dateFormat.parse("12/01/2020");
              Date currentDate = new Date();
              if (currentDate.after(pDate)) {
                  Toast.makeText(getApplicationContext(), "after", Toast.LENGTH_LONG).show();
              }
  </code></pre>
  
  <p>Although both date are the same, I got the toast "after". Then I tried this:</p>
  
  <pre><code>Date currentDate = new Date();
          if (currentDate.after(currentDate)) {
              Toast.makeText(getApplicationContext(), "after", Toast.LENGTH_LONG).show();
          } else {
              Toast.makeText(getApplicationContext(), "same day", Toast.LENGTH_LONG).show();
          }
  </code></pre>
  
  <p>This time I got the toast "same day". Lastly I changed to date to 13/01/2020:</p>
  
  <pre><code>Date pDate = dateFormat.parse("13/01/2020");
              Date currentDate = new Date();
              if (currentDate.after(pDate)) {
                  Toast.makeText(getApplicationContext(), "after", Toast.LENGTH_LONG).show();
              } else {
                  Toast.makeText(getApplicationContext(), "before", Toast.LENGTH_LONG).show();
              }
  </code></pre>
  
  <p>And I got the toast "before". The method seems working, but why the first code returned "after" even both date are the same?</p>