Export (0) Print
Expand All

UmAlQuraCalendar.IsLeapMonth Method (Int32, Int32, Int32)

Note: This method is new in the .NET Framework version 2.0.

Determines whether the specified month in the specified year and era is a leap month.

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)

public override bool IsLeapMonth (
	int year,
	int month,
	int era
)
public boolean IsLeapMonth (
	int year, 
	int month, 
	int era
)
public override function IsLeapMonth (
	year : int, 
	month : int, 
	era : int
) : boolean

Parameters

year

A year.

month

An integer from 1 through 12 that represents a month.

era

An era. Specify CurrentEra or UmAlQuraEra.

Return Value

The return value is always false because the UmAlQuraCalendar type does not support the notion of a leap month.

Exception typeCondition

ArgumentOutOfRangeException

year, month, or era is outside the range supported by the UmAlQuraCalendar type.

A leap month is an entire month that occurs only in a leap year.

The following code example calls IsLeapMonth for all the months in five years in the current era.

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

*/

import System.* ;
import System.Globalization.* ;

public class SamplesHijriCalendar
{
    public static void main(String[] args)
    {
        // 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",System.Convert.ToString (y));
            iMonthsInYear = myCal.GetMonthsInYear(y, HijriCalendar.CurrentEra);
            for(int m=1; m <= iMonthsInYear; m++) {
                Console.Write("\t{0}", System.Convert.ToString (
                    myCal.IsLeapMonth(y, m, HijriCalendar.CurrentEra)));
            } 
            Console.WriteLine();
        } 
    } //main
} //SamplesHijriCalendar

/*
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
*/

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft