HebrewCalendar.IsLeapDay(Int32, Int32, Int32, Int32) Methode

Definition

Bestimmt, ob das angegebene Datum in der angegebenen Ära ein Schalttag ist.

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
abstract member IsLeapDay : int * int * int * int -> bool
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

Parameter

year
Int32

Eine ganze Zahl, die das Jahr darstellt.

month
Int32

Eine ganze Zahl zwischen 1 und 13, die den Monat darstellt.

day
Int32

Eine ganze Zahl zwischen 1 und 30, die den Tag darstellt.

era
Int32

Eine ganze Zahl, die die Ära darstellt. Geben Sie entweder HebrewEra oder HebrewCalendar.Eras[Calendar.CurrentEra] an.

Gibt zurück

truewenn der angegebene Tag ein Schalttag ist; andernfalls . false

Ausnahmen

year, month, dayoder era außerhalb des Bereichs, der von diesem Kalender unterstützt wird.

Beispiele

Im folgenden Codebeispiel wird der letzte Tag des zweiten Monats (Februar) für fünf Jahre in jeder Ära aufgerufen IsLeapDay .

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

Hinweise

Diese Implementierung der HebrewCalendar Klasse erkennt nur die hebräischen Jahre 5343 bis 5999 (1583 bis 2239 im gregorianischen Kalender).

In jedem 19-Jahres-Zyklus, der mit einem Jahr endet, das gleichmäßig durch 19 teilbar ist, sind die 3., 6., 8., 11. , 14., 17. und 19. Jahre Schaltjahre. Ein gemeinsames Jahr kann von 353 bis 355 Tagen abhängig von der Platzierung jüdischer Feiertage haben. Ein Schaltjahr kann zwischen 383 und 385 Tagen bestehen.

Ein Schalttag ist ein Tag, der nur in einem Schaltjahr stattfindet. Im hebräischen Kalender werden der letzte Tag von Adar Alef und alle Tage in Adar Beit als Schalttage betrachtet.

Gilt für:

Weitere Informationen