title: To check if the date is after the specified date?
body: <p>I am trying to do validation for date which should take only current and future dates,if the date is older date then it should show </p>
  
  <blockquote>
    <p>The date is older than current day</p>
  </blockquote>
  
  <p>I want to allow the current date also.Right now while giving current day as gievnDate,its always showing </p>
  
  <blockquote>
    <p>The date is older than current day</p>
  </blockquote>
  
  <p>But I am expecting an output as </p>
  
  <blockquote>
    <p>The date is future day
     for givenDate as today.</p>
  </blockquote>
  
  <p>Below is the code which I have been trying:</p>
  
  <pre><code>    Date current = new Date();
      String myFormatString = "dd/MM/yy";
      SimpleDateFormat df = new SimpleDateFormat(myFormatString);
      Date givenDate = df.parse("15/02/13");
      Long l = givenDate.getTime();
      //create date object
      Date next = new Date(l);
      //compare both dates
      if(next.after(current) || (next.equals(current))){
          System.out.println("The date is future day");
      } else {
  
          System.out.println("The date is older than current day");
      }
  </code></pre>
  
  <p>Here when I am checking with 15/02/13,its showing as older than current day.Is my method wrong?or Is there any better approaches?</p>