JapaneseCalendar: GetEra

GetEra

Returns the era in the specified Date or CorDateTime.



 Public Function GetEra(
	  ByRef Time As Variant ) As Long

Parameters

Time
[ByRef] Variant. The Date or CorDateTime to read.

Return Values

Long -  An integer that represents the era in the specified Date or CorDateTime.

Remarks

The Japanese calendar recognizes one era for every emperors reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.

This class assigns numbers to the eras as follows:

GetEra Value Era Name Era Abbreviation Gregorian Dates
4 平成 (Heisei) 平 (H, h) January 8, 1989 to present
3 昭和 (Showa) 昭 (S, s) December 25, 1926 to January 7, 1989
2 大正 (Taisho) 大 (T, t) July 30, 1912 to December 24, 1926
1 明治 (Meiji) 明 (M, m) September 8, 1868 to July 29, 1912

Ordinarily, the JapaneseCalendar class supports dates from September 8 in the year Meiji 1 (September 8, 1868 of the Gregorian calendar), which is the value of the MinSupportedDateTime property. However, the GetEra method successfully returns the era for dates from January 1 through September 7 in the year Meiji 1 (January 1, 1868 through September 7, 1868 in the Gregorian calendar). For dates earlier than January 1, 1868 in the Gregorian calendar, the method throws an ArgumentOutOfRangeException exception.

See Also

Project CorLib Overview

Class JapaneseCalendar Overview