JapaneseCalendar.IsLeapMonth(Int32, Int32, Int32) JapaneseCalendar.IsLeapMonth(Int32, Int32, Int32) JapaneseCalendar.IsLeapMonth(Int32, Int32, Int32) JapaneseCalendar.IsLeapMonth(Int32, Int32, Int32) Method

定義

指定した時代 (年号) の指定した年の指定した月が閏月かどうかを確認します。Determines whether the specified month in the specified year in the specified era is a leap month.

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 Int32 Int32 Int32

年を表す整数。An integer that represents the year.

month
Int32 Int32 Int32 Int32

月を表す 1 から 12 の整数。An integer from 1 to 12 that represents the month.

era
Int32 Int32 Int32 Int32

時代 (年号) を表す整数。An integer that represents the era.

戻り値

このメソッドは、派生クラスでオーバーライドされない限り、常に false を返します。This method always returns false, unless overridden by a derived class.

例外

year がカレンダーでサポートされている範囲外です。year is outside the range supported by the calendar.

または-or- month がカレンダーでサポートされている範囲外です。month is outside the range supported by the calendar.

または-or- era がカレンダーでサポートされている範囲外です。era is outside the range supported by the calendar.

次の例ではIsLeapMonthの現在の時代 (年号) の最初の 5 年間のすべての月。The following example calls IsLeapMonth for all the months in the first five years in the current era.

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

   }
}

/*
This code produces the following output.

1:              False   False   False   False   False   False   False   False   False   False   False   False
2:              False   False   False   False   False   False   False   False   False   False   False   False
3:              False   False   False   False   False   False   False   False   False   False   False   False
4:              False   False   False   False   False   False   False   False   False   False   False   False
5:              False   False   False   False   False   False   False   False   False   False   False   False

*/
using System;
using System.Globalization;


public class SamplesJapaneseCalendar  {

   public static void Main()  {

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

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

   }

}

/*
This code produces the following output.

1:              False   False   False   False   False   False   False   False   False   False   False   False
2:              False   False   False   False   False   False   False   False   False   False   False   False
3:              False   False   False   False   False   False   False   False   False   False   False   False
4:              False   False   False   False   False   False   False   False   False   False   False   False
5:              False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic

Public Class SamplesJapaneseCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub 'Main 

End Class 'SamplesJapaneseCalendar


'This code produces the following output.

'

'1:              False   False   False   False   False   False   False   False   False   False   False   False

'2:              False   False   False   False   False   False   False   False   False   False   False   False

'3:              False   False   False   False   False   False   False   False   False   False   False   False

'4:              False   False   False   False   False   False   False   False   False   False   False   False

'5:              False   False   False   False   False   False   False   False   False   False   False   False


注釈

和暦の閏年は、グレゴリオ暦の閏年と同じ年に対応します。Leap years in the Japanese calendar correspond to the same leap years in the Gregorian calendar. グレゴリオ暦の閏年は、100 で割り切れる場合を除き、4 で割り切れるグレゴリオ暦の年として定義されます。A leap year in the Gregorian calendar is defined as a Gregorian year that is evenly divisible by four, except if it is divisible by 100. ただし、400 で割り切れるグレゴリオ暦の年は閏年です。However, Gregorian years that are divisible by 400 are leap years. 平年は 365 日で、閏年は 366 日です。A common year has 365 days and a leap year has 366 days.

閏月が閏年でのみ発生する月全体です。A leap month is an entire month that occurs only in a leap year. 日本語の予定表には、閏月がありません。The Japanese calendar does not have any leap months.

適用対象

こちらもご覧ください