List list = new ArrayList(); SearchTotalWorkfile swt = new SearchTotalWorkfile(); swt.setFiletime( " 2008-03-08 " ); swt.setFiles( new Long( 1 )); swt.setCustomers( new Long( 109 )); list.add(swt); swt = new SearchTotalWorkfile(); swt.setFiletime( " 2008-02-04 " ); swt.setFiles( new Long( 4 )); swt.setCustomers( new Long( 96 )); list.add(swt); swt = new SearchTotalWorkfile(); swt.setFiletime( " 2008-03-06 " ); swt.setFiles( new Long( 4 )); swt.setCustomers( new Long( 96 )); list.add(swt); swt = new SearchTotalWorkfile(); swt.setFiletime( " 2008-03-07 " ); swt.setFiles( new Long( 8 )); swt.setCustomers( new Long( 217 )); list.add(swt); Collections.sort(list, new Comparator() ... { public int compare(Object o1, Object o2) ...{ int i = 0; try ...{ Date l1 = DateUtils.parseDate(((SearchTotalWorkfile) o1).getFiletime(), new String[]...{"yyyy-MM-dd"}); Date l2 = DateUtils.parseDate(((SearchTotalWorkfile) o2).getFiletime(), new String[]...{"yyyy-MM-dd"}); String s1= ((SearchTotalWorkfile) o1).getFiletime(); String s2= ((SearchTotalWorkfile) o2).getFiletime(); i = s2.compareTo(s1); } catch (Exception e) ...{ } return i; } } ); log.debug(list);