See Also Example
Returns a date that represents the current date and time according to the setting of the computer's system date and time.
Syntax
Now
Remarks
The Now function returns a Variant This number represents a date and time from January 1, 100 through December 31, 9999, where January 1, 1900 is 2. Numbers to the left of the decimal point represent the date; numbers to the right represent the time.
Note When displayed directly, the Now function's return value is displayed as a string using the short date and time formats set in the Microsoft Windows Control Panel.
Date, Date$ Functions
Date, Date$ Statements
Day Function
Hour Function
Minute Function
Month Function
Second Function
Time, Time$ Functions
Time, Time$ Statements
Weekday Function
Year Function
In this example, the Now function returns the current date as a Variant of VarType 7 (Date) containing a date. The Format function formats the date as a long date including the day and date. To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.
Sub Form_Click ()
Dim Today ' Declare variable.
Today = Now ' Get current date and time.
MsgBox "Today is " & Format(Today, "dddd, mmmm dd, yyyy") & "."
End Sub