Share via


Time Function

This page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010.

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

Syntax

Time

Remarks

To set the system time, use the Time statement.

Example

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

Dim MyTime
MyTime = Time    ' Return current system time.