KoreanCalendar.IsLeapMonth(Int32, Int32, Int32) Metodo

Definizione

Determina se il mese specificato nell'anno specificato nell'era specificata è un mese bisestile.

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

Intero che rappresenta l'anno.

month
Int32

Intero compreso tra 1 e 12 che rappresenta il mese.

era
Int32

Intero che rappresenta l'era.

Valori restituiti

Questo metodo restituisce falsesempre , 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 chiama IsLeapMonth tutti i mesi in cinque anni nell'era corrente.

using System;
using System.Globalization;

public class SamplesKoreanCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

4334:           False   False   False   False   False   False   False   False   False   False   False   False
4335:           False   False   False   False   False   False   False   False   False   False   False   False
4336:           False   False   False   False   False   False   False   False   False   False   False   False
4337:           False   False   False   False   False   False   False   False   False   False   False   False
4338:           False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesKoreanCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'4334:           False   False   False   False   False   False   False   False   False   False   False   False
'4335:           False   False   False   False   False   False   False   False   False   False   False   False
'4336:           False   False   False   False   False   False   False   False   False   False   False   False
'4337:           False   False   False   False   False   False   False   False   False   False   False   False
'4338:           False   False   False   False   False   False   False   False   False   False   False   False

Commenti

Gli anni bisestili nel calendario coreano corrispondono agli stessi anni bisestili 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 coreano non ha mesi intercalari.

Si applica a

Vedi anche