Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1779 lines (1592 sloc) 114 KB
<Type Name="JapaneseCalendar" FullName="System.Globalization.JapaneseCalendar">
<TypeSignature Language="C#" Value="public class JapaneseCalendar : System.Globalization.Calendar" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit JapaneseCalendar extends System.Globalization.Calendar" />
<TypeSignature Language="DocId" Value="T:System.Globalization.JapaneseCalendar" />
<TypeSignature Language="VB.NET" Value="Public Class JapaneseCalendar&#xA;Inherits Calendar" />
<TypeSignature Language="C++ CLI" Value="public ref class JapaneseCalendar : System::Globalization::Calendar" />
<TypeSignature Language="F#" Value="type JapaneseCalendar = class&#xA; inherit Calendar" />
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Globalization.Calendar</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents the Japanese calendar.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The Japanese calendar, which is also known as the Wareki calendar, works exactly like the Gregorian calendar, except that the year and era are different.
> [!NOTE]
> For information about using the <xref:System.Globalization.JapaneseCalendar> class and the other calendar classes in .NET, see [Working with Calendars](~/docs/standard/datetime/working-with-calendars.md).
The Japanese calendar recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen. By default, formatting operations with specified date and time format strings, such as "D", "F", and "Y", output Gannen rather than "1" in the result string.
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]
This class assigns numbers to the eras as follows:
|GetEra value|Era Name|Era Abbreviation|Gregorian Dates|
|------------------|--------------|----------------------|---------------------|
|5|令和 (Reiwa)|令和 (R, r)|May 1, 2019 to present|
|4|平成 (Heisei)|平 (H, h)|January 8, 1989 to April 30, 2019|
|3|昭和 (Showa)|昭 (S, s)|December 25, 1926 to January 7, 1989|
|2|大正 (Taisho)|大 (T, t)|July 30, 1912 to December 24, 1926|
|1|明治 (Meiji)|明 (M, m)|September 8, 1868 to July 29, 1912|
This class handles dates from September 8 in the year Meiji 1 (in the Gregorian calendar, September 8, 1868). Although the Japanese calendar was switched from a lunar calendar to a solar calendar in the year Meiji 6 (1873 of the Gregorian calendar), this implementation is based on the solar calendar only.
Leap years in the Japanese calendar correspond to the same leap years in the Gregorian calendar. A leap year in the Gregorian calendar is defined as a Gregorian year that is evenly divisible by four, except if it is divisible by 100. However, Gregorian years that are divisible by 400 are leap years. A common year has 365 days and a leap year has 366 days.
The Japanese calendar has 12 months with 28 to 31 days each:
|GetMonth value|Month|English|Days in common years|Days in leap years|
|--------------------|-----------|-------------|--------------------------|------------------------|
|1|1月 (Ichigatsu)|January|31|31|
|2|2月 (Nigatsu)|February|28|29|
|3|3月 (Sangatsu)|March|31|31|
|4|4月 (Shigatsu)|April|30|30|
|5|5月 (Gogatsu)|May|31|31|
|6|6月 (Rokugatsu)|June|30|30|
|7|7月 (Shichigatsu)|July|31|31|
|8|8月 (Hachigatsu)|August|31|31|
|9|9月 (Kugatsu)|September|30|30|
|10|10月 (Juugatsu)|October|31|31|
|11|11月 (Juuichigatsu)|November|30|30|
|12|12月 (Juunigatsu)|December|31|31|
Nigatsu, which is equivalent to the Gregorian calendar month of February, has 29 days during leap years and 28 during common years.
The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the first day of Ichigatsu in the year Heisei 13 in the Japanese calendar.
If the <xref:System.Globalization.JapaneseCalendar> is the current calendar of the Japanese culture, <xref:System.DateTime.Parse%2A?displayProperty=nameWithType> recognizes the era abbreviations in front of the year. The abbreviation is either the single-character case-insensitive Latin alphabet abbreviation or the single-character Kanji abbreviation. xref:System.DateTime.Parse%2A?displayProperty=nameWithType> also recognizes either "1" or Gannen (元年) as the first year of an era.
Each <xref:System.Globalization.CultureInfo> object supports a set of calendars. The <xref:System.Globalization.CultureInfo.Calendar%2A> property returns the default calendar for the culture, and the <xref:System.Globalization.CultureInfo.OptionalCalendars%2A> property returns an array containing all the calendars supported by the culture. To change the calendar used by a <xref:System.Globalization.CultureInfo>, set the <xref:System.Globalization.DateTimeFormatInfo.Calendar%2A?displayProperty=nameWithType> property to a new <xref:System.Globalization.Calendar>.
]]></format>
</remarks>
<altmember cref="T:System.Globalization.Calendar" />
<altmember cref="T:System.Globalization.GregorianCalendar" />
<altmember cref="P:System.Globalization.CultureInfo.Calendar" />
<altmember cref="P:System.Globalization.CultureInfo.OptionalCalendars" />
<related type="Article" href="~/docs/standard/datetime/working-with-calendars.md">Working with Calendars</related>
<related type="ExternalDocumentation" href="https://code.msdn.microsoft.com/NET-Framework-4-Calendar-3360a84a">Sample: Calendar Week Range Utility</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public JapaneseCalendar ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; JapaneseCalendar();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Globalization.JapaneseCalendar" /> class.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.TypeInitializationException">Unable to initialize a <see cref="T:System.Globalization.JapaneseCalendar" /> object because of missing culture information.</exception>
</Docs>
</Member>
<Member MemberName="AddMonths">
<MemberSignature Language="C#" Value="public override DateTime AddMonths (DateTime time, int months);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance valuetype System.DateTime AddMonths(valuetype System.DateTime time, int32 months) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.AddMonths(System.DateTime,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function AddMonths (time As DateTime, months As Integer) As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override DateTime AddMonths(DateTime time, int months);" />
<MemberSignature Language="F#" Value="override this.AddMonths : DateTime * int -&gt; DateTime" Usage="japaneseCalendar.AddMonths (time, months)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
<Parameter Name="months" Type="System.Int32" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to which to add months.</param>
<param name="months">The number of months to add.</param>
<summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of months away from the specified <see cref="T:System.DateTime" />.</summary>
<returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of months to the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The day part of the resulting <xref:System.DateTime> is affected if the resulting day is not a valid day in the resulting month of the resulting year. It is changed to the last valid day in the resulting month of the resulting year. The year part of the resulting <xref:System.DateTime> is affected if the resulting month is outside the year of the specified <xref:System.DateTime>. The era part of the resulting <xref:System.DateTime> is affected if the resulting year is outside the era of the specified <xref:System.DateTime>. The time-of-day part of the resulting <xref:System.DateTime> remains the same as the specified <xref:System.DateTime>.
For example, if the specified month is Juugatsu (October), which has 31 days, the specified day is the 31st day of that month, and `months` is 6, the resulting year is one more than the specified year, the resulting month is Shigatsu (April), and the resulting day is the 30th day, which is the last day in Shigatsu (April).
If `months` is negative, the resulting <xref:System.DateTime> is earlier than the specified <xref:System.DateTime>.
The <xref:System.DateTime.Kind%2A> property of the returned <xref:System.DateTime> value always equals <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. You can preserve the <xref:System.DateTime.Kind%2A> property of the `time` parameter by calling the <xref:System.DateTime.SpecifyKind%2A?displayProperty=nameWithType> method, as the following example shows.
[!code-csharp[System.Globalization.Calendar.AddMethods#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs#5)]
[!code-vb[System.Globalization.Calendar.AddMethods#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/vb/add1.vb#5)]
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="months" /> is less than -120000.
-or-
<paramref name="months" /> is greater than 120000.</exception>
<altmember cref="T:System.DateTime" />
<altmember cref="M:System.Globalization.JapaneseCalendar.AddYears(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddWeeks(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddDays(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddHours(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddMinutes(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddSeconds(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddMilliseconds(System.DateTime,System.Double)" />
</Docs>
</Member>
<Member MemberName="AddYears">
<MemberSignature Language="C#" Value="public override DateTime AddYears (DateTime time, int years);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance valuetype System.DateTime AddYears(valuetype System.DateTime time, int32 years) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.AddYears(System.DateTime,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function AddYears (time As DateTime, years As Integer) As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override DateTime AddYears(DateTime time, int years);" />
<MemberSignature Language="F#" Value="override this.AddYears : DateTime * int -&gt; DateTime" Usage="japaneseCalendar.AddYears (time, years)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
<Parameter Name="years" Type="System.Int32" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to which to add years.</param>
<param name="years">The number of years to add.</param>
<summary>Returns a <see cref="T:System.DateTime" /> that is the specified number of years away from the specified <see cref="T:System.DateTime" />.</summary>
<returns>The <see cref="T:System.DateTime" /> that results from adding the specified number of years to the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The day part of the resulting <xref:System.DateTime> is affected if the resulting day is not a valid day in the resulting month of the resulting year. It is changed to the last valid day in the resulting month of the resulting year. The month part of the resulting <xref:System.DateTime> remains the same as the specified <xref:System.DateTime>. The era part of the resulting <xref:System.DateTime> is affected if the resulting year is outside the era of the specified <xref:System.DateTime>. The time-of-day part of the resulting <xref:System.DateTime> remains the same as the specified <xref:System.DateTime>.
For example, Nigatsu (February) has 28 days except during leap years when it has 29 days. If the specified date is the 29th day of Nigatsu (February) in a leap year and the value of `years` is 1, the resulting date will be the 28th day of Nigatsu (February) in the following year.
If `years` is negative, the resulting <xref:System.DateTime> is earlier than the specified <xref:System.DateTime>.
The <xref:System.DateTime.Kind%2A> property of the returned <xref:System.DateTime> value always equals <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. You can preserve the <xref:System.DateTime.Kind%2A> property of the `time` parameter by calling the <xref:System.DateTime.SpecifyKind%2A?displayProperty=nameWithType> method, as the following example shows.
[!code-csharp[System.Globalization.Calendar.AddMethods#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs#8)]
[!code-vb[System.Globalization.Calendar.AddMethods#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/vb/add1.vb#8)]
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The resulting <see cref="T:System.DateTime" /> is outside the supported range.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="time" /> is outside the supported range of the <see cref="T:System.Globalization.JapaneseCalendar" /> type.
-or-
<paramref name="years" /> is less than -10,000 or greater than 10,000.</exception>
<altmember cref="T:System.DateTime" />
<altmember cref="M:System.Globalization.JapaneseCalendar.AddMonths(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddWeeks(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddDays(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddHours(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddMinutes(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddSeconds(System.DateTime,System.Int32)" />
<altmember cref="M:System.Globalization.Calendar.AddMilliseconds(System.DateTime,System.Double)" />
</Docs>
</Member>
<Member MemberName="AlgorithmType">
<MemberSignature Language="C#" Value="public override System.Globalization.CalendarAlgorithmType AlgorithmType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Globalization.CalendarAlgorithmType AlgorithmType" />
<MemberSignature Language="DocId" Value="P:System.Globalization.JapaneseCalendar.AlgorithmType" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property AlgorithmType As CalendarAlgorithmType" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Globalization::CalendarAlgorithmType AlgorithmType { System::Globalization::CalendarAlgorithmType get(); };" />
<MemberSignature Language="F#" Value="member this.AlgorithmType : System.Globalization.CalendarAlgorithmType" Usage="System.Globalization.JapaneseCalendar.AlgorithmType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Globalization.CalendarAlgorithmType</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both.</summary>
<value>Always returns <see cref="F:System.Globalization.CalendarAlgorithmType.SolarCalendar" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses reflection to instantiate each <xref:System.Globalization.Calendar> type found in the .NET Class Library and displays the value of its <xref:System.Globalization.Calendar.AlgorithmType%2A> property.
[!code-csharp[System.Globalization.Calendar.AlgorithmType#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/cs/algorithmtype1.cs#1)]
[!code-vb[System.Globalization.Calendar.AlgorithmType#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/vb/algorithmtype1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Eras">
<MemberSignature Language="C#" Value="public override int[] Eras { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32[] Eras" />
<MemberSignature Language="DocId" Value="P:System.Globalization.JapaneseCalendar.Eras" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Eras As Integer()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property cli::array &lt;int&gt; ^ Eras { cli::array &lt;int&gt; ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Eras : int[]" Usage="System.Globalization.JapaneseCalendar.Eras" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32[]</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the list of eras in the <see cref="T:System.Globalization.JapaneseCalendar" />.</summary>
<value>An array of integers that represents the eras in the <see cref="T:System.Globalization.JapaneseCalendar" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The Japanese calendar recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]
This class assigns numbers to the eras as follows:
|GetEra value|Era Name|Era Abbreviation|Gregorian Dates|
|------------------|--------------|----------------------|---------------------|
|5|令和 (Reiwa)|令和 (R, r)|May 1, 2019 to present|
|4|平成 (Heisei)|平 (H, h)|January 8, 1989 to present|
|3|昭和 (Showa)|昭 (S, s)|December 25, 1926 to January 7, 1989|
|2|大正 (Taisho)|大 (T, t)|July 30, 1912 to December 24, 1926|
|1|明治 (Meiji)|明 (M, m)|September 8, 1868 to July 29, 1912|
This class handles dates from September 8 in the year Meiji 1 (January 1, 1868 of the Gregorian calendar). Although the Japanese calendar was switched from a lunar calendar to a solar calendar in the year Meiji 6 (1873 of the Gregorian calendar), this implementation is based on the solar calendar only.
> [!NOTE]
> Should additional eras be added in the future, applications may encounter more than the expected five eras for the Japanese calendar. Your applications should be tested to ensure that they continue to work in such an event; see [Era Handling for the Japanese Calendar](/windows/desktop/Intl/era-handling-for-the-japanese-calendar).
## Examples
The following example displays the values contained in the <xref:System.Globalization.JapaneseCalendar.Eras%2A> property.
[!code-cpp[System.Globalization.JapaneseCalendar.Eras#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.Eras/CPP/yslin_japanesecalendar_eras.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar.Eras#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.Eras/CS/yslin_japanesecalendar_eras.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar.Eras#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.Eras/VB/yslin_japanesecalendar_eras.vb#1)]
]]></format>
</remarks>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
</Docs>
</Member>
<Member MemberName="GetDayOfMonth">
<MemberSignature Language="C#" Value="public override int GetDayOfMonth (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetDayOfMonth(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDayOfMonth (time As DateTime) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetDayOfMonth(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetDayOfMonth : DateTime -&gt; int" Usage="japaneseCalendar.GetDayOfMonth time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the day of the month in the specified <see cref="T:System.DateTime" />.</summary>
<returns>An integer from 1 to 31 that represents the day of the month in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.DateTime.Day" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
</Docs>
</Member>
<Member MemberName="GetDayOfWeek">
<MemberSignature Language="C#" Value="public override DayOfWeek GetDayOfWeek (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance valuetype System.DayOfWeek GetDayOfWeek(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDayOfWeek (time As DateTime) As DayOfWeek" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override DayOfWeek GetDayOfWeek(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetDayOfWeek : DateTime -&gt; DayOfWeek" Usage="japaneseCalendar.GetDayOfWeek time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DayOfWeek</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the day of the week in the specified <see cref="T:System.DateTime" />.</summary>
<returns>A <see cref="T:System.DayOfWeek" /> value that represents the day of the week in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DayOfWeek> values are as follows:
|DayOfWeek value|which indicates|
|---------------------|---------------------|
|Sunday|日曜日 (Nichiyoubi)|
|Monday|月曜日 (Getsuyoubi)|
|Tuesday|火曜日 (Kayoubi)|
|Wednesday|水曜日 (Suiyoubi)|
|Thursday|木曜日 (Mokuyoubi)|
|Friday|金曜日 (Kinyoubi)|
|Saturday|土曜日 (Doyoubi)|
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.DateTime.DayOfWeek" />
<altmember cref="T:System.DayOfWeek" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
</Docs>
</Member>
<Member MemberName="GetDayOfYear">
<MemberSignature Language="C#" Value="public override int GetDayOfYear (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetDayOfYear(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDayOfYear (time As DateTime) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetDayOfYear(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetDayOfYear : DateTime -&gt; int" Usage="japaneseCalendar.GetDayOfYear time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the day of the year in the specified <see cref="T:System.DateTime" />.</summary>
<returns>An integer from 1 to 366 that represents the day of the year in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The day of the year is defined as the number of days from the first day of the year. For example, <xref:System.Globalization.JapaneseCalendar.GetDayOfYear%2A> for the first day of the first month returns 1, and <xref:System.Globalization.JapaneseCalendar.GetDayOfYear%2A> for the last day of the last month returns the total number of days in that year, which is the same value as that returned by <xref:System.Globalization.JapaneseCalendar.GetDaysInYear%2A>.
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.DateTime.DayOfYear" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
</Docs>
</Member>
<Member MemberName="GetDaysInMonth">
<MemberSignature Language="C#" Value="public override int GetDaysInMonth (int year, int month, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetDaysInMonth(int32 year, int32 month, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetDaysInMonth(System.Int32,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDaysInMonth (year As Integer, month As Integer, era As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetDaysInMonth(int year, int month, int era);" />
<MemberSignature Language="F#" Value="override this.GetDaysInMonth : int * int * int -&gt; int" Usage="japaneseCalendar.GetDaysInMonth (year, month, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="month">An integer from 1 to 12 that represents the month.</param>
<param name="era">An integer that represents the era.</param>
<summary>Returns the number of days in the specified month in the specified year in the specified era.</summary>
<returns>The number of days in the specified month in the specified year in the specified era.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For example, this method returns 28 or 29 for Nigatsu (February, `month` = 2), depending on whether `year` is a leap year.
## Examples
The following code example calls <xref:System.Globalization.JapaneseCalendar.GetDaysInMonth%2A> for the second month in each of five years in each era.
[!code-cpp[System.Globalization.JapaneseCalendar.GetDaysInMonth#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInMonth/CPP/japanesecalendar_getdaysinmonth.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar.GetDaysInMonth#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInMonth/CS/japanesecalendar_getdaysinmonth.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar.GetDaysInMonth#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInMonth/VB/japanesecalendar_getdaysinmonth.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="month" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInYear(System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="GetDaysInYear">
<MemberSignature Language="C#" Value="public override int GetDaysInYear (int year, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetDaysInYear(int32 year, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetDaysInYear(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDaysInYear (year As Integer, era As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetDaysInYear(int year, int era);" />
<MemberSignature Language="F#" Value="override this.GetDaysInYear : int * int -&gt; int" Usage="japaneseCalendar.GetDaysInYear (year, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="era">An integer that represents the era.</param>
<summary>Returns the number of days in the specified year in the specified era.</summary>
<returns>The number of days in the specified year in the specified era.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For example, this method returns 365 or 366, depending on whether `year` is a leap year.
## Examples
The following example calls <xref:System.Globalization.JapaneseCalendar.GetDaysInYear%2A> for five years in each era.
[!code-cpp[System.Globalization.JapaneseCalendar.GetDaysInYear#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInYear/CPP/japanesecalendar_getdaysinyear.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar.GetDaysInYear#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInYear/CS/japanesecalendar_getdaysinyear.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar.GetDaysInYear#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetDaysInYear/VB/japanesecalendar_getdaysinyear.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInMonth(System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="GetEra">
<MemberSignature Language="C#" Value="public override int GetEra (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetEra(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetEra (time As DateTime) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetEra(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetEra : DateTime -&gt; int" Usage="japaneseCalendar.GetEra time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the era in the specified <see cref="T:System.DateTime" />.</summary>
<returns>An integer that represents the era in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The Japanese calendar recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]
This class assigns numbers to the eras as follows:
|GetEra value|Era Name|Era Abbreviation|Gregorian Dates|
|------------------|--------------|----------------------|---------------------|
|5|令和 (Reiwa)|令和 (R, r)|May 1, 2019 to present|
|4|平成 (Heisei)|平 (H, h)|January 8, 1989 to April 30, 2019|
|3|昭和 (Showa)|昭 (S, s)|December 25, 1926 to January 7, 1989|
|2|大正 (Taisho)|大 (T, t)|July 30, 1912 to December 24, 1926|
|1|明治 (Meiji)|明 (M, m)|September 8, 1868 to July 29, 1912|
Ordinarily, the <xref:System.Globalization.JapaneseCalendar> class supports dates from September 8 in the year Meiji 1 (September 8, 1868 of the Gregorian calendar), which is the value of the <xref:System.Globalization.JapaneseCalendar.MinSupportedDateTime%2A> property. However, the <xref:System.Globalization.JapaneseCalendar.GetEra%2A> method successfully returns the era for dates from January 1 through September 7 in the year Meiji 1 (January 1, 1868 through September 7, 1868 in the Gregorian calendar). For dates earlier than January 1, 1868 in the Gregorian calendar, the method throws an <xref:System.ArgumentOutOfRangeException> exception.
## Examples
The following example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is outside the supported range.</exception>
<altmember cref="T:System.DateTime" />
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
<altmember cref="M:System.Globalization.Calendar.GetHour(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMinute(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetSecond(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMilliseconds(System.DateTime)" />
</Docs>
</Member>
<Member MemberName="GetLeapMonth">
<MemberSignature Language="C#" Value="public override int GetLeapMonth (int year, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetLeapMonth(int32 year, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetLeapMonth(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetLeapMonth (year As Integer, era As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetLeapMonth(int year, int era);" />
<MemberSignature Language="F#" Value="override this.GetLeapMonth : int * int -&gt; int" Usage="japaneseCalendar.GetLeapMonth (year, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="era" Type="System.Int32" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="year">A year.</param>
<param name="era">An era.</param>
<summary>Calculates the leap month for a specified year and era.</summary>
<returns>The return value is always 0 because the <see cref="T:System.Globalization.JapaneseCalendar" /> type does not support the notion of a leap month.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> or <paramref name="era" /> is outside the range supported by the <see cref="T:System.Globalization.JapaneseCalendar" /> type.</exception>
</Docs>
</Member>
<Member MemberName="GetMonth">
<MemberSignature Language="C#" Value="public override int GetMonth (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetMonth(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetMonth (time As DateTime) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetMonth(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetMonth : DateTime -&gt; int" Usage="japaneseCalendar.GetMonth time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the month in the specified <see cref="T:System.DateTime" />.</summary>
<returns>An integer from 1 to 12 that represents the month in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.DateTime.Month" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
<altmember cref="M:System.Globalization.Calendar.GetHour(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMinute(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetSecond(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMilliseconds(System.DateTime)" />
</Docs>
</Member>
<Member MemberName="GetMonthsInYear">
<MemberSignature Language="C#" Value="public override int GetMonthsInYear (int year, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetMonthsInYear(int32 year, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetMonthsInYear (year As Integer, era As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetMonthsInYear(int year, int era);" />
<MemberSignature Language="F#" Value="override this.GetMonthsInYear : int * int -&gt; int" Usage="japaneseCalendar.GetMonthsInYear (year, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="era">An integer that represents the era.</param>
<summary>Returns the number of months in the specified year in the specified era.</summary>
<returns>The return value is always 12.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example calls <xref:System.Globalization.JapaneseCalendar.GetMonthsInYear%2A> for the first five years in each era. Because the <xref:System.Globalization.JapaneseCalendar> class supports only 12-month years, it indicates that there are 12 months in each of the eras supported by the <xref:System.Globalization.JapaneseCalendar> class.
[!code-cpp[System.Globalization.JapaneseCalendar.GetMonthsInYear#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetMonthsInYear/CPP/japanesecalendar_getmonthsinyear.cpp)]
[!code-csharp[System.Globalization.JapaneseCalendar.GetMonthsInYear#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetMonthsInYear/CS/japanesecalendar_getmonthsinyear.cs)]
[!code-vb[System.Globalization.JapaneseCalendar.GetMonthsInYear#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.GetMonthsInYear/VB/japanesecalendar_getmonthsinyear.vb)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInMonth(System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="GetWeekOfYear">
<MemberSignature Language="C#" Value="public override int GetWeekOfYear (DateTime time, System.Globalization.CalendarWeekRule rule, DayOfWeek firstDayOfWeek);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetWeekOfYear(valuetype System.DateTime time, valuetype System.Globalization.CalendarWeekRule rule, valuetype System.DayOfWeek firstDayOfWeek) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetWeekOfYear (time As DateTime, rule As CalendarWeekRule, firstDayOfWeek As DayOfWeek) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetWeekOfYear(DateTime time, System::Globalization::CalendarWeekRule rule, DayOfWeek firstDayOfWeek);" />
<MemberSignature Language="F#" Value="override this.GetWeekOfYear : DateTime * System.Globalization.CalendarWeekRule * DayOfWeek -&gt; int" Usage="japaneseCalendar.GetWeekOfYear (time, rule, firstDayOfWeek)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="rule" Type="System.Globalization.CalendarWeekRule" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="firstDayOfWeek" Type="System.DayOfWeek" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<param name="rule">One of the <see cref="T:System.Globalization.CalendarWeekRule" /> values that defines a calendar week.</param>
<param name="firstDayOfWeek">One of the <see cref="T:System.DayOfWeek" /> values that represents the first day of the week.</param>
<summary>Returns the week of the year that includes the date in the specified <see cref="T:System.DateTime" />.</summary>
<returns>A 1-based integer that represents the week of the year that includes the date in the <paramref name="time" /> parameter.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method can be used to determine the number of weeks in the year by setting the `time` parameter to the last day of the year.
The <xref:System.Globalization.CultureInfo.DateTimeFormat%2A?displayProperty=nameWithType> property contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters.
The <xref:System.Globalization.DateTimeFormatInfo.FirstDayOfWeek%2A> property of <xref:System.Globalization.CultureInfo.DateTimeFormat%2A?displayProperty=nameWithType> contains the default <xref:System.DayOfWeek> value that represents the first day of the week for a specific culture, using the calendar specified in the <xref:System.Globalization.DateTimeFormatInfo.Calendar%2A> property of <xref:System.Globalization.CultureInfo.DateTimeFormat%2A?displayProperty=nameWithType>.
The <xref:System.Globalization.DateTimeFormatInfo.CalendarWeekRule%2A> property of <xref:System.Globalization.CultureInfo.DateTimeFormat%2A?displayProperty=nameWithType> contains the default <xref:System.Globalization.CalendarWeekRule> value that defines a calendar week for a specific culture, using the calendar specified in the <xref:System.Globalization.DateTimeFormatInfo.Calendar%2A> property of <xref:System.Globalization.CultureInfo.DateTimeFormat%2A?displayProperty=nameWithType>.
For example, in <xref:System.Globalization.GregorianCalendar>, the <xref:System.Globalization.Calendar.GetWeekOfYear%2A> method for January 1 returns 1.
## Examples
The following code example shows how the result of <xref:System.Globalization.Calendar.GetWeekOfYear%2A> varies depending on the <xref:System.Globalization.DateTimeFormatInfo.FirstDayOfWeek%2A> and <xref:System.Globalization.CalendarWeekRule> values used. If the specified date is the last day of the year, <xref:System.Globalization.Calendar.GetWeekOfYear%2A> returns the total number of weeks in that year.
[!code-cpp[System.Globalization.Calendar.GetWeekOfYear#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CPP/yslin_calendar_getweekofyear.cpp#1)]
[!code-csharp[System.Globalization.Calendar.GetWeekOfYear#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/yslin_calendar_getweekofyear.cs#1)]
[!code-vb[System.Globalization.Calendar.GetWeekOfYear#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/VB/yslin_calendar_getweekofyear.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="time" /> or <paramref name="firstDayOfWeek" /> is outside the range supported by the calendar.
-or-
<paramref name="rule" /> is not a valid <see cref="T:System.Globalization.CalendarWeekRule" /> value.</exception>
</Docs>
</Member>
<Member MemberName="GetYear">
<MemberSignature Language="C#" Value="public override int GetYear (DateTime time);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetYear(valuetype System.DateTime time) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.GetYear(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetYear (time As DateTime) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetYear(DateTime time);" />
<MemberSignature Language="F#" Value="override this.GetYear : DateTime -&gt; int" Usage="japaneseCalendar.GetYear time" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="time" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="time">The <see cref="T:System.DateTime" /> to read.</param>
<summary>Returns the year in the specified <see cref="T:System.DateTime" />.</summary>
<returns>An integer that represents the year in the specified <see cref="T:System.DateTime" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example displays the values of several components of a <xref:System.DateTime> in terms of the Japanese calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CPP/japanesecalendar_addget.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/CS/japanesecalendar_addget.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_AddGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_AddGet/VB/japanesecalendar_addget.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.DateTime.Year" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetEra(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfYear(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfMonth(System.DateTime)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDayOfWeek(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetWeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)" />
<altmember cref="M:System.Globalization.Calendar.GetHour(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMinute(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetSecond(System.DateTime)" />
<altmember cref="M:System.Globalization.Calendar.GetMilliseconds(System.DateTime)" />
</Docs>
</Member>
<Member MemberName="IsLeapDay">
<MemberSignature Language="C#" Value="public override bool IsLeapDay (int year, int month, int day, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool IsLeapDay(int32 year, int32 month, int32 day, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.IsLeapDay(System.Int32,System.Int32,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function IsLeapDay (year As Integer, month As Integer, day As Integer, era As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool IsLeapDay(int year, int month, int day, int era);" />
<MemberSignature Language="F#" Value="override this.IsLeapDay : int * int * int * int -&gt; bool" Usage="japaneseCalendar.IsLeapDay (year, month, day, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="day" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="month">An integer from 1 to 12 that represents the month.</param>
<param name="day">An integer from 1 to 31 that represents the day.</param>
<param name="era">An integer that represents the era.</param>
<summary>Determines whether the specified date in the specified era is a leap day.</summary>
<returns>
<see langword="true" />, if the specified day is a leap day; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Leap years in the Japanese calendar correspond to the same leap years in the Gregorian calendar. A leap year in the Gregorian calendar is defined as a Gregorian year that is evenly divisible by four, except if it is divisible by 100. However, Gregorian years that are divisible by 400 are leap years. A common year has 365 days and a leap year has 366 days.
A leap day is a day that occurs only in a leap year. For example, the 29th day of Nigatsu (February) is the only leap day.
## Examples
The following example calls <xref:System.Globalization.JapaneseCalendar.IsLeapDay%2A> for the last day of the second month (February) for five years in each of the eras. The current era in the example output is the Reiwa era.
[!code-cpp[System.Globalization.JapaneseCalendar.IsLeapDay#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapDay/CPP/japanesecalendar_isleapday.cpp)]
[!code-csharp[System.Globalization.JapaneseCalendar.IsLeapDay#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapDay/CS/japanesecalendar_isleapday.cs)]
[!code-vb[System.Globalization.JapaneseCalendar.IsLeapDay#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapDay/VB/japanesecalendar_isleapday.vb)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="month" /> is outside the range supported by the calendar.
-or-
<paramref name="day" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInMonth(System.Int32,System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapMonth(System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="IsLeapMonth">
<MemberSignature Language="C#" Value="public override bool IsLeapMonth (int year, int month, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool IsLeapMonth(int32 year, int32 month, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.IsLeapMonth(System.Int32,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function IsLeapMonth (year As Integer, month As Integer, era As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool IsLeapMonth(int year, int month, int era);" />
<MemberSignature Language="F#" Value="override this.IsLeapMonth : int * int * int -&gt; bool" Usage="japaneseCalendar.IsLeapMonth (year, month, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="month">An integer from 1 to 12 that represents the month.</param>
<param name="era">An integer that represents the era.</param>
<summary>Determines whether the specified month in the specified year in the specified era is a leap month.</summary>
<returns>This method always returns <see langword="false" />, unless overridden by a derived class.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Leap years in the Japanese calendar correspond to the same leap years in the Gregorian calendar. A leap year in the Gregorian calendar is defined as a Gregorian year that is evenly divisible by four, except if it is divisible by 100. However, Gregorian years that are divisible by 400 are leap years. A common year has 365 days and a leap year has 366 days.
A leap month is an entire month that occurs only in a leap year. The Japanese calendar does not have any leap months.
## Examples
The following example calls <xref:System.Globalization.JapaneseCalendar.IsLeapMonth%2A> for all the months in the first five years in the current era.
[!code-cpp[System.Globalization.JapaneseCalendar.IsLeapMonth#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapMonth/CPP/japanesecalendar_isleapmonth.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar.IsLeapMonth#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapMonth/CS/japanesecalendar_isleapmonth.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar.IsLeapMonth#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapMonth/VB/japanesecalendar_isleapmonth.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="month" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapDay(System.Int32,System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="IsLeapYear">
<MemberSignature Language="C#" Value="public override bool IsLeapYear (int year, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool IsLeapYear(int32 year, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.IsLeapYear(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function IsLeapYear (year As Integer, era As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool IsLeapYear(int year, int era);" />
<MemberSignature Language="F#" Value="override this.IsLeapYear : int * int -&gt; bool" Usage="japaneseCalendar.IsLeapYear (year, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="era">An integer that represents the era.</param>
<summary>Determines whether the specified year in the specified era is a leap year.</summary>
<returns>
<see langword="true" />, if the specified year is a leap year; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Leap years in the Japanese calendar correspond to the same leap years in the Gregorian calendar. A leap year in the Gregorian calendar is defined as a Gregorian year that is evenly divisible by four, except if it is divisible by 100. However, Gregorian years that are divisible by 400 are leap years. A common year has 365 days and a leap year has 366 days.
## Examples
The following example calls <xref:System.Globalization.JapaneseCalendar.IsLeapYear%2A> for five years in each of the eras. The current era in the example output is the Reiwa era.
[!code-cpp[System.Globalization.JapaneseCalendar.IsLeapYear#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapYear/CPP/japanesecalendar_isleapyear.cpp)]
[!code-csharp[System.Globalization.JapaneseCalendar.IsLeapYear#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapYear/CS/japanesecalendar_isleapyear.cs)]
[!code-vb[System.Globalization.JapaneseCalendar.IsLeapYear#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar.IsLeapYear/VB/japanesecalendar_isleapyear.vb)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapMonth(System.Int32,System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.IsLeapDay(System.Int32,System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="MaxSupportedDateTime">
<MemberSignature Language="C#" Value="public override DateTime MaxSupportedDateTime { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime MaxSupportedDateTime" />
<MemberSignature Language="DocId" Value="P:System.Globalization.JapaneseCalendar.MaxSupportedDateTime" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property MaxSupportedDateTime As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property DateTime MaxSupportedDateTime { DateTime get(); };" />
<MemberSignature Language="F#" Value="member this.MaxSupportedDateTime : DateTime" Usage="System.Globalization.JapaneseCalendar.MaxSupportedDateTime" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the latest date and time supported by the current <see cref="T:System.Globalization.JapaneseCalendar" /> object.</summary>
<value>The latest date and time supported by the <see cref="T:System.Globalization.JapaneseCalendar" /> type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example gets the minimum value and the maximum value of the calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/CPP/japanesecalendar_minmax.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/CS/japanesecalendar_minmax.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/VB/japanesecalendar_minmax.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="MinSupportedDateTime">
<MemberSignature Language="C#" Value="public override DateTime MinSupportedDateTime { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime MinSupportedDateTime" />
<MemberSignature Language="DocId" Value="P:System.Globalization.JapaneseCalendar.MinSupportedDateTime" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property MinSupportedDateTime As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property DateTime MinSupportedDateTime { DateTime get(); };" />
<MemberSignature Language="F#" Value="member this.MinSupportedDateTime : DateTime" Usage="System.Globalization.JapaneseCalendar.MinSupportedDateTime" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the earliest date and time supported by the current <see cref="T:System.Globalization.JapaneseCalendar" /> object.</summary>
<value>The earliest date and time supported by the <see cref="T:System.Globalization.JapaneseCalendar" /> type, which is equivalent to the first moment of September 8, 1868 C.E. in the Gregorian calendar.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The earliest date supported by the <xref:System.Globalization.JapaneseCalendar> class is September 8, 1868 C.E., in the first year of the Meiji era. Ordinarily, date and time operations that use the <xref:System.Globalization.JapaneseCalendar> class throw an <xref:System.ArgumentOutOfRangeException> exception for dates before this date. However, some members, such as the <xref:System.Globalization.JapaneseCalendar.GetEra%2A> method, support dates from January 1, 1868 through September 7 in the year Meiji 1.
## Examples
The following example gets the earliest and latest dates supported by the calendar.
[!code-cpp[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/CPP/japanesecalendar_minmax.cpp#1)]
[!code-csharp[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/CS/japanesecalendar_minmax.cs#1)]
[!code-vb[System.Globalization.JapaneseCalendar_MinMax#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.JapaneseCalendar_MinMax/VB/japanesecalendar_minmax.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ToDateTime">
<MemberSignature Language="C#" Value="public override DateTime ToDateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, int era);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance valuetype System.DateTime ToDateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond, int32 era) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.ToDateTime(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToDateTime (year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, millisecond As Integer, era As Integer) As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);" />
<MemberSignature Language="F#" Value="override this.ToDateTime : int * int * int * int * int * int * int * int -&gt; DateTime" Usage="japaneseCalendar.ToDateTime (year, month, day, hour, minute, second, millisecond, era)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="day" Type="System.Int32" />
<Parameter Name="hour" Type="System.Int32" />
<Parameter Name="minute" Type="System.Int32" />
<Parameter Name="second" Type="System.Int32" />
<Parameter Name="millisecond" Type="System.Int32" />
<Parameter Name="era" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer that represents the year.</param>
<param name="month">An integer from 1 to 12 that represents the month.</param>
<param name="day">An integer from 1 to 31 that represents the day.</param>
<param name="hour">An integer from 0 to 23 that represents the hour.</param>
<param name="minute">An integer from 0 to 59 that represents the minute.</param>
<param name="second">An integer from 0 to 59 that represents the second.</param>
<param name="millisecond">An integer from 0 to 999 that represents the millisecond.</param>
<param name="era">An integer that represents the era.</param>
<summary>Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the specified era.</summary>
<returns>The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Globalization.JapaneseCalendar.ToDateTime%2A> method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar.
Because the <xref:System.Globalization.JapaneseCalendar> supports multiple eras based on the reign of the emperor, you should always call this method and explicitly specify an era to avoid an unintended date and to make the intent of your code clear. The example shows how to instantiate a date that is always in the current era and one that belongs to a specified era.
## Examples
The following example instantiates two dates. The first is always the first day of the second year in the current era, while the second identifies a specific day in the Taisho era. The output from the example was produced with the Heisei era as the current era.
[!code-csharp[Specifying the era](~/samples/snippets/csharp/api/system.globalization/japanesecalendar/todatetime/program.cs)]
[!code-vb[Specifying the era](~/samples/snippets/visualbasic/api/system.globalization/japanesecalendar/todatetime/Program.vb)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.
-or-
<paramref name="month" /> is outside the range supported by the calendar.
-or-
<paramref name="day" /> is outside the range supported by the calendar.
-or-
<paramref name="hour" /> is less than zero or greater than 23.
-or-
<paramref name="minute" /> is less than zero or greater than 59.
-or-
<paramref name="second" /> is less than zero or greater than 59.
-or-
<paramref name="millisecond" /> is less than zero or greater than 999.
-or-
<paramref name="era" /> is outside the range supported by the calendar.</exception>
<altmember cref="T:System.DateTime" />
<altmember cref="F:System.Globalization.Calendar.CurrentEra" />
<altmember cref="P:System.Globalization.JapaneseCalendar.Eras" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetMonthsInYear(System.Int32,System.Int32)" />
<altmember cref="M:System.Globalization.JapaneseCalendar.GetDaysInMonth(System.Int32,System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="ToFourDigitYear">
<MemberSignature Language="C#" Value="public override int ToFourDigitYear (int year);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 ToFourDigitYear(int32 year) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Globalization.JapaneseCalendar.ToFourDigitYear(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToFourDigitYear (year As Integer) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int ToFourDigitYear(int year);" />
<MemberSignature Language="F#" Value="override this.ToFourDigitYear : int -&gt; int" Usage="japaneseCalendar.ToFourDigitYear year" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
</Parameters>
<Docs>
<param name="year">An integer (usually two digits) that represents the year to convert.</param>
<summary>Converts the specified year to a four-digit year by using the <see cref="P:System.Globalization.JapaneseCalendar.TwoDigitYearMax" /> property to determine the appropriate century.</summary>
<returns>An integer that contains the four-digit representation of <paramref name="year" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method implements <xref:System.Globalization.Calendar.ToFourDigitYear%2A?displayProperty=nameWithType>.
Because the year in the Japanese calendar is typically less than four digits long, this implementation always returns the value of the `year` parameter.
<xref:System.Globalization.JapaneseCalendar.ToFourDigitYear%2A> supports either a two-digit year or a four-digit year. However, a valid year is generally represented as two digits (less than 100). Passing a two-digit year value causes the method to convert the value to a four-digit value according to the <xref:System.Globalization.JapaneseCalendar.TwoDigitYearMax%2A> value representing the appropriate century. If the application supplies a four-digit value, or if it supplies zero or a negative value, <xref:System.Globalization.JapaneseCalendar.ToFourDigitYear%2A> throws an exception.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is outside the range supported by the calendar.</exception>
<altmember cref="P:System.Globalization.JapaneseCalendar.TwoDigitYearMax" />
</Docs>
</Member>
<Member MemberName="TwoDigitYearMax">
<MemberSignature Language="C#" Value="public override int TwoDigitYearMax { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 TwoDigitYearMax" />
<MemberSignature Language="DocId" Value="P:System.Globalization.JapaneseCalendar.TwoDigitYearMax" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property TwoDigitYearMax As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int TwoDigitYearMax { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.TwoDigitYearMax : int with get, set" Usage="System.Globalization.JapaneseCalendar.TwoDigitYearMax" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Globalization.Calendars</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.</summary>
<value>The last year of a 100-year range that can be represented by a 2-digit year.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property implements <xref:System.Globalization.Calendar.TwoDigitYearMax%2A?displayProperty=nameWithType>.
Because the year in the Japanese calendar is typically less than four digits long, this implementation returns 99 by default and does not affect the return value of <xref:System.Globalization.JapaneseCalendar.ToFourDigitYear%2A>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value specified in a set operation is less than 99.
-or-
The value specified in a set operation is greater than 8011 (or <see langword="MaxSupportedDateTime.Year" />).</exception>
<exception cref="T:System.InvalidOperationException">In a set operation, the current instance is read-only.</exception>
<altmember cref="M:System.Globalization.JapaneseCalendar.ToFourDigitYear(System.Int32)" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.