- Compare Current Date With Another Date In Jsp Login
- Compare Current Date With Another Date In Jsp File
- Compare Current Date With Another Date In Jsp Connect
- Compare Current Date With Another Date In Jsp Form
Current Date: Thu Aug 24 22:21:30 WITA 2017 Day: 24 Month: 8 Year: 2017 Day of Week: 5 Day of Month: 24 Day of Year: 236 You might also want to try to use the Joda Time library for this. Here another example for getting information about date and time using Joda: How do I get date / time fields of date in Joda?. Compare Date In JSP. August 30, 2014, 3:30am #1. Hi guys, can I know how to compare dates in JSP? August 30, 2014, 10:15am #2. Date d1 = new Date.
- Java.util Package Classes
- Java.util Package Extras
- Java.util Useful Resources
- Selected Reading
Description
The java.util.Date.compareTo(Date anotherDate) method compares two Dates.
Declaration
Following is the declaration for java.util.Date.compareTo() method
Parameters
Compare Current Date With Another Date In Jsp Login
anotherDate − date to be compared to
Return Value
0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.
Exception
NullPointerException − if anotherDate is null.
Compare Current Date With Another Date In Jsp File
Example
Compare Current Date With Another Date In Jsp Connect
The following example shows the usage of java.util.Date.compareTo() method.
Let us compile and run the above program, this will produce the following result −
Compare Current Date With Another Date In Jsp Form
java_util_date.htm