Advertisement

05.05.2008 at 12:51AM PDT, ID: 23375876 | Points: 500
[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

Start Free Trial
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
 
 
 
[+][-]05.05.2008 at 01:10PM PDT, ID: 21502607

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:52PM PDT, ID: 21504273

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 08:33PM PDT, ID: 21504587

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 12:45AM PDT, ID: 21505424

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628