Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sorting by date and time  RSS feed

 
Ram Sudheer Mandava
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's your code? What have you done so far?
 
Ram Sudheer Mandava
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am just using Collections.sort(). but it is not working. Is there any other way?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show your code and explain what you mean by "not working".
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!