User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Sep 2007
Posts: 1
Reputation: Megha_Patni is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Megha_Patni Megha_Patni is offline Offline
Newbie Poster

Date Validation

  #1  
Sep 4th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 432
Reputation: stultuske will become famous soon enough stultuske will become famous soon enough 
Rep Power: 3
Solved Threads: 45
stultuske's Avatar
stultuske stultuske is offline Offline
Posting Pro in Training

Re: Date Validation

  #2  
Sep 4th, 2007
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.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,628
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 12
Solved Threads: 311
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Date Validation

  #3  
Sep 4th, 2007
You can find this website helpfull http://64.18.163.122/rgagnon/howto.html.
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
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,012
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Date Validation

  #4  
Sep 5th, 2007
> I have to do a validation on date in my form.
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 1:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC