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 此实现仅识别公历) 中的希伯来语年 5343 到 5999 (1583 到 2239。

在以 19 年为结束的 19 年周期中,第 3、6、8、11、14、17 和 19 年是闰年。 一个普通的一年可能有353到355天,具体取决于犹太节日的放置。 闰年可以有 383 到 385 天。

闰月是仅发生在闰年的整个月份。 在希伯来历法中,阿达尔·贝特是唯一的闰月。

适用于

另请参阅