VBA/Excel/Access/Word/Data Type Functions/FormatDateTime

Материал из VB Эксперт
Перейти к: навигация, поиск

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