Rediger

Del via


JapaneseLunisolarCalendar.Eras Property

Definition

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()

Property Value

Int32[]

An array of 32-bit signed integers that specify the relevant eras.

Remarks

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.

Important

Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. 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. For more information and to determine whether your applications are affected, see Handling a new era in the Japanese calendar in .NET. For information on testing your applications on Windows systems to ensure their readiness for the era change, see Prepare your application for the Japanese era change. For features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras, see Working with eras.

While the JapaneseLunisolarCalendar defines the Meiji and Taisho eras (eras 1 and 2, respectively), the calendar does not support dates in their ranges. For example, a call to GetEra or ToDateTime with a date in those era ranges throws an ArgumentOutOfRangeException.

The JapaneseLunisolarCalendar.Eras property returns the same values as the JapaneseCalendar.Eras property.

Applies to