HebrewCalendar.IsLeapMonth(Int32, Int32, Int32) 方法

定義

判斷指定紀元的指定年份中指定的月份是否為閏月。

public:
 override bool IsLeapMonth(int year, int month, int era);
public override bool IsLeapMonth (int year, int month, int era);
override this.IsLeapMonth : int * int * int -> bool
Public Overrides Function IsLeapMonth (year As Integer, month As Integer, era As Integer) As Boolean

參數

year
Int32

表示年份的整數。

month
Int32

從 1 到 13 的整數,表示月份。

era
Int32

表示紀元的整數。 請指定 HebrewEraHebrewCalendar.Eras[Calendar.CurrentEra]

傳回

如果指定的月份是閏月,則為 true,否則為 false

例外狀況

yearmonthera 在這個日曆支援的範圍之外。

範例

下列程式代碼範例會呼叫 IsLeapMonth 目前紀元五年中的所有月份。

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes a HebrewCalendar.
   HebrewCalendar^ myCal = gcnew HebrewCalendar;
   
   // Checks all the months in five years in the current era.
   int iMonthsInYear;
   for ( int y = 5761; y <= 5765; y++ )
   {
      Console::Write( " {0}:\t", y );
      iMonthsInYear = myCal->GetMonthsInYear( y, HebrewCalendar::CurrentEra );
      for ( int m = 1; m <= iMonthsInYear; m++ )
         Console::Write( "\t {0}", myCal->IsLeapMonth( y, m, HebrewCalendar::CurrentEra ) );
      Console::WriteLine();

   }
}

/*
This code produces the following output.

5761:           False   False   False   False   False   False   False   False   False   False   False   False
5762:           False   False   False   False   False   False   False   False   False   False   False   False
5763:           False   False   False   False   False   False   True    False   False   False   False   False   False
5764:           False   False   False   False   False   False   False   False   False   False   False   False
5765:           False   False   False   False   False   False   True    False   False   False   False   False   False

*/
using System;
using System.Globalization;

public class SamplesHebrewCalendar  {

   public static void Main()  {

      // Creates and initializes a HebrewCalendar.
      HebrewCalendar myCal = new HebrewCalendar();

      // Checks all the months in five years in the current era.
      int iMonthsInYear;
      for ( int y = 5761; y <= 5765; y++ )  {
         Console.Write( "{0}:\t", y );
         iMonthsInYear = myCal.GetMonthsInYear( y, HebrewCalendar.CurrentEra );
         for ( int m = 1; m <= iMonthsInYear; m++ )
            Console.Write( "\t{0}", myCal.IsLeapMonth( y, m, HebrewCalendar.CurrentEra ) );
         Console.WriteLine();
      }
   }
}

/*
This code produces the following output.

5761:           False   False   False   False   False   False   False   False   False   False   False   False
5762:           False   False   False   False   False   False   False   False   False   False   False   False
5763:           False   False   False   False   False   False   True    False   False   False   False   False   False
5764:           False   False   False   False   False   False   False   False   False   False   False   False
5765:           False   False   False   False   False   False   True    False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesHebrewCalendar   
   
   Public Shared Sub Main()

      ' Creates and initializes a HebrewCalendar.
      Dim myCal As New HebrewCalendar()

      ' Checks all the months in five years in the current era.
      Dim iMonthsInYear As Integer
      Dim y As Integer
      For y = 5761 To 5765
         Console.Write("{0}:" + ControlChars.Tab, y)
         iMonthsInYear = myCal.GetMonthsInYear(y, HebrewCalendar.CurrentEra)
         Dim m As Integer
         For m = 1 To iMonthsInYear
            Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapMonth(y, m, HebrewCalendar.CurrentEra))
         Next m
         Console.WriteLine()
      Next y

   End Sub

End Class


'This code produces the following output.
'
'5761:           False   False   False   False   False   False   False   False   False   False   False   False
'5762:           False   False   False   False   False   False   False   False   False   False   False   False
'5763:           False   False   False   False   False   False   True    False   False   False   False   False   False
'5764:           False   False   False   False   False   False   False   False   False   False   False   False
'5765:           False   False   False   False   False   False   True    False   False   False   False   False   False

備註

這個類別的 HebrewCalendar 實作只會辨識公曆 (1583 到 2239 年的希伯來文年份 5343 到 5999 年) 。

在每個 19 年週期中,以 19 平均除出的年份結束,第 3、6th、8th、11th、14th、17 和 19 年都是閏年。 一般年份可以有 353 到 355 天,視假日位置而定。 閏年可以有 383 到 385 天。

閏月是只發生在閏年的整個月份。 在希伯來文行事曆中,Adar Beit 是唯一的閏月。

適用於

另請參閱