JapaneseLunisolarCalendar.Eras 属性

定义

获取与 JapaneseLunisolarCalendar 对象相关的纪元。Gets the eras that are relevant to the JapaneseLunisolarCalendar object.

public:
 virtual property cli::array <int> ^ Eras { cli::array <int> ^ get(); };
public override int[] Eras { get; }
member this.Eras : int[]
Public Overrides ReadOnly Property Eras As Integer()

属性值

Int32[]

32 位有符号整数数组,用于指定相关的纪元。An array of 32-bit signed integers that specify the relevant eras.

注解

此属性返回的数组中的值是从1到最大年代号的数字。The values in the array returned by this property are numbers that range from 1 to the largest era number. 最大纪元号返回在第一个数组元素中,最后一个元素中返回最小纪元号。The largest era number is returned in the first array element, and the smallest era number is returned in the last element.

重要

日本历法中的年号是根据天皇统治来命名的,因此预计会发生变化。Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. 例如,2019 年 5 月 1 日在 JapaneseCalendarJapaneseLunisolarCalendar 中标志着令和年号的开始。For example, May 1, 2019 marked the beginning of the Reiwa era in the JapaneseCalendar and JapaneseLunisolarCalendar. 这种年号的变化会影响使用这些日历的所有应用程序。Such a change of era affects all applications that use these calendars. 请参阅 Handling a new era in the Japanese calendar in .NET(使用 .NET 处理日语日历中的新元号),了解详细信息并确定是否会影响你的应用程序。See Handling a new era in the Japanese calendar in .NET for more information and to determine whether your applications are affected. 请参阅针对日语元号更改准备应用程序,了解有关在 Windows 系统上测试应用程序以确保针对元号更改的准备情况信息。See Prepare your application for the Japanese era change for information on testing your applications on Windows systems to ensure their readiness for the era change. 有关 .Net 中支持多个年号日历的功能,以及在使用支持多个年号的日历时的最佳做法,请参阅使用年号See Working with eras for features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras.

尽管 @no__t 定义 Meiji 和 Taisho 纪元(分别为纪元1和2),但日历不支持其范围内的日期。While the JapaneseLunisolarCalendar defines the Meiji and Taisho eras (eras 1 and 2, respectively), the calendar does not support dates in their ranges. 例如,对 @no__t 0 或 ToDateTime 的调用在这些纪元范围内的日期引发了 ArgumentOutOfRangeExceptionFor example, a call to GetEra or ToDateTime with a date in those era ranges throws an ArgumentOutOfRangeException.

@No__t-0 属性返回与 @no__t 属性相同的值。The JapaneseLunisolarCalendar.Eras property returns the same values as the JapaneseCalendar.Eras property.

适用于