JapaneseCalendar.MinSupportedDateTime Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene la data e l'ora meno aggiornate supportate dall'oggetto corrente JapaneseCalendar .
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
Valore della proprietà
La data e l'ora meno recenti supportate dal tipo JapaneseCalendar, che equivale al primo momento del 23 ottobre 1868 C.E. nel calendario gregoriano (o in .NET 10 e versioni precedenti, 8 settembre 1868 C.E.).
- Attributi
Esempio
Nell'esempio seguente vengono recuperate le date più recenti e meno recenti supportate dal calendario.
// Create an instance of the calendar.
JapaneseCalendar myCal = new();
Console.WriteLine(myCal.ToString());
// Create an instance of the GregorianCalendar.
GregorianCalendar myGre = new();
// 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 on .NET 11.
System.Globalization.JapaneseCalendar
MinSupportedDateTime: 10/23/0001 (in Gregorian, 10/23/1868)
MaxSupportedDateTime: 12/31/7981 (in Gregorian, 12/31/9999)
*/
' Create an instance of the calendar.
Dim myCal As New JapaneseCalendar()
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 Date = 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 Date = 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 on .NET 11.
'
'System.Globalization.JapaneseCalendar
'MinSupportedDateTime: 10/23/0001 (in Gregorian, 10/23/1868)
'MaxSupportedDateTime: 12/31/7981 (in Gregorian, 12/31/9999)
Commenti
La prima data supportata dalla classe è il JapaneseCalendar 23 ottobre 1868 C.E., nel primo anno dell'era Meiji. In genere, le operazioni di data e ora che usano la JapaneseCalendar classe generano un'eccezione ArgumentOutOfRangeException per le date precedenti a questa data. Tuttavia, alcuni membri, come il GetEra metodo, date di supporto dal 1° gennaio 1868 al 22 ottobre nell'anno Meiji 1.
Note
Nelle versioni di .NET Framework e in .NET Core da 1.0 a .NET 10, questa proprietà restituisce una data e un'ora che rappresenta il primo momento dell'8 settembre 1868 C.E. nel calendario gregoriano.