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.

如果UseUserOverride CultureInfotrue ,并且指定的区域性与 Windows 的当前区域性匹配,则将使用这些替代, DateTimeFormatInfo包括DateTimeFormat属性返回的实例的属性的用户设置。属性NumberFormat返回的NumberFormatInfo实例的属性。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设置的属性DateTimeFormatDateTimeFormatInfo类的实例)更改当前使用的日历。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. 新日历必须是中OptionalCalendars列出的其中一个日历。The new calendar must be one of the calendars listed in OptionalCalendars. DateTimeFormat还包括一些自定义与该Calendar关联的日期和时间格式设置的属性。DateTimeFormat also includes other properties that customize the date and time formatting associated with that Calendar.

适用于

另请参阅