TimeValue()

Syntax

TimeValue(TimeText$)

Remarks

Returns the serial number of the time represented by TimeText$. Use TimeValue() to convert a time represented by text to a serial number. A serial number is a decimal representation of the date, time, or both. For information about serial numbers, see DateSerial().

Argument

Explanation

TimeText$

A string representing the time. For example, the following are each valid representations of 4:30 p.m.:

16:30:00

4:30 pm

4:30 PM

TimeText$ must represent a time between 00:00:00 and 23:59:59 on the 24-hour clock. TimeValue() generates an error if TimeText$ is out of this range.


Example

This example displays the serial number for the current time in the status bar:


Print TimeValue(Time$())

See Also

DateSerial(), DateValue(), Day(), Month(), Now(), Time$(), TimeSerial(), Today(), Year()