JapaneseCalendar.MinSupportedDateTime Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft das früheste Datum und die früheste Uhrzeit ab, die vom aktuellen JapaneseCalendar Objekt unterstützt wird.
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
Eigenschaftswert
Das früheste Datum und die uhrzeit, das vom typ JapaneseCalendar unterstützt wird, das dem ersten Moment vom 23. Oktober 1868 C.E. im gregorianischen Kalender entspricht (oder in .NET 10 und früheren Versionen, 8. September 1868 C.E.).
- Attribute
Beispiele
Im folgenden Beispiel werden die frühesten und neuesten Datumsangaben vom Kalender unterstützt.
// 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)
Hinweise
Das früheste Von der JapaneseCalendar Klasse unterstützte Datum ist der 23. Oktober 1868 C.E., im ersten Jahr der Meiji-Ära. Ordinarily, date and time operations that use the JapaneseCalendar class throw an ArgumentOutOfRangeException exception for dates before this date. Einige Mitglieder, z. B. die GetEra Methode, unterstützen jedoch datumsangaben vom 1. Januar 1868 bis Oktober 22 im Jahr Meiji 1.
Note
In .NET Framework-Versionen und in .NET Core 1.0 bis .NET 10 gibt diese Eigenschaft ein Datum und eine Uhrzeit zurück, die den ersten Moment vom 8. September 1868 C.E. im gregorianischen Kalender darstellt.