This documentation is archived and is not being maintained.
GregorianCalendar::MaxSupportedDateTime Property
Visual Studio 2010
Gets the latest date and time supported by the GregorianCalendar type.
Assembly: mscorlib (in mscorlib.dll)
[ComVisibleAttribute(false)] public: virtual property DateTime MaxSupportedDateTime { DateTime get () override; }
Property Value
Type: System::DateTimeThe latest date and time supported by the GregorianCalendar type, which is the last moment of December 31, 9999 C.E. and is equivalent to MaxValue.
The following code example gets the minimum value and the maximum value of the calendar.
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 */
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: