Assume en-US culture and standard format string
Imports System
Imports System.Globalization
Class Sample
Public Shared Sub Main()
Dim result As Boolean
Dim datetimeVal As DateTime
Dim ci As CultureInfo
ci = New CultureInfo("fr-FR")
Dim dateFormats As String() = {"f", "F", "g", "G"}
result = DateTime.TryParseExact("7/4/2010 12:34:56 PM", dateFormats, Nothing, DateTimeStyles.None, datetimeVal)
Console.WriteLine(datetimeVal.ToString())
End Sub
End Class
Related examples in the same category