IsDate VBScript function

The IsDate function will accept a date argument. If it's a valid date then the function will return True, if not it will return False.

<%
Dim theDate
theDate="04/21/2004"     'the date is American format
response.write IsDate(theDate)
%>

Below is our code in action:
True

<%
Dim theDate
theDate="25/2004"
response.write IsDate(theDate)
%>

Below is our code in action:
False



Other date and time related tutorials:
Read more on the Date, Time and Now VBScript functions
Here's a code snippet to display the day and date (eg. Mon 25 December).
Here's a code snippet to display the day and date with the ordinal suffix (eg. Mon 25th December).
How to get the current month name
Display the dates and times
Time and Date based greetings
The DateDiff DateAdd and DatePart Functions

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Get your best asp web hosting provider now and save 25%