Assume en-US culture and standard format string : String Format « Development « VB.Net






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

1.String Format: CurrencyString Format: Currency
2.Double number format: 0:n3Double number format: 0:n3
3.Proper Title Case
4.Format a string with composite string