Output date and time using each standard format string
Module DateToStringExample
Public Sub Main()
Dim dateValue As Date = #6/15/2010 9:15:07PM#
' Create an array of standard format strings.
Dim standardFmts() As String = {"d", "D", "f", "F", "g", "G", _
"m", "o", "R", "s", "t", "T", _
"u", "U", "y"}
For Each standardFmt As String In standardFmts
Console.WriteLine("{0}: {1}", standardFmt, _
dateValue.ToString(standardFmt))
Next
End Sub
End Module
Related examples in the same category