Gets the list of calendars that can be used by the culture.
using System;
using System.Globalization;
public class SamplesCultureInfo {
public static void Main() {
Calendar[] myOptCals = new CultureInfo("ar-SA").OptionalCalendars;
foreach ( Calendar cal in myOptCals ) {
if ( cal.GetType() == typeof( GregorianCalendar ) ) {
GregorianCalendar myGreCal = (GregorianCalendar) cal;
GregorianCalendarTypes calType = myGreCal.CalendarType;
Console.WriteLine( " {0} ({1})", cal, calType );
}
else {
Console.WriteLine( " {0}", cal );
}
}
}
}
Related examples in the same category