JapaneseLunisolarCalendar 類別

定義

表示劃分的時間,例如月、日和年。Represents time in divisions, such as months, days, and years. 年份的計算方式與日本曆法相同,而日期與月份則是使用陰陽曆計算。Years are calculated as for the Japanese calendar, while days and months are calculated using the lunisolar calendar.

public ref class JapaneseLunisolarCalendar : System::Globalization::EastAsianLunisolarCalendar
[System.Serializable]
public class JapaneseLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
type JapaneseLunisolarCalendar = class
    inherit EastAsianLunisolarCalendar
Public Class JapaneseLunisolarCalendar
Inherits EastAsianLunisolarCalendar
繼承
JapaneseLunisolarCalendar
屬性

備註

JapaneseLunisolarCalendar 類別衍生自 EastAsianLunisolarCalendar 類別,這代表陰陽曆的行事曆。The JapaneseLunisolarCalendar class is derived from the EastAsianLunisolarCalendar class, which represents the lunisolar calendar. 除了陽曆年和農曆的月份以外,EastAsianLunisolarCalendar 類別支援甲子年週期(每60年重複一次)。The EastAsianLunisolarCalendar class supports the sexagenary year cycle (which repeats every 60 years) in addition to solar years and lunar months. 行事曆中的每個日光年度都會與一個甲子年、一個著天體的莖和一個地面分支相關聯,而這些行事曆在一年的任何月份之後可能會有閏月。Each solar year in the calendar is associated with a Sexagenary Year, a Celestial Stem, and a Terrestrial Branch, and these calendars can have leap months after any month of the year. GetMonth 方法會傳回1到13之間的數位,表示與指定日期相關聯的月份。The GetMonth method returns a number between 1 and 13 that indicates the month associated with a specified date. 如果一年的第八到第九個月之間有閏月,則 GetMonth 方法會針對第八個月傳回8個,而在第八個月則傳回9個,而第九個月則會傳回10個月。If there is a leap month between the eighth and ninth months of the year, the GetMonth method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

注意

如需在 .NET 類別庫中使用 JapaneseLunisolarCalendar 類別和其他行事曆類別的詳細資訊,請參閱使用行事For information about using the JapaneseLunisolarCalendar class and the other calendar classes in the .NET Class Library, see Working with Calendars.

JapaneseLuniSolarCalendar 類別會針對每個天皇的統治辨識一個紀元。The JapaneseLuniSolarCalendar class recognizes one era for every emperor's reign. 例如,兩個最新的紀元是 Heisei 紀元,從西曆年1989開始,而 Reiwa 紀元則從西曆年2019開始。For example, 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. 例如,西曆年份2001是日本歷年度 Heisei 13。For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. 請注意,紀元的第一年稱為「Gannen」。Note that the first year of an era is called "Gannen." 因此,西曆年份1989是日本歷年度 Heisei Gannen。Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.

重要

日本曆法的紀元是以天皇的統治為基礎,因此有變更是正常的。Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. 例如,2019 年 5 月 1 日之後,JapaneseCalendarJapaneseLunisolarCalendar 中將開始使用「令和」。For example, May 1, 2019 marked the beginning of the Reiwa era in the JapaneseCalendar and JapaneseLunisolarCalendar. 此變更對使用這些日曆的所有應用程式都有影響。Such a change of era affects all applications that use these calendars. 若要取得詳細資訊及判斷您的應用程式是否受影響,請參閱 Handling a new era in the Japanese calendar in .NET (處理 .NET 中日本日曆的新紀元)。See Handling a new era in the Japanese calendar in .NET for more information and to determine whether your applications are affected. 若要了解如何在 Windows 系統上測試您的應用程式,確保其已準備好面對紀元變更,請參閱 Prepare your application for the Japanese era change (讓應用程式準備好因應日本紀元變更)。See Prepare your application for the Japanese era change for information on testing your applications on Windows systems to ensure their readiness for the era change. 請參閱使用紀年以了解 .NET 中支援使用多種紀年的日曆,以及在處理支援多種紀年的日曆時能採用最佳做法。See Working with eras for features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras.

