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

   }
}

/*
This code produces the following output.

90:             False   False   False   False   False   False   False   False   False   False   False   False
91:             False   False   False   False   False   False   False   False   False   False   False   False
92:             False   False   False   False   False   False   False   False   False   False   False   False
93:             False   False   False   False   False   False   False   False   False   False   False   False
94:             False   False   False   False   False   False   False   False   False   False   False   False

*/
using System;
using System.Globalization;

public class SamplesTaiwanCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

90:             False   False   False   False   False   False   False   False   False   False   False   False
91:             False   False   False   False   False   False   False   False   False   False   False   False
92:             False   False   False   False   False   False   False   False   False   False   False   False
93:             False   False   False   False   False   False   False   False   False   False   False   False
94:             False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesTaiwanCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'90:             False   False   False   False   False   False   False   False   False   False   False   False
'91:             False   False   False   False   False   False   False   False   False   False   False   False
'92:             False   False   False   False   False   False   False   False   False   False   False   False
'93:             False   False   False   False   False   False   False   False   False   False   False   False
'94:             False   False   False   False   False   False   False   False   False   False   False   False

注釈

台湾暦の閏年は、グレゴリオ暦の同じ閏年に対応します。 グレゴリオ暦の閏年は、100 で割り切れる場合を除き、4 で割り切れるグレゴリオ暦の年として定義されます。 ただし、400 で割り切れるグレゴリオ暦の年は閏年です。 平年は 365 日で、閏年は 366 日です。

閏月は閏年でのみ発生する月全体です。 台湾カレンダーには閏月はありません。

適用対象

こちらもご覧ください