Function IsDate to check valid date or date variable

We can check (or validate) the date variable or a date by using IsDate() function. User entered date values in a form are to be checked for correct date or not before further processing. This function takes one input and gives output as TRUE or FALSE based on the input. A valid date or date variable will return TRUE or it will return FALSE. Here is the syntax of IsDate() function.
IsDate(my_date)
Here my_date is a date variable or a date itself. Out put of IsDate function is either True or False. Here is the complete code of IsDate() function.
my_date="02/28/2007"
Response.Write  my_date & " = " & IsDate(my_date)
Here IsDate function will return True. If we change the variable my_date like this.
My_date="02/29/2007"
Then the output of IsDate() function will be false.

IsDate function is useful where user entered date value is to be checked for a valid date for further processing. Whatever date entered by the user through a form can also be checked by using this function.

In PHP date checking can be done by using checkdate() function
ASP Home

plus2net.com





We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer