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 |
Description |
|
vbgeneraldate |
0 |
Display a date in format Mm/dd/yy. If The date parameter is now (), it would also return to the time, and after the date
, displays the dates and/or times. 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 the date using the long date format specified in the computer locale |
|
Vbshortdate |
2 |
Display a date using the short date format:like the default (mm/dd/yy)
Displays the date in the format specified in the computer locale. such as the default (month/day/year) |
| Vblongtime
|
3 |
Display a time using the time Format:hh:mm:ss pm/am
Use meter The time format specified in the calculation machine locale displays the time |
|
vbShortTime |
4 |
Display a time using the 24-hour format:hh:mm
Use 24-hour grid Type (hh:mm) display time |