asp.net.ph

DateTimeFormatInfo.Calendar Property

System.Globalization Namespace   DateTimeFormatInfo Class


Sets or retrieves the calendar to use for the current culture.

[ VB ]
public Property Calendar As Calendar

[ C# ]
public Calendar Calendar {get; set;}

[ C++ ]
public: __property Calendar* get_Calendar ( );
public: __property void set_Calendar ( Calendar* );

[ JScript ]
function get Calendar ( ) : Calendar;
public function set Calendar ( Calendar );

Property Value

The Calendar indicating the calendar to use for the current culture. The default for InvariantInfo is the GregorianCalendar.

Exceptions


Exception Type Condition
ArgumentNullException The property is being set to a null reference ( Nothing in Visual Basic ).
ArgumentException The property is being set to a Calendar that is not valid for the current culture.
InvalidOperationException The property is being set and the DateTimeFormatInfo is read-only.

Remarks

The Calendar property only accepts calendars that are valid for the current culture of the current thread. The CultureInfo.Calendar property specifies the default calendar for the culture and the CultureInfo.OptionalCalendars property specifies other calendars supported by the culture.

Changing the value of this property affects the following properties as well: MonthNames, AbbreviatedMonthNames, DayNames, AbbreviatedDayNames, CalendarWeekRule, FirstDayOfWeek, FullDateTimePattern, LongDatePattern, ShortDatePattern, YearMonthPattern, and MonthDayPattern.

For example, if the culture of the current thread is Japanese, this property accepts JapaneseCalendar, Localized GregorianCalendar, or USEnglish GregorianCalendar. When the JapaneseCalendar is used, the default long date pattern is "gg y'\x5e74'M'\x6708'd'\x65e5'". When the Localized GregorianCalendar, is used, the default long date pattern is "yyyy'\x5e74'M'\x6708'd'\x65e5'".

Example

The below shows the Calendar and OptionalCalendars used for each of the available cultures.

 Show me 

See Also

DateTimeFormatInfo Members   Calendar   GregorianCalendar   HebrewCalendar   HijriCalendar   JapaneseCalendar   JulianCalendar   KoreanCalendar   ThaiBuddhistCalendar Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph