Formatting Dates
Sub dateFormat()
Dim datDateTime As Date
datDateTime = #11/30/1998 10:54:17 AM#
Debug.Print datDateTime
Debug.Print FormatDateTime(datDateTime, vbGeneralDate)
Debug.Print FormatDateTime(datDateTime, vbLongDate)
Debug.Print FormatDateTime(datDateTime, vbLongTime)
Debug.Print FormatDateTime(datDateTime, vbShortDate)
Debug.Print FormatDateTime(datDateTime, vbShortTime)
End Sub
Related examples in the same category