ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> ASP Articles -> Validate Date in ASP with IsDate() Function

Validate Date in ASP with IsDate() Function

The IsDate VBScript function offers an easy way to validate a date in your server-side ASP code. As you might have expected the IsDate VBScript function takes only one parameter – date or string that represents any valid date/time format. The IsDate function returns a Boolean value (True or False) indicating whether an expression is a valid date or can be converted to a valid date. To illustrate the usage of IsDate function let’s have a look at the following code examples:

<%

Response.Write IsDate("January 13, 2003") ' Prints True
Response.Write IsDate(#1/13/03#) ' Prints True
Response.Write IsDate("This is not a date") ' Prints False
Response.Write IsDate("10:55") ' Prints True

%>




Contact Us