CultureInfo.Calendar CultureInfo.Calendar CultureInfo.Calendar CultureInfo.Calendar Property

定义

获取区域性使用的默认日历。Gets the default calendar used by the culture.

public:
 virtual property System::Globalization::Calendar ^ Calendar { System::Globalization::Calendar ^ get(); };
public virtual System.Globalization.Calendar Calendar { get; }
member this.Calendar : System.Globalization.Calendar
Public Overridable ReadOnly Property Calendar As Calendar

属性值

表示区域性使用的默认日历的 CalendarA Calendar that represents the default calendar used by the culture.

注解

用户可以选择重写一些与 Windows 通过控制面板的区域和语言选项部分的当前区域性关联的值。The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. 例如,用户可以选择以不同格式显示日期,或使用一种货币而不是默认区域性。For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture.

如果UseUserOverridetrue和指定的区域性匹配的 Windows,当前区域性CultureInfo使用这些重写值,其中包括用户设置的属性DateTimeFormatInfo返回实例DateTimeFormat属性,和的属性NumberFormatInfo返回实例NumberFormat属性。If UseUserOverride is true and the specified culture matches the current culture of Windows, the CultureInfo uses those overrides, including user settings for the properties of the DateTimeFormatInfo instance returned by the DateTimeFormat property, and the properties of the NumberFormatInfo instance returned by the NumberFormat property. 如果用户设置与不兼容与关联的区域性CultureInfo,例如,如果在所选的日历不是之一OptionalCalendars,方法的结果和属性的值是不确定。If the user settings are incompatible with the culture associated with the CultureInfo, for example, if the selected calendar is not one of the OptionalCalendars, the results of the methods and the values of the properties are undefined.

因此,如果UseUserOverridetrue,此属性的值可能不同于使用由区域性的默认日历。Therefore, if UseUserOverride is true, the value of this property might be different from the default calendar used by the culture.

你的应用程序更改当前使用的日历CultureInfo通过设置Calendar的属性DateTimeFormat,这是实例DateTimeFormatInfo类。Your application changes the calendar used by the current CultureInfo by setting the Calendar property of DateTimeFormat, which is an instance of the DateTimeFormatInfo class. 新的日历必须是一个中列出的日历OptionalCalendarsThe new calendar must be one of the calendars listed in OptionalCalendars. DateTimeFormat 此外包括其他属性的自定义日期和时间格式设置与该CalendarDateTimeFormat also includes other properties that customize the date and time formatting associated with that Calendar.

适用于

另请参阅