asp.net.ph

DateTimeFormatInfo.GetEra Method

System.Globalization Namespace   DateTimeFormatInfo Class


Returns the integer representing the specified era.

[ VB ]
public Function GetEra ( _
   ByVal eraName As String _
) As Integer

[ C# ]
public int GetEra ( 
   string eraName
);

[ C++ ]
public: int GetEra ( 
   String* eraName
);

[ JScript ]
function GetEra ( 
   eraName : String
) : int;

Parameters

eraName
The string containing the name of the era.

Return Value

The integer representing the era, if eraName is valid; otherwise, -1.

Exceptions


Exception Type Condition
ArgumentNullException eraName is a null reference ( Nothing in Visual Basic ).

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 comparison with eraName is case-insensitive; for example, "A.D." is equivalent to "a.d.".

If the GregorianCalendar is selected in DateTimeFormatInfo.Calendar, DateTimeFormatInfo ignores punctuation in abbreviated era names; that is, "A.D." is equivalent to "AD".

GetEra compares eraName with the full era name returned by GetEraName and with the abbreviated era name returned by GetAbbreviatedEraName.

See Also

DateTimeFormatInfo Members   GetEraName   Calendar Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph