fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.text.*;
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. String urlCheckDate ="2015-11-25";
  12.  
  13. String dateZipBd = "2015-11-25";
  14. Calendar c = Calendar.getInstance();
  15. SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
  16. Date date = format.parse(dateZipBd);
  17. Date date2 = format.parse(urlCheckDate);
  18.  
  19. System.out.println(format.parse(urlCheckDate).after(format.parse(dateZipBd))); // false correct
  20.  
  21. if(date2.after(date)) {
  22. System.out.println("True!"); // Never gets printed.
  23. }
  24. }
  25. }
Success #stdin #stdout 0.15s 321280KB
stdin
Standard input is empty
stdout
false