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.


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.

Response.Write my_date & " = " & IsDate(my_date)

Here IsDate function will return True. If we change the variable my_date like this.


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

Be the first to post comment on this article :


Post Comment This is for short comments only. Use the forum for more discussions.

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2015 All rights reserved worldwide Privacy Policy Disclaimer