HebrewCalendar.IsLeapDay(Int32, Int32, Int32, Int32) メソッド

定義

指定した時代 (年号) の指定した日付が閏日かどうかを確認します。

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

パラメーター

year
Int32

年を表す整数。

month
Int32

月を表す 1 から 13 の整数。

day
Int32

日を表す 1 から 30 の整数。

era
Int32

時代 (年号) を表す整数。 HebrewEra または HebrewCalendar.Eras[Calendar.CurrentEra] を指定します。

戻り値

指定した日が閏日である場合は true。それ以外の場合は false

例外

yearmonthdayera が、このカレンダーでサポートされている範囲外です。

次のコード例では、各時代 (年号) の 5 年間の 2 か月 (2 月) の最終日を呼び出 IsLeapDay します。

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes a HebrewCalendar.
   HebrewCalendar^ myCal = gcnew HebrewCalendar;
   
   // Creates a holder for the last day of the second month (February).
   int iLastDay;
   
   // Displays the header.
   Console::Write( "YEAR\t" );
   for ( int y = 5761; y <= 5765; y++ )
      Console::Write( "\t {0}", y );
   Console::WriteLine();
   
   // Checks five years in the current era.
   Console::Write( "CurrentEra:" );
   for ( int y = 5761; y <= 5765; y++ )
   {
      iLastDay = myCal->GetDaysInMonth( y, 2, HebrewCalendar::CurrentEra );
      Console::Write( "\t {0}", myCal->IsLeapDay( y, 2, iLastDay, HebrewCalendar::CurrentEra ) );

   }
   Console::WriteLine();
   
   // Checks five years in each of the eras.
   for ( int i = 0; i < myCal->Eras->Length; i++ )
   {
      Console::Write( "Era {0}:\t", myCal->Eras[ i ] );
      for ( int y = 5761; y <= 5765; y++ )
      {
         iLastDay = myCal->GetDaysInMonth( y, 2, myCal->Eras[ i ] );
         Console::Write( "\t {0}", myCal->IsLeapDay( y, 2, iLastDay, myCal->Eras[ i ] ) );

      }
      Console::WriteLine();

   }
}

/*
This code produces the following output.

YEAR            5761    5762    5763    5764    5765
CurrentEra:     False   False   False   False   False
Era 1:          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();

      // Creates a holder for the last day of the second month (February).
      int iLastDay;

      // Displays the header.
      Console.Write( "YEAR\t" );
      for ( int y = 5761; y <= 5765; y++ )
         Console.Write( "\t{0}", y );
      Console.WriteLine();

      // Checks five years in the current era.
      Console.Write( "CurrentEra:" );
      for ( int y = 5761; y <= 5765; y++ )  {
         iLastDay = myCal.GetDaysInMonth( y, 2, HebrewCalendar.CurrentEra );
         Console.Write( "\t{0}", myCal.IsLeapDay( y, 2, iLastDay, HebrewCalendar.CurrentEra ) );
      }
      Console.WriteLine();

      // Checks five years in each of the eras.
      for ( int i = 0; i < myCal.Eras.Length; i++ )  {
         Console.Write( "Era {0}:\t", myCal.Eras[i] );
         for ( int y = 5761; y <= 5765; y++ )  {
            iLastDay = myCal.GetDaysInMonth( y, 2, myCal.Eras[i] );
            Console.Write( "\t{0}", myCal.IsLeapDay( y, 2, iLastDay, myCal.Eras[i] ) );
         }
         Console.WriteLine();
      }
   }
}

/*
This code produces the following output.

YEAR            5761    5762    5763    5764    5765
CurrentEra:     False   False   False   False   False
Era 1:          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()

      ' Creates a holder for the last day of the second month (February).
      Dim iLastDay As Integer

      ' Displays the header.
      Console.Write("YEAR" + ControlChars.Tab)
      Dim y As Integer
      For y = 5761 To 5765
         Console.Write(ControlChars.Tab + "{0}", y)
      Next y
      Console.WriteLine()

      ' Checks five years in the current era.
      Console.Write("CurrentEra:")
      For y = 5761 To 5765
         iLastDay = myCal.GetDaysInMonth(y, 2, HebrewCalendar.CurrentEra)
         Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapDay(y, 2, iLastDay, HebrewCalendar.CurrentEra))
      Next y
      Console.WriteLine()

      ' Checks five years in each of the eras.
      Dim i As Integer
      For i = 0 To myCal.Eras.Length - 1
         Console.Write("Era {0}:" + ControlChars.Tab, myCal.Eras(i))
         For y = 5761 To 5765
            iLastDay = myCal.GetDaysInMonth(y, 2, myCal.Eras(i))
            Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapDay(y, 2, iLastDay, myCal.Eras(i)))
         Next y
         Console.WriteLine()
      Next i

   End Sub

End Class


'This code produces the following output.
'
'YEAR            5761    5762    5763    5764    5765
'CurrentEra:     False   False   False   False   False
'Era 1:          False   False   False   False   False

注釈

このクラスの HebrewCalendar 実装では、ヘブライ語の年 5343 年から 5999 年 (グレゴリオ暦では 1583 年から 2239 年) のみが認識されます。

19 年ごとに、19 年で均等に割り切れる年で終わるサイクルでは、3 年、6 年、8 年、11 年、14 年、17 年、19 年は閏年です。 一般的な年は、ユダヤ人の休日の配置に応じて、353日から355日を持つことができます。 閏年には 383 日から 385 日を指定できます。

閏日は閏年でのみ発生する日です。 ヘブライ暦では、アダル・アレフの最終日とアダル・ベトのすべての日は閏日と見なされます。

適用対象

こちらもご覧ください