GregorianCalendar.MaxSupportedDateTime プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

[ComVisibleAttribute(false)] public: virtual property DateTime MaxSupportedDateTime { DateTime get () override; }
GregorianCalendar 型でサポートされている最も新しい日付と時刻。これは、紀元 9999 年 12 月 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 */

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- GregorianCalendar.MaxSupportedDateTime プロパティのページへのリンク