Now Function

See Also328OGX5              Example103H782>Low

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 Variant8PHEAW3 of VarType7A68ZTZ 7 (Date) containing a date and time that are stored internally as a double-precision number.  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.

 


See Also

Date, Date$ Functions3E3X9E

Date, Date$ Statements3E3X9R

Day FunctionLANDAY

Hour FunctionGU67IG

Minute Function5OWKHCJ

Month Function3NARHG

Second FunctionC46EYJ

Time, Time$ FunctionsQ3GPPU

Time, Time$ StatementsQ3GPQ7

Weekday FunctionM393JM

Year FunctionGUFX5G


Now Function Example

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