Determine if a String is a Valid Time
Version Compatibility: Visual Basic 6
- This version relies on the IsDate function. Therefore, it will accept a value such as "13:33 PM" as a valid time. The other version is more stringent and would reject "13:33 PM" as valid (though it would accept "1:33 PM").
- Because this version relies on the IsDate function, it takes into account international settings, whereas the other version is designed as a stringent check of values on systems in which time values conform to the default American English Regional settings.
Both versions have their use, depending on the situation, so you should choose the one you need.
Instructions: Copy the declarations and code below and paste directly into your VB project.