TaiwanCalendar.IsLeapMonth(Int32, Int32, Int32) Metodo

Definizione

Determina se il mese specificato nell'anno specificato dell'era specificata è intercalare.

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

Parametri

year
Int32

Valore intero che rappresenta l'anno.

month
Int32

Valore intero compreso tra 1 e 12 che rappresenta il mese.

era
Int32

Valore intero che rappresenta l'era.

Restituisce

Questo metodo restituisce sempre false, a meno che non venga sottoposto a override da una classe derivata.

Eccezioni

year non è compreso nell'intervallo supportato dal calendario.

-oppure-

month non è compreso nell'intervallo supportato dal calendario.

-oppure-

era non è compreso nell'intervallo supportato dal calendario.

Esempio

L'esempio seguente richiede IsLeapMonth tutti i mesi in cinque anni nell'era corrente.

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

Commenti

Gli anni bisestili nel calendario taiwanese corrispondono agli stessi anni intercalare nel calendario gregoriano. Un anno bisestile nel calendario gregoriano è definito come anno gregoriano che è divisibile in modo uniforme per quattro, tranne se è divisibile per 100. Tuttavia, gli anni gregoriani divisibili per 400 sono anni bisestili. Un anno comune ha 365 giorni e un anno bisestile ha 366 giorni.

Un mese bisestile è un mese intero che si verifica solo in un anno bisestile. Il calendario taiwanese non ha mesi intercalari.

Si applica a

Vedi anche