p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_codeclinic thread: Re: dates validation

Message #1 by "avivit sa" <avivit@m...> on Tue, 31 Jul 2001 13:55:57
I found out why IsDate() is returning true. See the explanation from MS
In your code example IsDate() is interpreting the first 3 digits as a year,
not a month.
Therefore, IsDate("105/11/01") and IsDate("11/01/105")  will both return

"IsDate returns True if the expression is a date or is recognizable as a
valid date; otherwise, it returns False. In Microsoft Windows, the range of
valid dates is January 1, 100 A.D. through December 31, 9999 A.D.; the
ranges vary among operating systems"


----- Original Message -----
From: "avivit sa" <avivit@m...>
To: "Code Clinic" <proasp_codeclinic@p...>
Sent: Tuesday, July 31, 2001 1:55 PM
Subject: [proasp_codeclinic] Re: dates validation

> Well, how about the following simple which is not working?
> if not isDate("105/11/01") then msgBox "wrong date"
> I DO NOT GET THE "wrong date" msg!!!
> (If I enter a wrong value in the month (but of course, above 31, as if
> it's a day and not a month) it does work, for e.g: 12/54/01)
> What's going on here? Any idea? Anyone?

  Return to Index