private static void ListSort(List<AppClassInfoVo> list) {
Collections.sort(list, new Comparator<AppClassInfoVo>() {
@Override
public int compare(AppClassInfoVo n1, AppClassInfoVo n2) {
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date dt1 = format.parse(n1.getCreatedate()+"");
Date dt2 = format.parse(n2.getCreatedate()+"");
if (dt1.getTime() > dt2.getTime()) {
return 1;
} else if (dt1.getTime() < dt2.getTime()) {
return -1;
} else {
return 0;
}
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
});
}

相关文章:

  • 2021-08-13
  • 2021-11-04
  • 2021-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-12-29
  • 2021-11-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案