File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes sorting by date and time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "sorting by date and time" Watch "sorting by date and time" New topic
Author

sorting by date and time

Ram Sudheer Mandava
Greenhorn

Joined: Aug 04, 2010
Posts: 22
hi all,

I am getting the data as follows and i want it to be sorted in descending order by year wise, month wise , day wise and then time wise:

INPUT

2013-02-07 09:02:00.0
2013-03-28 10:54:00.0
2012-26-15 10:54:00.0
2012-26-15 09:12:00.0
2013-02-20 08:12:00.0

OUTPUT SHOULD BE AS:

2012-26-15 09:12:00.0
2012-26-15 10:54:00.0
2013-02-07 09:02:00.0
2013-02-20 08:12:00.0
2013-03-28 10:54:00.0

Anyone please tell me how to do this in java
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60812
    
  65

Where's your code? What have you done so far?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ram Sudheer Mandava
Greenhorn

Joined: Aug 04, 2010
Posts: 22
i am just using Collections.sort(). but it is not working. Is there any other way?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60812
    
  65

Show your code and explain what you mean by "not working".
 
 
subject: sorting by date and time
 
Similar Threads
Linking and organizing combo boxes
populate int[][]
need 2 rows rather than 5 from this query
Problem moving columns and rows in 2D array.
Report Query