不同于 JapaneseCalendar 類別,JapaneseLunisolarCalendar 類別不支援 Meiji 和 Taisho 紀元範圍中的日期。Unlike the JapaneseCalendar class, the JapaneseLunisolarCalendar class does not support dates in the range of the Meiji and Taisho eras.

這個類別會將數位指派給紀元,如下所示:This class assigns numbers to the eras as follows:

GetEra 值GetEra value 紀元名稱Era Name 紀元縮寫Era Abbreviation 西曆日期Gregorian Dates
55 令和 (Reiwa)令和 (Reiwa) 令和(R,r)令和 (R, r) 2019 5 月1日呈現May 1, 2019 to present
44 平成 (Heisei)平成 (Heisei) 平(H,h)平 (H, h) 1989年1月8日至4月30日,2019January 8, 1989 to April 30, 2019
33 昭和 (Showa)昭和 (Showa) 昭(秒)昭 (S, s) 1926年12月25日至1989年1月7日December 25, 1926 to January 7, 1989
22 大正 (Taisho)大正 (Taisho) 大(T,t)大 (T, t) 1912年7月30日至12月24日,1926July 30, 1912 to December 24, 1926
11 明治 (Meiji)明治 (Meiji) 明(M,m)明 (M, m) 1912年9月 1868 8 日至7月29日September 8, 1868 to July 29, 1912

目前,CultureInfo 類別所支援的任何文化特性都不會使用 JapaneseLunisolarCalendarCurrently, the JapaneseLunisolarCalendar is not used by any of the cultures supported by the CultureInfo class. 因此,這個類別只能用來計算日本陰陽曆中的日期。Therefore, this class can be used only to calculate dates in the Japanese lunisolar calendar. 它不能做為 CultureInfo 類別所支援之任何文化特性的預設行事曆。It cannot be used as the default calendar for any culture supported by the CultureInfo class.

每個 CultureInfo 物件都支援一組行事曆。Each CultureInfo object supports a set of calendars. CultureInfo.Calendar 屬性會傳回文化特性的預設行事曆,而 CultureInfo.OptionalCalendars 屬性會傳回陣列,其中包含文化特性支援的所有行事曆。The CultureInfo.Calendar property returns the default calendar for the culture, and the CultureInfo.OptionalCalendars property returns an array containing all the calendars supported by the culture. 您可以將預設行事曆變更為 CultureInfo 實例所支援的任何一個選用行事曆。You can change the default calendar to any one of the optional calendars supported by a CultureInfo instance. 若要這麼做,請將 CultureInfo.DateTimeFormat 屬性所傳回之 DateTimeFormatInfo 物件的 Calendar 屬性設定為新的 CalendarTo do this, set the Calendar property of the DateTimeFormatInfo object returned by the CultureInfo.DateTimeFormat property to the new Calendar.

建構函式

JapaneseLunisolarCalendar()

初始化 JapaneseLunisolarCalendar 類別的新執行個體。Initializes a new instance of the JapaneseLunisolarCalendar class.

欄位

CurrentEra

表示目前曆法的目前紀元。Represents the current era of the current calendar. 此欄位的值為 0。The value of this field is 0.

(繼承來源 Calendar)
JapaneseEra

指定目前的紀元。Specifies the current era.

屬性

AlgorithmType

取得值,指出目前的月曆是以陽曆為主、以陰曆為主,還是同時包含兩種曆法。Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both.

(繼承來源 EastAsianLunisolarCalendar)
DaysInYearBeforeMinSupportedYear

取得 MinSupportedDateTime 屬性指定之年的前一年的天數。Gets the number of days in the year that precedes the year that is specified by the MinSupportedDateTime property.

Eras

取得與 JapaneseLunisolarCalendar 物件相關的紀元。Gets the eras that are relevant to the JapaneseLunisolarCalendar object.

IsReadOnly

