Calendar.GetLeapMonth 方法

定義

計算指定年份,或年份和紀元的閏月。Calculates the leap month for a specified year, or year and era.

多載

GetLeapMonth(Int32, Int32)

計算指定年份和紀元的閏月。Calculates the leap month for a specified year and era.

GetLeapMonth(Int32)

計算指定年份的閏月。Calculates the leap month for a specified year.

GetLeapMonth(Int32, Int32)

計算指定年份和紀元的閏月。Calculates the leap month for a specified year and era.

public:
 virtual int GetLeapMonth(int year, int era);
public virtual int GetLeapMonth (int year, int era);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual int GetLeapMonth (int year, int era);
abstract member GetLeapMonth : int * int -> int
override this.GetLeapMonth : int * int -> int
Public Overridable Function GetLeapMonth (year As Integer, era As Integer) As Integer

參數

year
Int32

一年。A year.

era
Int32

一紀元。An era.

傳回

正整數,指出在指定的年份及紀元中的閏月。A positive integer that indicates the leap month in the specified year and era.

-或--or- 如果這個曆法不支援閏月,或 yearera 參數未指定閏年,則為零。Zero if this calendar does not support a leap month or if the year and era parameters do not specify a leap year.

屬性

備註

在支援閏月概念的行事曆中,閏月可以在特定月份之後,或在一年的任何月份之後發生。In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. 例如,GetMonth(DateTime) 方法會傳回1到13之間的數位,表示與指定日期相關聯的月份。For example, the GetMonth(DateTime) method returns a number between 1 and 13 that indicates the month associated with a specified date. 如果一年的第八到第九個月之間有閏月,則 GetMonth(DateTime) 方法會針對第八個月傳回8個,而在第八個月則傳回9個,而第九個月則會傳回10個月。If there is a leap month between the eighth and ninth months of the year, the GetMonth(DateTime) method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

GetLeapMonth(Int32)

計算指定年份的閏月。Calculates the leap month for a specified year.

public:
 virtual int GetLeapMonth(int year);
public virtual int GetLeapMonth (int year);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual int GetLeapMonth (int year);
abstract member GetLeapMonth : int -> int
override this.GetLeapMonth : int -> int
Public Overridable Function GetLeapMonth (year As Integer) As Integer

參數

year
Int32

一年。A year.

傳回

正整數,指出在指定的年份中的閏月。A positive integer that indicates the leap month in the specified year.

-或--or- 如果這個曆法不支援閏月,或 year 參數不代表閏年,則為零。Zero if this calendar does not support a leap month or if the year parameter does not represent a leap year.

屬性

備註

在支援閏月概念的行事曆中,閏月可以在特定月份之後,或在一年的任何月份之後發生。In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. 例如,GetMonth(DateTime) 方法會傳回1到13之間的數位,表示與指定日期相關聯的月份。For example, the GetMonth(DateTime) method returns a number between 1 and 13 that indicates the month associated with a specified date. 如果一年的第八到第九個月之間有閏月,則 GetMonth(DateTime) 方法會針對第八個月傳回8個,而在第八個月則傳回9個,而第九個月則會傳回10個月。If there is a leap month between the eighth and ninth months of the year, the GetMonth(DateTime) method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

適用於