private voidtestSort(){
List cals=new ArrayList();
Calendar cal3=Calendar.getInstance();
cal3.add(Calendar.DATE,2);
cal3.set(cal3.get(Calendar.YEAR), cal3.get(Calendar.MONTH), cal3.get(Calendar.DAY_OF_MONTH),0, 0, 0);
Calendar cal4=Calendar.getInstance();
cal4.add(Calendar.DATE,2);
cal4.set(cal4.get(Calendar.YEAR), cal4.get(Calendar.MONTH), cal4.get(Calendar.DAY_OF_MONTH),0, 0, 0);
Calendar cal1=Calendar.getInstance();
cal1.add(Calendar.DATE,2);
cal1.set(cal1.get(Calendar.YEAR), cal1.get(Calendar.MONTH), cal1.get(Calendar.DAY_OF_MONTH),0, 0, 2);
Calendar cal2=Calendar.getInstance();
cal2.add(Calendar.DATE,2);
cal2.set(cal2.get(Calendar.YEAR), cal2.get(Calendar.MONTH), cal2.get(Calendar.DAY_OF_MONTH),0, 0, 0);
cals.add(cal3);
cals.add(cal4);
cals.add(cal1);
cals.add(cal2);
Calendar minTime=Collections.min(cals);
System.out.println(DateUtils.formatDate(Collections.min(cals).getTime(),"yyyy-MM-dd HH:mm:ss"));for(int i=0;i
System.out.println(DateUtils.formatDate(cals.get(i).getTime(),"yyyy-MM-dd HH:mm:ss"));
}
}/*for(int i=0;i
System.out.println(DateUtils.formatDate(cals.get(i).getTime(),"yyyy-MM-dd HH:mm:ss"));
}
Collections.sort(cals);
//排序后
for(int i=0;i
System.out.println(DateUtils.formatDate(cals.get(i).getTime(),"yyyy-MM-dd HH:mm:ss"));
}*/}