Time Function

Description

Returns a Variant (Date) indicating the current system time.

Syntax

Time

Remarks

To set the system time, use the Time statement.

See Also

Date function, Date statement, Time statement, Timer function.

Specifics (Microsoft Access)

You can insert the current time on a form or report by clicking Date And Time on the Insert menu. This command creates a text box on a form or report and sets the ControlSource property of the text box to an expression containing the Time function. This expression will vary according to the format you have chosen to display the time. This command is available only in form Design view and report Design view.

You can also use the Time function in a query expression or in a macro. However, you must include the parentheses after the function when you use it anywhere other than in a Visual Basic module, as in the expression Time().

Example

This example uses the Time function to return the current system time.

Dim MyTime
MyTime = Time                            ' Return current system time.
Example (Microsoft Access)

You can use the Time function in a calculated control to return the current system time. For example, you can create a text box and set its ControlSource property to the following expression.

=Time()