JulianCalendar.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
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 SamplesJulianCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

2001:           False   False   False   False   False   False   False   False   False   False   False   False
2002:           False   False   False   False   False   False   False   False   False   False   False   False
2003:           False   False   False   False   False   False   False   False   False   False   False   False
2004:           False   False   False   False   False   False   False   False   False   False   False   False
2005:           False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesJulianCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'2001:           False   False   False   False   False   False   False   False   False   False   False   False
'2002:           False   False   False   False   False   False   False   False   False   False   False   False
'2003:           False   False   False   False   False   False   False   False   False   False   False   False
'2004:           False   False   False   False   False   False   False   False   False   False   False   False
'2005:           False   False   False   False   False   False   False   False   False   False   False   False

Commenti

A differenza del calendario gregoriano, il calendario julian definisce un anno bisestile come anno che è uniformemente divisibile per quattro senza eccezioni. Pertanto, il calendario è impreciso di un giorno ogni 128 anni. Ad esempio, l'anno 1999 non era un anno bisestile, ma l'anno 2000 era. 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 julian non ha mesi bisestile.

Si applica a

Vedi anche