GregorianCalendar.MinSupportedDateTime GregorianCalendar.MinSupportedDateTime GregorianCalendar.MinSupportedDateTime GregorianCalendar.MinSupportedDateTime Property

Definición

Obtiene la primera fecha y hora admitidas por la GregorianCalendar tipo.Gets the earliest date and time supported by the GregorianCalendar type.

public:
 virtual property DateTime MinSupportedDateTime { DateTime get(); };
[System.Runtime.InteropServices.ComVisible(false)]
public override DateTime MinSupportedDateTime { get; }
member this.MinSupportedDateTime : DateTime
Public Overrides ReadOnly Property MinSupportedDateTime As DateTime

Valor de propiedad

La primera fecha y hora admitidas por la GregorianCalendar tipo, que es el primer instante del 1 de enero de 0001 d. de c.The earliest date and time supported by the GregorianCalendar type, which is the first moment of January 1, 0001 C.E. y es equivalente a MinValue.and is equivalent to MinValue.

Ejemplos

El ejemplo de código siguiente obtiene el valor mínimo y el valor máximo del calendario.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

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

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

Comentarios

Aunque el valor de la MinSupportedDateTime propiedad es el primer momento del 1 de enero de 0001 d. de c., no se ha introducido el calendario gregoriano hasta el 15 de octubre de 1582 y su adopción en todo el Europea continent y en todo el mundo era lento.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. Hasta que adopte el calendario gregoriano, referencias culturales de la mayoría de los continentes Europa, América y australiana usan el calendario juliano, que está representado por la JulianCalendar clase.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.

Se aplica a