HijriCalendar.MaxSupportedDateTime Właściwość
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Pobiera najnowszą datę i godzinę obsługiwaną przez ten kalendarz.
public:
virtual property DateTime MaxSupportedDateTime { DateTime get(); };
public override DateTime MaxSupportedDateTime { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public override DateTime MaxSupportedDateTime { get; }
member this.MaxSupportedDateTime : DateTime
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.MaxSupportedDateTime : DateTime
Public Overrides ReadOnly Property MaxSupportedDateTime As DateTime
Wartość właściwości
Najnowsza data i godzina obsługiwana przez HijriCalendar typ, który jest odpowiednikiem ostatniej chwili 31 grudnia 9999 C.E. w kalendarzu gregoriańskim.
- Atrybuty
Przykłady
Poniższy przykład kodu pobiera wartość minimalną i maksymalną wartość kalendarza.
using namespace System;
using namespace System::Globalization;
int main()
{
// Create an instance of the calendar.
HijriCalendar^ myCal = gcnew HijriCalendar;
Console::WriteLine( myCal );
// Create an instance of the GregorianCalendar.
GregorianCalendar^ myGre = gcnew GregorianCalendar;
// Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
DateTime myMin = myCal->MinSupportedDateTime;
Console::Write( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal->GetMonth( myMin ), myCal->GetDayOfMonth( myMin ), myCal->GetYear( myMin ) );
Console::WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre->GetMonth( myMin ), myGre->GetDayOfMonth( myMin ), myGre->GetYear( myMin ) );
// Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
DateTime myMax = myCal->MaxSupportedDateTime;
Console::Write( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal->GetMonth( myMax ), myCal->GetDayOfMonth( myMax ), myCal->GetYear( myMax ) );
Console::WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre->GetMonth( myMax ), myGre->GetDayOfMonth( myMax ), myGre->GetYear( myMax ) );
}
/*
This code produces the following output.
System.Globalization.HijriCalendar
MinSupportedDateTime: 01/01/0001 (in Gregorian, 07/18/0622)
MaxSupportedDateTime: 04/03/9666 (in Gregorian, 12/31/9999)
*/
using System;
using System.Globalization;
public class SamplesCalendar {
public static void Main() {
// Create an instance of the calendar.
HijriCalendar myCal = new HijriCalendar();
Console.WriteLine( myCal.ToString() );
// Create an instance of the GregorianCalendar.
GregorianCalendar myGre = new GregorianCalendar();
// Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
DateTime myMin = myCal.MinSupportedDateTime;
Console.Write( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin) );
Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin) );
// Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
DateTime myMax = myCal.MaxSupportedDateTime;
Console.Write( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax) );
Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax) );
}
}
/*
This code produces the following output.
System.Globalization.HijriCalendar
MinSupportedDateTime: 01/01/0001 (in Gregorian, 07/18/0622)
MaxSupportedDateTime: 04/03/9666 (in Gregorian, 12/31/9999)
*/
Imports System.Globalization
Public Class SamplesCalendar
Public Shared Sub Main()
' Create an instance of the calendar.
Dim myCal As New HijriCalendar()
Console.WriteLine(myCal.ToString())
' Create an instance of the GregorianCalendar.
Dim myGre As New GregorianCalendar()
' Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
Dim myMin As DateTime = myCal.MinSupportedDateTime
Console.Write("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin))
Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin))
' Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
Dim myMax As DateTime = myCal.MaxSupportedDateTime
Console.Write("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax))
Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax))
End Sub
End Class
'This code produces the following output.
'
'System.Globalization.HijriCalendar
'MinSupportedDateTime: 01/01/0001 (in Gregorian, 07/18/0622)
'MaxSupportedDateTime: 04/03/9666 (in Gregorian, 12/31/9999)
Uwagi
31 grudnia 9999 R. jest odpowiednikiem trzeciego dnia 4 miesiąca roku 9666 w kalendarzu Hidżri.