how do i compare dates in JSP

how do i compare dates in JSP

Post by Fredrik Li » Sat, 08 Nov 2003 19:59:45


Hi!


Use the java.text.DateFormat class to format the date String into a
java.util.Date class. Assuming that the database date is retrieved via JDBC
as a java.sql.Date object (whixh extends the java.util.Date class) you
compare those two date objects.

/Fredrik
 
 
 

1. My I's are coming up i's. (lower case)

2. Comparing Dates Time - User Input Date Time Compared To Now !

Hi

I am using the three controls, Calendar, datetext, timelist and
creating a date after concatenating them and then comparing to the
Current date/time.

User enters the information and then this is done

If Format(datetext & " " & timelist, "mm/dd/yyyy hh:mm") < Format(Now,
"mm/dd/yyyy hh:mm") Then
Msgbox "Earlier Date"
Else
Msgbox "Later Date"
End If

It was working fine till the dates were to be entered for 2007.
So I am selecting a date in 2007, I get earlier date in the above
expression.

How can I fix that?

Any ideas will be appreciated.

Regards
Lovely

3. Comparing two dates -- What am I doing wrong?

4. Doing an update and comparing date

5. is there a dos command that works like xcopy but compares file sizesor last modified dates?

6. Comparing dates of two files in DOS batch (Windows 2000)

7. is there a dos command that works like xcopy but compares filesizesor last modified dates?

8. [JSP] difference between jsp:forward and jsp:include

9. Compare Validator not comparing date

10. Compare ins and cab file

11. Compare a field date with computer current date

12. compare date field in 1 table to start & end date fields in 2nd ta

13. Compare Date in Table to Date Entered in Form

14. how to compare current date to a future date and validate it in ASP.NET

15. date in database compare with the current date