GregorianCalendar.MinSupportedDateTime Property

Definition

Gets the earliest date and time supported by the GregorianCalendar type.

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

Property Value

The earliest date and time supported by the GregorianCalendar type, which is the first moment of January 1, 0001 C.E. and is equivalent to DateTime.MinValue.

Attributes

Examples

The following code example gets the minimum value and the maximum value of the calendar.

C#
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

*/

Remarks

Although the value of the MinSupportedDateTime property is the first moment of January 1, 0001 C.E., the Gregorian calendar was not introduced until October 15, 1582, and its adoption throughout the European continent and worldwide was slow. Until they adopted the Gregorian calendar, most cultures in the European, American, and Australian continents used the Julian calendar, which is represented by the JulianCalendar class.

Applies to

Product Versions
.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, 10
.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