Hello everyone. I would like to test a field to see if it contains a valid date. The format at this time does not matter - I only want to make sure it is a valid date. Any ideas how I can code this? Thanks in advance.
I remember. here's the adjustment
Dim myDate
Dim myString : myString = Date()
Response.write cStr(myString) & "<br>"
on error resume next
myDate = cDate(myString)
if err.number <> 0 Then
response.write "data type error!<br>"
response.write err.description & "<br>"
err.clear
else
response.write "Date passed!<br>"
end if
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.