In article <ut**************@TK2MSFTNGP14.phx.gbl>, Peter Smith wrote:
IsDate("01/01") in Vb.Net is returning TRUE. Is it a bug in the function?
What is the other way of checking the same functionality? Is there any other
know issue with the date function.
.Net 1.1 Framework.
I know alternative way of checking the same "If TypeOf MyVariable Is
DateTime Then"
Thanks,
Smith
As Armin suggests, this is not a bug. Most likely, though I haven't
really bothered to check, the IsDate function most is a wrapper
for the DateTime.Parse function. And, if you read the remarks on this
function in the documentation, I would expect this behavior.
Basically, it says that the DateTime.Parse function uses the information
in the DateTimeFormatInfo for the current culture. As it parses, it
will FILL in any missing values (month, day, year) with the
values from the current date... Meaning that, the DateTime.Parse will
turn your string:
"01/01" into a date of "01/01/05". And that, is a valid date.
--
Tom Shelton [MVP]