Table of contents
TOC
Collapse the table of content
Expand the table of content

FormatDateTime Function

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Description Returns an expression formatted as a date or time. SyntaxFormatDateTime(Date [ ,NamedFormat ] ) The FormatDateTime function syntax has these parts:

PartDescription
DateRequired. Date expression to be formatted.
NamedFormatOptional. Numeric value that indicates the date/time format used. If omitted, vbGeneralDate is used.

Settings The NamedFormat argument has the following settings:

ConstantValueDescription
vbGeneralDate0Display a date and/or time. If there is a date part, display it as a short date. If there is a time part, display it as a long time. If present, both parts are displayed.
vbLongDate1Display a date using the long date format specified in your computer's regional settings.
vbShortDate2Display a date using the short date format specified in your computer's regional settings.
vbLongTime3Display a time using the time format specified in your computer's regional settings.
vbShortTime4Display a time using the 24-hour format (hh:mm).
© 2017 Microsoft