TIMEVALUE function

Microsoft Office ShapeSheet

TIMEVALUE function

See also

Returns the time value represented by datetime or expression.

Syntax

TIMEVALUE("datetime"|expression[,lcid])

datetime

Any string commonly recognized as a date and time or a reference to a cell containing a date and time.

expression

Any expression that yields a date and time.

lcid

Optional argument. The locale identifier to be used in evaluating a nonlocal datetime. The locale identifier is a number described in the system header files.

Remarks

Any date component in datetime or expression is discarded.

If datetime is missing or cannot be converted to a valid result, this function returns a #VALUE! error.

The TIMEVALUE function also accepts a single number value for expression where the decimal portion of the result represents the fraction of a day since midnight.

Example 1

TIMEVALUE("6:00 AM")

Returns the value representing 6:00 AM.

Example 2

TIMEVALUE("14:30")+4 eh.+30 em.

Returns the value representing 7:00:00 PM.

Example 3

TIMEVALUE("11 AM, July 1, 1997")

Returns the value representing 11:00 AM.

Example 4

TIMEVALUE(0.6337)

Returns the value representing 3:12:32 PM.

Example 5

TIMEVALUE("7:89")

Returns a #VALUE! error.