Now (function)

Syntax

Now[()]

Description

Returns a Date variant representing the current date and time.

Example

This example shows how the Now function can be used as an elapsed-time counter.

Sub Main()
  t1# = Now
  MsgBox "Wait a while and click OK."
  t2# = Now
  t3# = Second(t2#) - Second(t1#)
  MsgBox "Elapsed time was: " & t3# & " seconds."
End Sub

See Also

Date, Date$ (functions); Time, Time$ (functions).

More information

N