JulianCalendar.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

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

戻り値

Boolean

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

例外

year が暦でサポートされている範囲外です。

  • または - month が暦でサポートされている範囲外です。

  • または - era が暦でサポートされている範囲外です。

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

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

   }
}

/*
This code produces the following output.

2001:           False   False   False   False   False   False   False   False   False   False   False   False
2002:           False   False   False   False   False   False   False   False   False   False   False   False
2003:           False   False   False   False   False   False   False   False   False   False   False   False
2004:           False   False   False   False   False   False   False   False   False   False   False   False
2005:           False   False   False   False   False   False   False   False   False   False   False   False

*/
using System;
using System.Globalization;

public class SamplesJulianCalendar  {

   public static void Main()  {

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

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

/*
This code produces the following output.

2001:           False   False   False   False   False   False   False   False   False   False   False   False
2002:           False   False   False   False   False   False   False   False   False   False   False   False
2003:           False   False   False   False   False   False   False   False   False   False   False   False
2004:           False   False   False   False   False   False   False   False   False   False   False   False
2005:           False   False   False   False   False   False   False   False   False   False   False   False

*/
Imports System.Globalization

Public Class SamplesJulianCalendar   
   
   Public Shared Sub Main()

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

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

   End Sub

End Class


'This code produces the following output.
'
'2001:           False   False   False   False   False   False   False   False   False   False   False   False
'2002:           False   False   False   False   False   False   False   False   False   False   False   False
'2003:           False   False   False   False   False   False   False   False   False   False   False   False
'2004:           False   False   False   False   False   False   False   False   False   False   False   False
'2005:           False   False   False   False   False   False   False   False   False   False   False   False

注釈

グレゴリオ暦とは異なり、ユリウス暦は閏年を年として定義します。これは例外なく、4 つで均等に割り切れる年です。 したがって、カレンダーは 128 年ごとに 1 日ずつ不正確になります。 たとえば、1999 年は閏年ではありませんが、2000 年は閏年でした。 平年は 365 日で、閏年は 366 日です。

閏月は、閏年でのみ発生する月全体です。 ユリウス暦には閏月はありません。

適用対象

こちらもご覧ください