FormatDateTime function
Returns an expression that has been formatted as a date or time.
FormatDateTime (date[, NamedFormat])
Parameters
|
Parameters |
Describe |
|
Date |
Required. Any valid the dateexpr ession (like date () or Now ())
Required option. The date expression to be formatted. (such as date () or Now ()) |
|
Format |
Optional. A format value that specifies the Date/time Format to use
Options available. Indicates the value of the date/time format used |
Set up
The NamedFormat parameter can have the following values:
|
Constant |
Value |
Describe |
|
Vbgeneraldate |
0 |
Display a date in format Mm/dd/yy. If The date parameter is now (), it would also return to the time after the date
Displays the date and/or time. If there is a date part, the section is displayed as a short date format. If there is a time section, the section is displayed in a long time format. If all exist, all parts are displayed. |
|
vbLongDate |
1 |
Display a date using the long date format:weekday, Month day, year
Displays a date using the long date format specified in the computer's regional settings |
|
Vbshortdate |
2 |
Display a date using the short date format:like the default (MM/DD/YY)
Displays a date using the short date format specified in the computer locale. such as the default (month/day/year) |
|
Vblongtime |
3 |
Display a time using the Format:hh:mm:ss pm/am
Displays the time using the time format specified in the computer locale |
|
vbShortTime |
4 |
Display a time using the 24-hour format:hh:mm
Use 24-hour format (HH:MM) to display time |