Aracılığıyla paylaş


GregorianCalendar.MinSupportedDateTime Özellik

Tanım

Türü tarafından GregorianCalendar desteklenen en erken tarih ve saati alır.

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

Özellik Değeri

Türü tarafından GregorianCalendar desteklenen en erken tarih ve saat, 1 Ocak 0001 C.E.'nin ilk anıdır ve DateTime.MinValue ile eşdeğerdir.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, takvimin en düşük değerini ve en büyük değerini alır.

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.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

End Class


'This code produces the following output.
'
'System.Globalization.GregorianCalendar
'MinSupportedDateTime: 01/01/0001
'MaxSupportedDateTime: 12/31/9999

Açıklamalar

Özelliğin MinSupportedDateTime değeri 1 Ocak 0001 C.E.'nin ilk anı olmasına rağmen Gregoryen takvim 15 Ekim 1582'ye kadar tanıtılmamıştır ve Avrupa kıtası ve dünya genelinde benimsenmesi yavaştı. Gregoryen takvimi benimseyene kadar Avrupa, Amerika ve Avustralya kıtalarındaki kültürlerin çoğu sınıf tarafından temsil edilen Jülyen takvimini JulianCalendar kullandı.

Şunlara uygulanır