title: date comparison in java for date of birth
body: <p>I have a date in <code>String</code> format as <code>String dob="02/26/2013";</code> which is in the format "mm/dd/yyy". Its a date of birth and I want to check that this dob should be less than today's date. How to check that?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    Calendar cal = Calendar.getInstance();
      Date date = cal.getTime();
      SimpleDateFormat format1 = new SimpleDateFormat("MM-dd-yyyy");
      String date1 = format1.format(date);
      System.out.println(date1);
      String date2 = "2013/02/26";
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/mm/dd");
      Date convertedDate = dateFormat.parse(date2);
      System.out.println(convertedDate);
  </code></pre>
  
  <p>but <code>convertedDate</code> is printing as <code>Sat Jan 26 00:02:00 IST 2013</code></p>