CDate
The CDate function will convert an ASP variant value to a date
value if possible. If it is not possible, then the script engine will
throw a runtime error.
If you wish to trap the error that occurs when converting an invalid
variable, you can do so with the code shown below:
Dim sValue Dim dValue
sValue ="12/30/02" On Error Resume Next dValue = CDate(sValue) If Err.Number <> 0 Then Response.Write "An Error occurred converting to date: " & sValue End If
Dates usually take the following forms:
11/03/2002 11-03-2002 11/03/2002 15:32:00 11-03-2002 14:59:59 Jan 3, 2002 2:32pm
|
 |

|