取得值,指出 Calendar 物件是否為唯讀。Gets a value indicating whether this Calendar object is read-only.

(繼承來源 Calendar)
MaxSupportedDateTime

取得受 JapaneseLunisolarCalendar 類別所支援的日期和時間的最大值。Gets the maximum date and time supported by the JapaneseLunisolarCalendar class.

MinSupportedDateTime

取得受 JapaneseLunisolarCalendar 類別所支援的日期和時間的最小值。Gets the minimum date and time supported by the JapaneseLunisolarCalendar class.

TwoDigitYearMax

取得或設定以二位數年份表示時,該 100 年範圍的最後一年。Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.

(繼承來源 EastAsianLunisolarCalendar)

方法

AddDays(DateTime, Int32)

傳回與指定 DateTime 相差指定日數的 DateTimeReturns a DateTime that is the specified number of days away from the specified DateTime.

(繼承來源 Calendar)
AddHours(DateTime, Int32)

傳回與指定 DateTime 相差指定時數的 DateTimeReturns a DateTime that is the specified number of hours away from the specified DateTime.

(繼承來源 Calendar)
AddMilliseconds(DateTime, Double)

傳回與指定 DateTime 相差指定毫秒數的 DateTimeReturns a DateTime that is the specified number of milliseconds away from the specified DateTime.

(繼承來源 Calendar)
AddMinutes(DateTime, Int32)

傳回與指定 DateTime 相差指定分鐘數的 DateTimeReturns a DateTime that is the specified number of minutes away from the specified DateTime.

(繼承來源 Calendar)
AddMonths(DateTime, Int32)

計算與指定日期相差指定月數的日期。Calculates the date that is the specified number of months away from the specified date.

(繼承來源 EastAsianLunisolarCalendar)
AddSeconds(DateTime, Int32)

傳回與指定 DateTime 相差指定秒數的 DateTimeReturns a DateTime that is the specified number of seconds away from the specified DateTime.

(繼承來源 Calendar)
AddWeeks(DateTime, Int32)

傳回與指定 DateTime 相差指定週數的 DateTimeReturns a DateTime that is the specified number of weeks away from the specified DateTime.

(繼承來源 Calendar)
AddYears(DateTime, Int32)

計算與指定日期相差指定年份的日期。Calculates the date that is the specified number of years away from the specified date.

(繼承來源 EastAsianLunisolarCalendar)
Clone()

建立目前 Calendar 物件複本的新物件。Creates a new object that is a copy of the current Calendar object.

(繼承來源 Calendar)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetCelestialStem(Int32)

計算以六十年 (60 年) 為週期中指定年份的天干。Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle.

(繼承來源 EastAsianLunisolarCalendar)
GetDayOfMonth(DateTime)

計算指定日期中月份的日期。Calculates the day of the month in the specified date.

(繼承來源 EastAsianLunisolarCalendar)
GetDayOfWeek(DateTime)

計算指定日期中一週的日期。Calculates the day of the week in the specified date.

(繼承來源 EastAsianLunisolarCalendar)
GetDayOfYear(DateTime)

計算指定日期中年份的日期。Calculates the day of the year in the specified date.

(繼承來源 EastAsianLunisolarCalendar)
GetDaysInMonth(Int32, Int32)

傳回目前紀元之指定月份和年份中的天數。Returns the number of days in the specified month and year of the current era.

(繼承來源 Calendar)
GetDaysInMonth(Int32, Int32, Int32)

計算指定年份和紀元的指定月份中的天數。Calculates the number of days in the specified month of the specified year and era.

(繼承來源 EastAsianLunisolarCalendar)
GetDaysInYear(Int32)

傳回目前紀元之指定年份中的天數。Returns the number of days in the specified year of the current era.

(繼承來源 Calendar)
GetDaysInYear(Int32, Int32)

計算指定年份和紀元中的天數。Calculates the number of days in the specified year and era.

(繼承來源 EastAsianLunisolarCalendar)
GetEra(DateTime)

