mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Globalization.Calendar System.Runtime.InteropServices.ComVisible(true)

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.

For information about using the class and the other calendar classes in the .NET Framework, see Working with Calendars.

The Japanese calendar recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. 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.

This class assigns numbers to the eras as follows:

GetEra value

Era Name

Era Abbreviation

Gregorian Dates

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 (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 application is using the class, 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.

Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new .

Represents the Japanese calendar.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The day part of the resulting 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 is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . The time-of-day part of the resulting remains the same as the specified .

  For example, if the specified month is Juugatsu (October), which has 31 days, the specified day is the 31st day of that month, and 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 is negative, the resulting is earlier than the specified .

  The property of the returned value always equals . You can preserve the property of the parameter by calling the method, as the following example shows.

  code reference: System.Globalization.Calendar.AddMethods#5

  Returns a that is the specified number of months away from the specified .

  The that results from adding the specified number of months to the specified .

  The to which to add months. The number of months to add.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The day part of the resulting 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 remains the same as the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . The time-of-day part of the resulting remains the same as the specified .

  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 is 1, the resulting date will be the 28th day of Nigatsu (February) in the following year.

  If is negative, the resulting is earlier than the specified .

  The property of the returned value always equals . You can preserve the property of the parameter by calling the method, as the following example shows.

  code reference: System.Globalization.Calendar.AddMethods#8

  Returns a that is the specified number of years away from the specified .

  The that results from adding the specified number of years to the specified .

  The to which to add years. The number of years to add.
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Globalization.CalendarAlgorithmType To be added. To be added.

  Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32[] To be added.

  The Japanese calendar recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. 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.

  This class assigns numbers to the eras as follows:

  GetEra value

  Era Name

  Era Abbreviation

  Gregorian Dates

  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.

  Should additional eras be added in the future, applications may encounter more than the expected four eras for the Japanese calendar. Applications should be tested to ensure that they continue to work in such an event; see Era Handling for the Japanese Calendar.

  Gets the list of eras in the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the day of the month in the specified .

  An integer from 1 to 31 that represents the day of the month in the specified .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DayOfWeek ``

  The values are as follows:

  DayOfWeek value

  which indicates

  Sunday

  日曜日 (Nichiyoubi)

  Monday

  月曜日 (Getsuyoubi)

  Tuesday

  火曜日 (Kayoubi)

  Wednesday

  水曜日 (Suiyoubi)

  Thursday

  木曜日 (Mokuyoubi)

  Friday

  金曜日 (Kinyoubi)

  Saturday

  土曜日 (Doyoubi)

  Returns the day of the week in the specified .

  A value that represents the day of the week in the specified .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and 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 .

  Returns the day of the year in the specified .

  An integer from 1 to 366 that represents the day of the year in the specified .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  For example, this method returns 28 or 29 for Nigatsu (February, = 2), depending on whether is a leap year.

  Returns the number of days in the specified month in the specified year in the specified era.

  The number of days in the specified month in the specified year in the specified era.

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  For example, this method returns 365 or 366, depending on whether is a leap year.

  Returns the number of days in the specified year in the specified era.

  The number of days in the specified year in the specified era.

  An integer that represents the year. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  The Japanese calendar recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. 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.

  This class assigns numbers to the eras as follows:

  GetEra value

  Era Name

  Era Abbreviation

  Gregorian Dates

  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

  Ordinarily, the class supports dates from September 8 in the year Meiji 1 (September 8, 1868 of the Gregorian calendar), which is the value of the property. However, the 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 exception.

  Returns the era in the specified .

  An integer that represents the era in the specified .

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` ``

  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 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 method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

  Calculates the leap month for a specified year and era.

  The return value is always 0 because the type does not support the notion of a leap month.

  A year. An era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the month in the specified .

  An integer from 1 to 12 that represents the month in the specified .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` To be added.

  Returns the number of months in the specified year in the specified era.

  The return value is always 12.

  An integer that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` ``

  This method can be used to determine the number of weeks in the year by setting the parameter to the last day of the year.

  The property contains culture-specific values that can be used for the and parameters.

  The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of .

  The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of .

  For example, in , the method for January 1 returns 1.

  Returns the week of the year that includes the date in the specified .

  A 1-based integer that represents the week of the year that includes the date in the parameter.

  The to read. One of the values that defines a calendar week. One of the values that represents the first day of the week.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the year in the specified .

  An integer that represents the year in the specified .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` ``

  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.

  Determines whether the specified date in the specified era is a leap day.

  true, if the specified day is a leap day; otherwise, false.

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer from 1 to 31 that represents the day. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` ``

  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.

  Determines whether the specified month in the specified year in the specified era is a leap month.

  This method always returns false, unless overridden by a derived class.

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  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.

  Determines whether the specified year in the specified era is a leap year.

  true, if the specified year is a leap year; otherwise, false.

  An integer that represents the year. An integer that represents the era.
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added. To be added.

  Gets the latest date and time supported by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added.

  The earliest date supported by the class is September 8, 1868 C.E., in the first year of the Meiji era. Ordinarily, date and time operations that use the class throw an exception for dates before this date. However, some members, such as the method, support dates from January 1, 1868 through September 7 in the year Meiji 1.

  Gets the earliest date and time supported by the current object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` `` `` `` `` `` `` ``

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

  Returns a that is set to the specified date and time in the specified era.

  The that is set to the specified date and time in the current era.

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer from 1 to 31 that represents the day. An integer from 0 to 23 that represents the hour. An integer from 0 to 59 that represents the minute. An integer from 0 to 59 that represents the second. An integer from 0 to 999 that represents the millisecond. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method implements .

  Because the year in the Japanese calendar is typically less than four digits long, this implementation always returns the value of the parameter.

  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 value representing the appropriate century. If the application supplies a four-digit value, or if it supplies zero or a negative value, throws an exception.

  Converts the specified year to a four-digit year by using the property to determine the appropriate century.

  An integer that contains the four-digit representation of .

  An integer (usually two digits) that represents the year to convert.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  This property implements .

  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 .

  Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.