android - Compare dates using comparator in Java -


i compare date times in such way end result values have been sorted in date ascending , time descending order. how achieve in java using joda-time library?

data:

01/31 5:50 01/31 5:40 01/30 2:20 

result

01/31 5:40 01/31 5:50 01/30 2:20 

a simple treeset (assuming have distinct dates) using comparator comparing datetime.getmillis() of each date instance trick.

and better, why not use directly "out-of-the-box" comparator ;)
implement exact logic want. (ascendant, descendant, whatever)


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -