KoreanLunisolarCalendar.GetEra(DateTime) 方法

定义

检索对应于指定 DateTime 的纪元。Retrieves the era that corresponds to the specified DateTime.

public:
 override int GetEra(DateTime time);
public override int GetEra (DateTime time);
override this.GetEra : DateTime -> int
Public Overrides Function GetEra (time As DateTime) As Integer

参数

time
DateTime

要读取的 DateTimeThe DateTime to read.

返回

Int32

一个整数,用于表示 time 参数指定的纪元。An integer that represents the era specified by the time parameter. KoreanLunisolarCalendar 对象的返回值始终是 GregorianEra 值。The return value for a KoreanLunisolarCalendar object is always the GregorianEra value.

例外

time 表示小于 MinSupportedDateTime 或大于 MaxSupportedDateTime 的日期和时间。time represents a date and time less than MinSupportedDateTime or greater than MaxSupportedDateTime.

适用于