KoreanCalendar.IsLeapMonth(Int32, Int32, Int32) メソッド

定義

指定した年の指定した年の指定した月が閏月かどうかを判断します。

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

パラメーター

year
Int32

年を表す整数。

month
Int32

月を表す 1 ~ 12 の整数。

era
Int32

時代 (年号) を表す整数。

返品

派生クラスによってオーバーライドされない限り、このメソッドは常に falseを返します。

例外

year がカレンダーでサポートされている範囲外です。

-又は-

month がカレンダーでサポートされている範囲外です。

-又は-

era がカレンダーでサポートされている範囲外です。

次の例では、現在の時代 (年号) の 5 年間のすべての月の IsLeapMonth を呼び出します。

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

注釈

韓国暦の閏年は、グレゴリオ暦の同じ閏年に対応します。 グレゴリオ暦の閏年は、100 で割り切れる場合を除き、4 つで均等に割り切れるグレゴリオ暦の年として定義されます。 ただし、400 で割り切れるグレゴリオ暦の年は閏年です。 一般的な年は 365 日、閏年は 366 日です。

閏月は、閏年でのみ発生する月全体です。 韓国の暦には閏月はありません。

適用対象

こちらもご覧ください