•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,439 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,606 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 656 | Replies: 3
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi All,
I have to do a validation on date in my form. I get a string of the format "dd/mm/yyyy" in my form. now i have to check that this date should be of the past including the present week(for eg. if I add the entry on 04/09/2007 then all the values upto 08/09/2007 should be valid) . Can anyone tell me how should I do this validation?
Thanks,
Megha
I have to do a validation on date in my form. I get a string of the format "dd/mm/yyyy" in my form. now i have to check that this date should be of the past including the present week(for eg. if I add the entry on 04/09/2007 then all the values upto 08/09/2007 should be valid) . Can anyone tell me how should I do this validation?
Thanks,
Megha
there are several classes that can help you do this, for instance the 'Date' class (but I think the one I'm thinking of is for a large part deprecated)
scrolling through the api's from sun 'll propably get you quite far allready, all you need to do is figure out the right logic behind your own program.
scrolling through the api's from sun 'll propably get you quite far allready, all you need to do is figure out the right logic behind your own program.
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,628
Reputation:
Rep Power: 12
Solved Threads: 311
You can find this website helpfull http://64.18.163.122/rgagnon/howto.html.
Select Java section and go to date and Time
Select Java section and go to date and Time
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
> I have to do a validation on date in my form.
Look into the SimpleDateFormat and GregorianCalendar classes to achieve your task.
Look into the SimpleDateFormat and GregorianCalendar classes to achieve your task.
Last edited by ~s.o.s~ : Sep 5th, 2007 at 1:10 pm.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Any help with a Defult Value and Validation RULE. **MICROSOFT ACCESS** (MS Access and FileMaker Pro)
- Microsoft Access date validation Need a solution (Computer Science and Software Design)
- need date validation help (MS Access and FileMaker Pro)
- Microsoft Access date validation Need a solution (Database Design)
- Hi Access Date Problem (> Now +7 Days And < Now +2 Months) (Computer Science and Software Design)
- Microsoft Access date validation (Computer Science and Software Design)
Other Threads in the Java Forum
- Previous Thread: comparing a value to a value in a jComboBox
- Next Thread: how to run both as applet and or application



Linear Mode