Calendar.NumberOfYearsInThisEra Property


Gets the number of years in the current era of this Calendar object.

 property int NumberOfYearsInThisEra { int get(); };
int NumberOfYearsInThisEra();
public int NumberOfYearsInThisEra { get; }
var int32 = calendar.numberOfYearsInThisEra;
Public ReadOnly Property NumberOfYearsInThisEra As Integer

Property Value


The number of years in the current era, or – 1 if there is no known bound to the number of years in the current era.



This API is being updated to support the May 2019 Japanese era change. If your application supports the Japanese calendar, you should validate that it properly handles the new era. See Prepare your application for the Japanese era change for more information.

Applies to

See also