HijriCalendar.IsLeapMonth(Int32, Int32, Int32) Metodo

Definizione

Determina se il mese specificato nell'anno e nell'era specificati è 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.

Eccezioni

era non è compreso nell'intervallo supportato dal calendario.

-oppure-

year non è compreso nell'intervallo supportato dal calendario.

-oppure-

month non è compreso nell'intervallo supportato dal calendario.

Esempio

L'esempio di codice seguente chiama IsLeapMonth tutti i mesi in cinque anni nell'era corrente.

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

   }
}

/*
This code produces the following output.

1421:           False   False   False   False   False   False   False   False   False   False   False   False
1422:           False   False   False   False   False   False   False   False   False   False   False   False
1423:           False   False   False   False   False   False   False   False   False   False   False   False
1424:           False   False   False   False   False   False   False   False   False   False   False   False
1425:           False   False   False   False   False   False   False   False   False   False   False   False

*/
using System;
using System.Globalization;

public class SamplesHijriCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

1421:           False   False   False   False   False   False   False   False   False   False   False   False
1422:           False   False   False   False   False   False   False   False   False   False   False   False
1423:           False   False   False   False   False   False   False   False   False   False   False   False
1424:           False   False   False   False   False   False   False   False   False   False   False   False
1425:           False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesHijriCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'1421:           False   False   False   False   False   False   False   False   False   False   False   False
'1422:           False   False   False   False   False   False   False   False   False   False   False   False
'1423:           False   False   False   False   False   False   False   False   False   False   False   False
'1424:           False   False   False   False   False   False   False   False   False   False   False   False
'1425:           False   False   False   False   False   False   False   False   False   False   False   False

Commenti

In ogni ciclo di 30 anni che termina con un anno che è uniformemente divisibile per 30, il 2°, 5°, 7°, 10°, 13°, 16°, 18°, 21, 24, 26 e 29 anni sono anni intercalati. Un anno comune ha 354 giorni e un anno bisestile ha 355 giorni.

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

Si applica a

Vedi anche