Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Date-Time Functions – Date(), Now() and Time()

Date()

Description: 

The Date() function returns a Current system date.

Format:

Date()

Example:

Function FnDate()

   Dim dtDate

   dtDate = Date

   MsgBox "Current System Date is : " & dtDate

End Function
Date()
Date()

_________________________________________________________________________________________________
Now()

Description

The Now function returns the Systems current date and time.

Format:

Now()

Example:

Function FnNow()

    MsgBox "System's current date and time is " & Now    

End Function
Now()
Now()

_________________________________________________________________________________________________
Time()

Description

The Time function returns the Systems current time.

Format:

Time()

Example:

Function FnTime()

    MsgBox "System's time is " & Time    

End Function
Time()
Time()



Also Read:

  1. VBA-Excel : Strings Functions – Ucase
  2. VBA-Excel: String Functions – String()
  3. VBA-Excel: Date-Time Functions – Month(), Year() and MonthName()
  4. VBA-Excel: Date-Time Functions – DateDiff()
  5. VBA-Excel: String Functions – Replace()
  6. VBA-Excel: String Functions – LTrim()
  7. VBA-Excel: Select and Activate Cells - Select
  8. VBA-Excel: String Functions – Mid()