Formatting Date Values
- Last UpdatedJul 18, 2023
- 1 minute read
Date values in VBA can be formatted and displayed as strings containing any combination of the following lists of values, all of which are case-sensitive.
Most VBA date and time functions are locale-aware and recognize the order for day, month, and year according to the short date format in the Regional Settings section of Windows Control Panel.
Note: Always use long date format whenever possible. Also, please ensure that you enter and display dates in an unambiguous format. For example, dates in short date format might be misinterpreted in queries if the year or the day of the month are 12 or less (for example, 3/11/10). Dates in medium date format display only the first few characters of the month name, which can create ambiguity or an undesirable appearance.