troubleshooting Question

how to get today value"

Avatar of Jeevanjosh
Jeevanjosh asked on
JavaWeb Development Software
11 Comments1 Solution276 ViewsLast Modified:
Hi
 ia have the  table room_booking and the value is stored in the string formate("dd/mm/yyyy e.g 04/07/2008")

i want to retrive the value  wich is equal to today can you pls help in solving the problem

i have the  compareResult1 method



  public static int getCompareResult1(String date) throws ParseException{            
        DateFormat df = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
                     df.setLenient ( false );
        
        Date d1 = df.parse(date);
        Date today = new Date();
               int relation;
        if (d1.equals(today))
             relation = 0;
        else if(d1.before(today))
            relation = -1;
        else
         relation = 1;
        return relation;
        }      
            
}

when i call this in my jsp
ASKER CERTIFIED SOLUTION
mikeblamires

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros