Export (0) Print
Expand All

UmAlQuraCalendar.IsLeapMonth Method (Int32, Int32, Int32)

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
Not applicable.

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 class does not support the notion of a leap month.

Exception typeCondition

ArgumentOutOfRangeException

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

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft