TaiwanCalendar.IsLeapMonth(Int32, Int32, Int32) Methode

Definition

Bestimmt, ob der angegebene Monat des angegebenen Jahres im angegebenen Zeitraum ein Schaltmonat ist.

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

Parameter

year
Int32

Eine ganze Zahl, die das Jahr darstellt.

month
Int32

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

era
Int32

Eine ganze Zahl, die den Zeitraum darstellt.

Gibt zurück

Boolean

Diese Methode gibt immer false zurück, sofern sie nicht von einer abgeleiteten Klasse überschrieben wurde.

Ausnahmen

year liegt außerhalb des Bereichs, der vom Kalender unterstützt wird.

  • oder - month liegt außerhalb des Bereichs, der vom Kalender unterstützt wird.

  • oder - era liegt außerhalb des Bereichs, der vom Kalender unterstützt wird.

Beispiele

Im folgenden Beispiel werden alle Monate in fünf Jahren in der aktuellen Ära aufgerufen IsLeapMonth .

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

   }
}

/*
This code produces the following output.

90:             False   False   False   False   False   False   False   False   False   False   False   False
91:             False   False   False   False   False   False   False   False   False   False   False   False
92:             False   False   False   False   False   False   False   False   False   False   False   False
93:             False   False   False   False   False   False   False   False   False   False   False   False
94:             False   False   False   False   False   False   False   False   False   False   False   False

*/
using System;
using System.Globalization;

public class SamplesTaiwanCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

90:             False   False   False   False   False   False   False   False   False   False   False   False
91:             False   False   False   False   False   False   False   False   False   False   False   False
92:             False   False   False   False   False   False   False   False   False   False   False   False
93:             False   False   False   False   False   False   False   False   False   False   False   False
94:             False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesTaiwanCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'90:             False   False   False   False   False   False   False   False   False   False   False   False
'91:             False   False   False   False   False   False   False   False   False   False   False   False
'92:             False   False   False   False   False   False   False   False   False   False   False   False
'93:             False   False   False   False   False   False   False   False   False   False   False   False
'94:             False   False   False   False   False   False   False   False   False   False   False   False

Hinweise

Schaltjahre im Taiwan-Kalender entsprechen demselben Schaltjahr im gregorianischen Kalender. Ein Schaltjahr im Gregorianischen Kalender wird als gregorianisches Jahr definiert, das sogar von vier teilbar ist, außer wenn es um 100 teilbar ist. Gregorianische Jahre, die von 400 teilbar sind, sind jedoch Sprungjahre. Ein allgemeines Jahr verfügt über 365 Tage und ein Schaltjahr hat 366 Tage.

Ein Schaltmonat ist ein ganzes Monat, der nur in einem Schaltjahr auftritt. Der Taiwan-Kalender hat keine Sprungmonate.

Gilt für:

Siehe auch