DateTimeFormat

Sometimes you want to convert a specific culture date string in a DateTime, you can create a DateTime for InvariantCulture in VB.NET in this way:

 Dim paramvalue As Object = DateTime.ParseExact("23/11/2007", "dd/mm/yyyy", System.Globalization.CultureInfo.InvariantCulture)

 

or if you want by a specific culture :

    Dim myDTFI As DateTimeFormatInfo
        myDTFI = New CultureInfo("it-IT", False).DateTimeFormat

        myDTFI.ShortDatePattern = "dd/MM/yyyy"
        Dim MyDate As DateTime = DateTime.Parse("20/06/2007", myDTFI)

 

Bye 

Antonio :-) 

Published 11 July 2007 12:24 PM by antrad
Filed under:

Comments

No Comments

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Social Bookmarking
    Online Shopping
    asp.net hosting
    UK online local dating