[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

how to get orderby date list?

Asked by Jeevanjosh in JDeveloper

I am getting a set values from the table by using the jsp and the Util.java
how can i get the values  orderby date ? kindly help in solving the problem
 thank you ,

attached my jsp, Util.java and the output

kindly help in solving this problem

thank you

regards
Joshline

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
My Util.java
 
 
public static int getCompareResult2(String date) throws ParseException {      
			DateFormat df = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
			df.setLenient ( false );
           
			DateFormat df1 = new SimpleDateFormat("EEE MMM dd kk:mm:ss zzz yyy", Locale.getDefault());
			df1.setLenient ( false );      
			  
			Date d1= df.parse(date);
			Date now = df1.parse(new Date().toString());
        		
			Calendar today = Calendar.getInstance(Locale.getDefault());
			today.setTime(now);
			Calendar compare = Calendar.getInstance(Locale.getDefault());
			compare.setTime(d1);
        
			compare.set(Calendar.HOUR_OF_DAY, 0);
			compare.set(Calendar.MINUTE, 0);
			compare.set(Calendar.SECOND, 0);
			compare.set(Calendar.MILLISECOND, 0);
        
			today.set(Calendar.HOUR_OF_DAY, 0);
			today.set(Calendar.MINUTE, 0);
			today.set(Calendar.SECOND, 0);
			today.set(Calendar.MILLISECOND, 0);
                    
			if (today.equals(compare)) {
				return 0;
			} else if(today.before(compare)) {
				return -1;
			} else {
				return 1;
			} 
			
			
	}
Attachments:
 
output
 
 
 
 
Related Solutions
Keywords: how to get orderby date list?
 
Loading Advertisement...
 
[+][-]05/05/08 01:10 PM, ID: 21502607Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/05/08 06:52 PM, ID: 21504273Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/05/08 08:33 PM, ID: 21504587Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/06/08 12:45 AM, ID: 21505424Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628