HebrewCalendar.IsLeapYear(Int32, Int32) Methode
Definition
Bestimmt, ob das angegebene Jahr im angegebenen Zeitraum ein Schaltjahr ist.Determines whether the specified year in the specified era is a leap year.
public:
override bool IsLeapYear(int year, int era);
public override bool IsLeapYear (int year, int era);
override this.IsLeapYear : int * int -> bool
Public Overrides Function IsLeapYear (year As Integer, era As Integer) As Boolean
Parameter
- year
- Int32
Eine ganze Zahl, die das Jahr darstellt.An integer that represents the year.
- era
- Int32
Eine ganze Zahl, die den Zeitraum darstellt.An integer that represents the era. Geben Sie entweder HebrewEra oder HebrewCalendar.Eras[Calendar.CurrentEra]
an.Specify either HebrewEra or HebrewCalendar.Eras[Calendar.CurrentEra]
.
Gibt zurück
true
, wenn das angegebene Jahr ein Schaltjahr ist, andernfalls false
.true
if the specified year is a leap year; otherwise, false
.
Ausnahmen
year
oder era
liegt außerhalb des Bereichs, der von diesem Kalender unterstützt wird.year
or era
is outside the range supported by this calendar.
Beispiele
Im folgenden Codebeispiel werden IsLeapYear
fünf Jahre lang in jeder der Zeiträume aufgerufen.The following code example calls IsLeapYear
for five years in each of the eras.
using namespace System;
using namespace System::Globalization;
int main()
{
// Creates and initializes a HebrewCalendar.
HebrewCalendar^ myCal = gcnew HebrewCalendar;
// 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++ )
Console::Write( "\t {0}", myCal->IsLeapYear( y, 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++ )
Console::Write( "\t {0}", myCal->IsLeapYear( y, myCal->Eras[ i ] ) );
Console::WriteLine();
}
}
/*
This code produces the following output.
YEAR 5761 5762 5763 5764 5765
CurrentEra: False False True False True
Era 1: False False True False True
*/
using System;
using System.Globalization;
public class SamplesHebrewCalendar {
public static void Main() {
// Creates and initializes a HebrewCalendar.
HebrewCalendar myCal = new HebrewCalendar();
// 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++ )
Console.Write( "\t{0}", myCal.IsLeapYear( y, 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++ )
Console.Write( "\t{0}", myCal.IsLeapYear( y, myCal.Eras[i] ) );
Console.WriteLine();
}
}
}
/*
This code produces the following output.
YEAR 5761 5762 5763 5764 5765
CurrentEra: False False True False True
Era 1: False False True False True
*/
Imports System.Globalization
Public Class SamplesHebrewCalendar
Public Shared Sub Main()
' Creates and initializes a HebrewCalendar.
Dim myCal As New HebrewCalendar()
' 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
Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapYear(y, 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
Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapYear(y, 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 True False True
'Era 1: False False True False True
Hinweise
Diese Implementierung der- HebrewCalendar Klasse erkennt nur die hebräischen Jahre 5343 bis 5999 (1583 bis 2239 im gregorianischen Kalender).This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 5999 (1583 to 2239 in the Gregorian calendar).
Alle 19 Jahre, die mit einem Jahr enden, das von 19 gleichmäßig teilbar ist, sind der dritte, sechste., 8., 11., 14., 17. und 19. Jahre.In every 19-year cycle that ends with a year that is evenly divisible by 19, the 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years are leap years. Ein gemeinsames Jahr kann zwischen 353 und 355 Tage liegen, abhängig von der Platzierung von jüdischen Feiertagen.A common year can have from 353 to 355 days, depending on the placement of Jewish holidays. Ein Schaltjahr kann zwischen 383 und 385 Tage betragen.A leap year can have from 383 to 385 days.