FormatDateTime Function [VBA]
/text/sbasic/shared/03150000.xhp
FormatDateTime (DateExpression as Date [, NamedFormat as Integer])
String
DateExpression: The date expression to be formatted.
NamedFormat: An optional vbDateTimeFormat enumeration specifying the format that is to be applied to the date and time expression. If omitted, the value vbGeneralDate is used.
Date and Time formats (vbDateTimeFormat enumeration)
REM ***** BASIC *****
Option VBASupport 1
Sub DateFormat
Dim d as Date
d = ("1958-01-29 00:25")
msgbox("General date format : " & FormatDateTime(d))
msgbox("Long date format : " & FormatDateTime(d,vbLongDate))
msgbox("Short date format : " & FormatDateTime(d,vbShortDate))
msgbox("Long time format : " & FormatDateTime(d,3))
msgbox("Short time format : " & FormatDateTime(d,vbShortTime))
End Sub