By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,797 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,797 IT Pros & Developers. It's quick & easy.

HELP: how do i compare a string and a date in JSP

P: n/a
I am getting a string in dd/mm/yy (date format) from a textfield
from the user.

I want to check whether this string is < a date which I'm getting from
an MS Access DB (this date is stored in Date/Time format in the
database).

Any ideas how to go about doing this in JSP?

Thanks in advance.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 6 Nov 2003 20:55:51 -0800, sk***@yahoo.com (Sk590) wrote:
I am getting a string in dd/mm/yy (date format) from a textfield
from the user.

I want to check whether this string is < a date which I'm getting from
an MS Access DB (this date is stored in Date/Time format in the
database).

Any ideas how to go about doing this in JSP?

Thanks in advance.


You know you can write any java code in JSP if you want...

So, what I'd do is this:

1. Use create a GregorianCalendar from your string using
SimpleDateFormat class (look up use in API docs).

2. Retrieve date from MS Access DB, and conver it to
GregorianCalendar.

3. use Calendar's compareTo function.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.