标签:ssm ror date end ati exce public oid led
/**
* 将集合中的内容按时间排序
* @param list
*/
private static void ListSort(List<BossMsgInfo> list) {
Collections.sort(list, new Comparator<BossMsgInfo>() {
public int compare(BossMsgInfo o1, BossMsgInfo o2) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date dt1 = format.parse(o1.getSenddate());
Date dt2 = format.parse(o2.getSenddate());
if (dt1.getTime() > dt2.getTime()) {
return 1;
} else if (dt1.getTime() < dt2.getTime()) {
return -1;
} else {
return 0;
}
} catch (Exception e) {
logger.error(e, "时间排序查询异常");
e.printStackTrace();
}
return 0;
}
});
}
标签:ssm ror date end ati exce public oid led
原文地址:https://www.cnblogs.com/lirenzhujiu/p/10362340.html