Gets the list of calendars that can be used by the culture.
Imports System
Imports System.Globalization
Public Class SamplesCultureInfo
Public Shared Sub Main()
Dim myOptCals As Calendar() = New CultureInfo("ar-SA").OptionalCalendars
Dim cal As Calendar
For Each cal In myOptCals
If cal.GetType() Is GetType(GregorianCalendar) Then
Dim myGreCal As GregorianCalendar = CType(cal, GregorianCalendar)
Dim calType As GregorianCalendarTypes = myGreCal.CalendarType
Console.WriteLine(" {0} ({1})", cal, calType)
Else
Console.WriteLine(" {0}", cal)
End If
Next cal
End Sub
End Class
Related examples in the same category