Date Statement
- Last UpdatedJul 18, 2023
- 1 minute read
Sets the current system date.
The DateValue literal is displayed in short date format using the locale settings of your development system. To view the locale settings for your system, in Windows, select Start, Settings, Control Panel, Regional Options, Date. For example: in Australia, the short date format is represented as d/MM/yyyy.
Syntax
Date = dateVariable
dateVariable:
You must enclose a Date literal within number signs (# #), for example #31/5/1993#.
Related Functions
Example
Dim varVBAReleaseDate
varVBAReleaseDate = #01/07/2001#
Date = varVBAReleaseDate
' sets system date to VBA Release Date