TaiwanCalendar.MinSupportedDateTime プロパティ

定義

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

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

プロパティ値

クラスで TaiwanCalendar サポートされている最も古い日時。これは、グレゴリオ暦の 1912 年 1 月 1 日の最初の瞬間に相当します。

属性

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

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Create an instance of the calendar.
   TaiwanCalendar^ myCal = gcnew TaiwanCalendar;
   Console::WriteLine( myCal );
   
   // Create an instance of the GregorianCalendar.
   GregorianCalendar^ myGre = gcnew 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.TaiwanCalendar
MinSupportedDateTime: 01/01/0001 (in Gregorian, 01/01/1912)
MaxSupportedDateTime: 12/31/8088 (in Gregorian, 12/31/9999)

*/
using System;
using System.Globalization;

public class SamplesCalendar  {

   public static void Main()  {

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

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

      // Display the MinValue 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 MaxValue 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.TaiwanCalendar
MinSupportedDateTime: 01/01/0001 (in Gregorian, 01/01/1912)
MaxSupportedDateTime: 12/31/8088 (in Gregorian, 12/31/9999)

*/
Imports System.Globalization

Public Class SamplesCalendar   

   Public Shared Sub Main()

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

      ' Create an instance of the GregorianCalendar.
      Dim myGre As New GregorianCalendar()

      ' Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
      Dim myMin As DateTime = 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.
      Dim myMax As DateTime = 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))

   End Sub

End Class


'This code produces the following output.
'
'System.Globalization.TaiwanCalendar
'MinSupportedDateTime: 01/01/0001 (in Gregorian, 01/01/1912)
'MaxSupportedDateTime: 12/31/8088 (in Gregorian, 12/31/9999)

注釈

Microsoft Visual Basic は、 でDateTimeサポートされている最小日付 (0001 年 1 月 1 日) に指定された時刻として時刻を表します。ただし、 クラスはTaiwanCalendar、その最小日付をサポートしていません。 そのため、現在のカレンダーを使用して時刻を書式設定するメソッドをアプリケーションで呼び出しても書式指定子を指定しない場合、書式設定では、既定の一般的な ("G") 日付/時刻パターン書式指定子ではなく、ISO 8601 並べ替え可能な ("s") 日付/時刻パターン書式指定子が使用されます。 詳細については、「 標準の日付と時刻の書式指定文字列」を参照してください。

適用対象