VBScript » Functions » TimeValue

Syntax:
TimeValue(String)

The TimeValue function converts an argument into the variant of subtype Date.

The String argument must be a string in valid date format or you will get an error message.

Examples

Code:
<% mystring = "2:23:17 PM" %>
<% =TimeValue(mystring) %>
Output:
2:23:17 PM
Language(s): VBScript
Code:
<% =TimeValue("14:23") %>
Output:
2:23:00 PM
Language(s): VBScript

See Also: