JapaneseCalendar.MinSupportedDateTime プロパティ

定義

現在の JapaneseCalendar オブジェクトでサポートされている最も古い日付と時刻を取得します。

C#
public override DateTime MinSupportedDateTime { get; }
C#
[System.Runtime.InteropServices.ComVisible(false)]
public override DateTime MinSupportedDateTime { get; }

プロパティ値

型で JapaneseCalendar サポートされている最も古い日付と時刻。これは、グレゴリオ暦の 1868 年 9 月 8 日の最初の瞬間に相当します。

属性

次の例では、カレンダーでサポートされている最も古い日付と最新の日付を取得します。

C#
using System;
using System.Globalization;

public class SamplesCalendar  {

   public static void Main()  {

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

      // Create an instance of the GregorianCalendar.
      GregorianCalendar myGre = new GregorianCalendar();

      // Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
      DateTime myMin = myCal.MinSupportedDateTime;
      Console.Write( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin) );
      Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin) );

      // Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
      DateTime myMax = myCal.MaxSupportedDateTime;
      Console.Write( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax) );
      Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax) );
   }
}


/*
This code produces the following output.

System.Globalization.JapaneseCalendar
MinSupportedDateTime: 09/08/0001 (in Gregorian, 09/08/1868)
MaxSupportedDateTime: 12/31/8011 (in Gregorian, 12/31/9999)

*/

注釈

クラスで JapaneseCalendar サポートされている最も古い日付は、明治の最初の年の1868年9月8日です。 通常、 クラスを使用する日付と時刻の JapaneseCalendar 操作では、この日付より前の日付に対して ArgumentOutOfRangeException 例外がスローされます。 ただし、メソッドなどの一部のメンバーは GetEra 、明治1年の1868年1月1日から9月7日までのサポート日です。

適用対象

製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0