If you have special sorting requirements, you can do this by providing your own Comparator . For instance:
//your List ArrayList<Date> d = new ArrayList<Date>(); //Sorting Collections.sort(d, new Comparator<Date>() { @Override public int compare(Date lhs, Date rhs) { if (lhs.getTime() < rhs.getTime()) return -1; else if (lhs.getTime() == rhs.getTime()) return 0; else return 1; } });
The key element is converting your Date object to milliseconds (using getTime() ) for comparison.
source share