fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.text.*;
  4. import java.util.*;
  5.  
  6. class Main{
  7. static void c(String... a) throws Exception{
  8. DateFormat f = new SimpleDateFormat("dd-MM-yyyy");
  9. Calendar s = Calendar.getInstance(),
  10. e = Calendar.getInstance();
  11. s.setTime(f.parse(a[0]));
  12. e.setTime(f.parse(a[1]));
  13. for(Date d = s.getTime(); s.before(e); s.add(Calendar.DATE, 1), d = s.getTime()){
  14. String o = f.format(d),
  15. x = o.replaceAll("\\W|_", ""),
  16. w = "";
  17. for(char c : x.toCharArray()){
  18. w = c + w;
  19. }
  20. if(x.equals(w)){
  21. System.out.println(o);
  22. }
  23. }
  24. }
  25.  
  26. public static void main(String[] a){
  27. try{
  28. c("05-02-2050", "12-12-2060");
  29. } catch (Exception e){}
  30. }
  31. }
Success #stdin #stdout 0.34s 321728KB
stdin
Standard input is empty
stdout
05-02-2050
15-02-2051
25-02-2052
06-02-2060