GregorianCalendar.MaxSupportedDateTime プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GregorianCalendar.MaxSupportedDateTime プロパティの意味・解説 

GregorianCalendar.MaxSupportedDateTime プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

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

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(False)> _
Public Overrides ReadOnly
 Property MaxSupportedDateTime As DateTime
Dim instance As GregorianCalendar
Dim value As DateTime

value = instance.MaxSupportedDateTime
[ComVisibleAttribute(false)] 
public override DateTime MaxSupportedDateTime { get;
 }
[ComVisibleAttribute(false)] 
public:
virtual property DateTime MaxSupportedDateTime {
    DateTime get () override;
}
/** @property */
public DateTime get_MaxSupportedDateTime ()
public override function get
 MaxSupportedDateTime () : DateTime

プロパティ
GregorianCalendar 型でサポートされている最も新し日付と時刻。これは、紀元 999912 月 31 日最後の瞬間であり、MaxValue と等価です。

使用例使用例

カレンダー最小値および最大値取得するコードの例次に示します

Imports System
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 'Main 

End Class 'SamplesCalendar


'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

*/
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

*/
import System.*;
import 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.get_MinSupportedDateTime();
        Console.WriteLine("MinSupportedDateTime: {0}/{1}/{2}", 
            ((System.Int32)myCal.GetMonth(myMin)).ToString("D2"), 
            ((System.Int32)myCal.GetDayOfMonth(myMin)).ToString("D2"),
 
            ((System.Int32)myCal.GetYear(myMin)).ToString("D4"));

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

/*
This code produces the following output.

System.Globalization.GregorianCalendar
MinSupportedDateTime: 01/01/0001
MaxSupportedDateTime: 12/31/9999
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

GregorianCalendar.MaxSupportedDateTime プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GregorianCalendar.MaxSupportedDateTime プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS