Visual Basic for Applications Reference

Date Statement Example

This example uses the Date statement to set the computer system date. In the development environment, the date literal is displayed in short date format using the locale settings of your code.

  Dim MyDate
MyDate = #February 12, 1985#   ' Assign a date.
Date = MyDate   ' Change system date.