Tuesday, May 25, 2010

Format Date and Time

Dim MyDate
MyDate = Date
For i = 0 To 4 Step 1
Strformatdate = FormatDateTime(MyDate, i)
If i = 0 Then
MsgBox "General Date Is:" & Strformatdate
ElseIf i = 1 Then
MsgBox "Long Date Is:" & Strformatdate
ElseIf i = 2 Then
MsgBox "Short Date Is:" & Strformatdate
ElseIf i = 3 Then
MsgBox "Long time Is:" & Strformatdate
Else
MsgBox "Short time Is:" & Strformatdate
End If
Next

No comments: