Custom Date and Time Format Strings
Imports System
Imports System.Globalization
Public Class MainClass
Public Shared Sub Main()
Dim thisDate1 As Date = #6/10/2011#
Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + ".")
Dim thisDate2 As New DateTimeOffset(2011, 6, 10, 15, 24, 16, TimeSpan.Zero)
Console.WriteLine("The current date and time: {0:MM/dd/yy H:mm:ss zzz}", thisDate2)
End Sub
End Class
Related examples in the same category