System.Globalization.DateTimeFormatInfo.GetEraName Method

Returns the string containing the name of the specified era.

Syntax

public string GetEraName (int era)

Parameters

era
The integer representing the era.

Returns

A string containing the name of the era.

Exceptions

TypeReason
ArgumentOutOfRangeException era does not represent a valid era in calendar for the current thread.

Remarks

The era name is the name a calendar uses to refer to a period of time reckoned from a fixed point or event. For example, "A.D." or "C.E." is the current era in the Gregorian calendar.

The valid values for era are listed in the Calendar.Eras property of the appropriate class derived from System.Globalization.Calendar. For example: JapaneseCalendar.Eras displays a list of eras that are supported by this implementation.

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0