Imports System.Threading
Imports System.Globalization
Imports System.Text
Public Class Form1
Private formHasLoaded As Boolean = False
Private cultureValue As String
Private Sub DateTimeChech()
Dim dtmNow As DateTime = Now
Dim sb As New StringBuilder()
sb.Append("When using " & cultureValue & " CultureInfo, today's date and time will format as follows:")
sb.Append(vbCrLf)
sb.Append(vbCrLf)
AppendLine(sb, dtmNow.ToString("d"), " Short date pattern")
AppendLine(sb, dtmNow.ToString("D"), " Long date pattern")
AppendLine(sb, dtmNow.ToString("t"), " Short time pattern")
AppendLine(sb, dtmNow.ToString("T"), " Long time pattern")
AppendLine(sb, dtmNow.ToString("F"), " Full date/time pattern (long)")
AppendLine(sb, dtmNow.ToString("f"), " Full date/time pattern (short)")
AppendLine(sb, dtmNow.ToString("G"), " General date/time pattern (long)")
AppendLine(sb, dtmNow.ToString("g"), " General date/time pattern (short)")
AppendLine(sb, dtmNow.ToString("M"), " Month day pattern")
AppendLine(sb, dtmNow.ToString("R"), " RFC1123 pattern")
AppendLine(sb, dtmNow.ToString("s"), " Sortable date/time pattern")
AppendLine(sb, dtmNow.ToString("u"), " Universable sortable date/time pattern")
AppendLine(sb, dtmNow.ToString("y"), " Year month pattern")
sb.Append(vbCrLf)
txtDateTime.Text = sb.ToString
End Sub
Private Sub AppendLine(ByVal sb As StringBuilder, ByVal string1 As String, ByVal string2 As String)
sb.Append(string1)
sb.Append(string2)
sb.Append(vbCrLf)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DateTimeChech()
End Sub
End Class