GregorianCalendar.MinSupportedDateTime プロパティ

定義

GregorianCalendar 型でサポートされている最も古い日付と時刻を取得します。

public:
 virtual property DateTime MinSupportedDateTime { DateTime get(); };
public override DateTime MinSupportedDateTime { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public override DateTime MinSupportedDateTime { get; }
member this.MinSupportedDateTime : DateTime
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.MinSupportedDateTime : DateTime
Public Overrides ReadOnly Property MinSupportedDateTime As DateTime

プロパティ値

型で GregorianCalendar サポートされている最も古い日付と時刻。これは、0001 年 1 月 1 日の最初の瞬間であり、 DateTime.MinValue と同じです。

属性

次のコード例では、カレンダーの最小値と最大値を取得します。

using namespace System;
using namespace System::Globalization;

int main()
{
   // Create an instance of the calendar.
   GregorianCalendar^ myCal = gcnew GregorianCalendar;
   Console::WriteLine( myCal );
   
   // Display the MinSupportedDateTime.
   DateTime myMin = myCal->MinSupportedDateTime;
   Console::WriteLine( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal->GetMonth( myMin ), myCal->GetDayOfMonth( myMin ), myCal->GetYear( myMin ) );
   
   // Display the MaxSupportedDateTime.
   DateTime myMax = myCal->MaxSupportedDateTime;
   Console::WriteLine( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal->GetMonth( myMax ), myCal->GetDayOfMonth( myMax ), myCal->GetYear( myMax ) );
}

/*
This code produces the following output.

System.Globalization.GregorianCalendar
MinSupportedDateTime: 01/01/0001
MaxSupportedDateTime: 12/31/9999

*/
using System;
using System.Globalization;

public class SamplesCalendar  {

   public static void Main()  {

      // Create an instance of the calendar.
      GregorianCalendar myCal = new GregorianCalendar();
      Console.WriteLine( myCal.ToString() );

      // Display the MinSupportedDateTime.
      DateTime myMin = myCal.MinSupportedDateTime;
      Console.WriteLine( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin) );

      // Display the MaxSupportedDateTime.
      DateTime myMax = myCal.MaxSupportedDateTime;
      Console.WriteLine( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax) );
   }
}


/*
This code produces the following output.

System.Globalization.GregorianCalendar
MinSupportedDateTime: 01/01/0001
MaxSupportedDateTime: 12/31/9999

*/
Imports System.Globalization

Public Class SamplesCalendar   

   Public Shared Sub Main()

      ' Create an instance of the calendar.
      Dim myCal As New GregorianCalendar()
      Console.WriteLine(myCal.ToString())

      ' Display the MinSupportedDateTime.
      Dim myMin As DateTime = myCal.MinSupportedDateTime
      Console.WriteLine("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin))

      ' Display the MaxSupportedDateTime.
      Dim myMax As DateTime = myCal.MaxSupportedDateTime
      Console.WriteLine("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax))

   End Sub

End Class


'This code produces the following output.
'
'System.Globalization.GregorianCalendar
'MinSupportedDateTime: 01/01/0001
'MaxSupportedDateTime: 12/31/9999

注釈

プロパティの MinSupportedDateTime 値は、0001 年 1 月 1 日の最初の瞬間ですが、グレゴリオ暦は 1582 年 10 月 15 日まで導入されず、ヨーロッパ大陸と世界中での導入が遅かった。 グレゴリオ暦を採用するまで、ヨーロッパ、アメリカ、オーストラリア大陸のほとんどの文化では、クラスによって表されるユリウス暦が JulianCalendar 使用されました。

適用対象