KoreanCalendar.TwoDigitYearMax Property

Definition

获取或设置可以用两位数年份表示的 100 年范围内的最后一年。Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.

public:
 virtual property int TwoDigitYearMax { int get(); void set(int value); };
public override int TwoDigitYearMax { get; set; }
member this.TwoDigitYearMax : int with get, set
Public Overrides Property TwoDigitYearMax As Integer

Property Value

Int32

可以用两位数年份表示的 100 年范围内的最后一年。The last year of a 100-year range that can be represented by a 2-digit year.

Exceptions

为设置操作指定的值小于 99。The value specified in a set operation is less than 99.

-或--or- 为设置操作指定的值大于 MaxSupportedDateTime.YearThe value specified in a set operation is greater than MaxSupportedDateTime.Year.

在设置操作中,当前实例是只读的。In a set operation, the current instance is read-only.

Remarks

此属性允许将两位数的年份正确翻译为四位数年份。This property allows a 2-digit year to be properly translated to a 4-digit year. 例如,在公历中,如果将此属性设置为2029,则100年范围是从1930到2029。For example, in the Gregorian calendar, if this property is set to 2029, the 100-year range is from 1930 to 2029. 因此,两位数值30被解释为1930,而两位数字的值29则解释为2029。Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029.

此属性的初始值派生自控制面板的 "区域和语言选项" 部分中的设置。The initial value of this property is derived from the settings in the regional and language options portion of Control Panel. 但是,在 AppDomain的生命周期内,该信息可能会更改。However, that information can change during the life of the AppDomain. KoreanCalendar 类不会自动检测系统设置中的更改。The KoreanCalendar class does not detect changes in the system settings automatically.

应用程序应将此值设置为99,以指示要按字面取的两位数年份。The application should set this value to 99 to indicate that 2-digit years are to be taken literally. 例如,如果将此属性设置为99,则100年的范围是从0(对于大多数日历而言不是有效的值)到99。For example, if this property is set to 99, the 100-year range is from 0 (not a valid value for most calendars) to 99. 因此,两位数值30被解释为30。Therefore, a 2-digit value of 30 is interpreted as 30.

Applies to

See also