PDA

View Full Version : HELP: how to validate mm/dd/yyyy dates using regul


sunit
10-16-2000, 05:44 PM
There are many examples of validation phone numbers and zip codes using VBScript regular expressions. But can anyone show how to validate a US style date mm/dd/yyyy using regular expressions in VBScript?

Duncan King
10-17-2000, 11:53 AM
Regular expressions aren't really suited to date validation - it's too procedural, rather than pattern based. RegExps are great when you want to match a pattern (say, some alphanumeric characters, followed by an @, followed by more alphanums, followed by a dot, followed by more alphanums) but no good when you need arithmetic/mathematical checking, which is what you need to validate a date.<BR><BR>Dunc

pavel
10-24-2000, 02:58 PM
just one little line in ASP code for mm/dd/yyyy format<BR><%Session.LCID=7178%>

mark
10-25-2000, 01:51 PM
I have the same question.<BR>But what are we supposed to do with line of code?

Duncan King
10-27-2000, 02:28 PM
It sets ASP to use the mm/dd/yyyy date format, but it doesn't validate anything.<BR><BR>Dunc

sdkjambo
11-24-2000, 12:24 PM
Is there a list of the lcid codes anywhere - tried msdn but on joy?

VB_Man
05-30-2001, 07:36 PM
If you are using VB Script, just use the IsDate function. It does check for mm/dd/yyyy format.