Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

VBScript TimeValue Function

Returns a Variant of subtype Date containing the time.

Syntax: VBScript TimeValue Function

TimeValue(time)

Arguments: VBScript TimeValue Function

time

Usually a string expression representing a time from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive. However, time can also be any expression that represents a time in that range. If time contains Null, Null is returned.

Remarks: VBScript TimeValue Function

You can enter valid times using a 12-hour or 24-hour clock. For example, "2:24PM" and "14:24" are both valid time arguments.

If the time argument contains date information, TimeValue doesn't return the date information. However, if time includes invalid date information, an error occurs.

The following example uses the TimeValue function to convert a string to a time. You can also use date literals to directly assign a time to a Variant (for example, MyTime = #4:35:17 PM#).

Dim MyTime

MyTime = TimeValue("4:35:17 PM")   ' MyTime contains 4:35:17 PM.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.