擷取對應於指定的 DateTime 之紀元。Retrieves the era that corresponds to the specified DateTime.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetHour(DateTime)

傳回指定 DateTime 中的小時值。Returns the hours value in the specified DateTime.

(繼承來源 Calendar)
GetLeapMonth(Int32)

計算指定年份的閏月。Calculates the leap month for a specified year.

(繼承來源 Calendar)
GetLeapMonth(Int32, Int32)

計算指定年份和紀元的閏月。Calculates the leap month for the specified year and era.

(繼承來源 EastAsianLunisolarCalendar)
GetMilliseconds(DateTime)

傳回指定 DateTime 中的毫秒值。Returns the milliseconds value in the specified DateTime.

(繼承來源 Calendar)
GetMinute(DateTime)

傳回指定 DateTime 中的分鐘值。Returns the minutes value in the specified DateTime.

(繼承來源 Calendar)
GetMonth(DateTime)

傳回指定日期中的月份。Returns the month in the specified date.

(繼承來源 EastAsianLunisolarCalendar)
GetMonthsInYear(Int32)

傳回目前紀元的指定年份中的月數。Returns the number of months in the specified year in the current era.

(繼承來源 Calendar)
GetMonthsInYear(Int32, Int32)

計算指定年份和紀元中的月數。Calculates the number of months in the specified year and era.

(繼承來源 EastAsianLunisolarCalendar)
GetSecond(DateTime)

傳回指定 DateTime 中的秒值。Returns the seconds value in the specified DateTime.

(繼承來源 Calendar)
GetSexagenaryYear(DateTime)

計算以六十年 (60 年) 為週期中對應至指定日期的年份。Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date.

(繼承來源 EastAsianLunisolarCalendar)
GetTerrestrialBranch(Int32)

計算以六十年 (60 年) 為週期中指定年份的地支。Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle.

(繼承來源 EastAsianLunisolarCalendar)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek)

傳回年份中的週,其中包含指定之 DateTime 值中的日期。Returns the week of the year that includes the date in the specified DateTime value.

(繼承來源 Calendar)
GetYear(DateTime)

傳回指定日期中的年份。Returns the year in the specified date.

(繼承來源 EastAsianLunisolarCalendar)
IsLeapDay(Int32, Int32, Int32)

判斷目前紀元中指定日期是否為閏日。Determines whether the specified date in the current era is a leap day.

(繼承來源 Calendar)
IsLeapDay(Int32, Int32, Int32, Int32)

判斷指定紀元中指定的日期是否為閏日。Determines whether the specified date in the specified era is a leap day.

(繼承來源 EastAsianLunisolarCalendar)
IsLeapMonth(Int32, Int32)

判斷目前紀元的指定年份中指定的月份是否為閏月。Determines whether the specified month in the specified year in the current era is a leap month.

(繼承來源 Calendar)
IsLeapMonth(Int32, Int32, Int32)

判斷指定年份和紀元中的指定月份是否為閏月。Determines whether the specified month in the specified year and era is a leap month.

(繼承來源 EastAsianLunisolarCalendar)
IsLeapYear(Int32)

判斷目前紀元中指定的年份是否為閏年。Determines whether the specified year in the current era is a leap year.

(繼承來源 Calendar)
IsLeapYear(Int32, Int32)

判斷指定紀元中指定的年份是否為閏年。Determines whether the specified year in the specified era is a leap year.

(繼承來源 EastAsianLunisolarCalendar)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)

傳回設定為目前紀元中指定日期和時間的 DateTimeReturns a DateTime that is set to the specified date and time in the current era.

(繼承來源 Calendar)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

傳回 DateTime 物件,其設定為指定日期、時間和紀元。Returns a DateTime that is set to the specified date, time, and era.

(繼承來源 EastAsianLunisolarCalendar)
ToFourDigitYear(Int32)

將指定的年份轉換成 4 位數年份。Converts the specified year to a four-digit year.

(繼承來源 EastAsianLunisolarCalendar)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