Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

IsTime not available in VB

IsDate determines if the date entered is a valid date, but there's not such thing for time. IsDate is available in VB but IsTime is not. why? could anyone develop this. seems so challenging though.
[202 byte] By [drchanix] at [2007-11-11 7:55:09]
# 1 Re: IsTime not available in VB
IsDate works with times, too:

Dim sTime As String
sTime = "12:19 AM"
Debug.Print IsDate(sTime)
' Prints True

sTime = "12:62 AM"
Debug.Print IsDate(sTime)
' Prints False
Phil Weber at 2007-11-11 17:26:19 >
# 2 Re: IsTime not available in VB
thanks for the help, but my problem is determining whether the entered time in a maskedbox is a valid time or not. the syntax is this:

If maskedbox = "__:__" Then MessageError: maskedbox.SetFocus: Exit Sub

this only traps if there is no time entered, but if the entered time is invalid, like 03:61, it won't trap and generates an error/debug.
drchanix at 2007-11-11 17:27:21 >