ShipmentDetail temp = new ShipmentDetail(); Date d1; Date d2; for (int i = 0; i < sds.size(); i++) { for (int j = i+1; j < sds.size(); j++) { ParsePosition pos1 = new ParsePosition(0); ParsePosition pos2 = new ParsePosition(0); if (null != sds.get(i).getCreatedAt() && null != sds.get(j).getCreatedAt()){ d1 = sds.get(i).getCreatedAt(); d2 = sds.get(j).getCreatedAt(); if (d1.before(d2)){ temp = sds.get(i); sds.set(i,sds.get(j)); sds.set(j,temp); } } } }
List内时间排序
最新推荐文章于 2023-07-03 16:29:22 发布