Public Class Tester
Public Shared Sub Main
Dim rightNow As Date = Now
Dim result As New System.Text.StringBuilder
result.AppendLine("""Now""...")
result.Append("ToString: ").AppendLine(rightNow.ToString)
result.Append("ToLongDateString: ")
result.AppendLine(rightNow.ToLongDateString)
result.Append("ToShortDateString: ")
result.AppendLine(rightNow.ToShortDateString)
result.Append("ToLongTimeString: ")
result.AppendLine(rightNow.ToLongTimeString)
result.Append("ToShortTimeString: ")
result.AppendLine(rightNow.ToShortTimeString)
result.Append("ToUniversalTime: ")
result.AppendLine(rightNow.ToUniversalTime)
result.AppendLine()
Console.WriteLine(result.ToString)
End Sub
End Class
Now"...
ToString: 11/05/2007 9:09:26 PM
ToLongDateString: May 11, 2007
ToShortDateString: 11/05/2007
ToLongTimeString: 9:09:26 PM
ToShortTimeString: 9:09 PM
ToUniversalTime: 12/05/2007 4:09:26 AM