You could do regular expression field validation.  That is, client-side 
(javascript), build a regular expression object that finds a match for many 
formats and run the test function on the input string.  If true, a match was 
found, and hence a legal date.  The downside is that if you have many date 
formats, your regular expression could get pretty ugly.  Here's the appropriate 
documentation for IE jscript.  
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsjsgrpregexpsyntax.asp

-----Original Message-----
From: Charles P. Killmer [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 07, 2005 1:17 PM
To: Tomcat Users List
Subject: Date parsing

I have an object with a TimeStamp member.  This will be populated by users of a 
website and entered into a database.
 
My problem is, I would like to allow the users to enter the date in a number of 
formats.  Does anyone have any recommendations aside from multiple try catch 
blocks each trying to parse the given date with a different expected format?
 
Thanks you for any help,
Charles Killmer
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to