Mega Code Archive

 
Categories / VB.Net / Date Time
 

DateTime ToString Method converts DateTime to string using the specified culture-specific format information

Imports System.Globalization Module Example    Public Sub Main()       Dim jaJP As New CultureInfo("ja-JP")       jaJP.DateTimeFormat.Calendar = New JapaneseCalendar()        Dim date1 As Date = #01/01/2010#       Try          Console.WriteLine(date1.ToString(jaJP))       Catch e As ArgumentOutOfRangeException          Console.WriteLine("ArgumentOutOfRangeException")        End Try    End Sub End Module