Imports System.Globalization
Imports System.Threading
Module Example
Public Sub Main()
Dim date1 As Date = #1/1/2010#
Dim dft As CultureInfo
Dim arSY As New CultureInfo("ar-SY")
arSY.DateTimeFormat.Calendar = New HijriCalendar()
dft = Thread.CurrentThread.CurrentCulture
Thread.CurrentThread.CurrentCulture = arSY
Try
Console.WriteLine(date1.ToString())
Catch e As ArgumentOutOfRangeException
Console.WriteLine("{0} is earlier than {1} or later than {2}", _
date1.ToString("d", CultureInfo.InvariantCulture), _
arSY.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture), _
arSY.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture))
End Try
Thread.CurrentThread.CurrentCulture = dft
End Sub
End Module