Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-30-2006, 11:43 PM   #1
LQ Newbie
Registered: Jan 2006
Posts: 27

Rep: Reputation: 15
Question Date Validation in java using Patterns

can anybody provide me with the code to validate date in java using patterns....
i need it urgently...

The pattern i hav used is as follows


Waithing for the reply
Old 07-31-2006, 04:09 AM   #2
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
your code works for me at least ...

probably its better for you to tell them whats the problem you encountered ...

//btw ... thanks for leading me towards the possibilities of using Pattern.matches ^_^


Last edited by alred; 07-31-2006 at 04:11 AM.
Old 07-31-2006, 07:19 AM   #3
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
I know this isn't answering the question that was asked, but bear in mind that formatting dates as numeric dd/mm/yyyy or mm/dd/yyyy leaves you wide open to the possibility of people entering dates the wrong way round, especially if your program is going to be used around the world.

Depending on how important the dates are in your program, I personally would use a foolproof input method such as select lists or a clickable calendar, to avoid that sort of problem.

Sorry if that completely misses the point, or is something you're already aware of, but I thought it was worth saying. (even if it doesn't help you, it might help someone else reading this thread)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
java date and time manipulation? trscookie Programming 1 07-13-2006 06:51 PM
simple date validation in PHP tooparam Programming 1 04-08-2006 01:50 PM
Getting Day of Week - Java - SQL Date MRMadhav Programming 4 04-03-2006 12:01 PM
Remembering patterns and printing only those patterns using sed bernie82 Programming 5 05-26-2005 05:18 PM
JavaScript inside a CGI for date validation....doesn't work!! vous Programming 3 08-27-2003 04:49 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration