JapaneseLunisolarCalendar JapaneseLunisolarCalendar JapaneseLunisolarCalendar JapaneseLunisolarCalendar Class

定义

表示时间划分方式,例如“月”、“日”和“年”。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类派生自EastAsianLunisolarCalendar类,该类表示阴阳历。The JapaneseLunisolarCalendar class is derived from the EastAsianLunisolarCalendar class, which represents the lunisolar calendar. EastAsianLunisolarCalendar类支持甲子年循环 (重复每隔 60 年) 除了 solar 年和阴历月。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 中的第九个月返回 8。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.

备注

有关使用信息JapaneseLunisolarCalendar类和其他日历.NET 类库中的类,请参阅使用日历For information about using the JapaneseLunisolarCalendar class and the other calendar classes in the .NET Class Library, see Working with Calendars.

JapaneseLuniSolarCalendar类识别为每个皇帝 reign 一个纪元。The JapaneseLuniSolarCalendar class recognizes one era for every emperor's reign. 例如,两个最新纪元为平成时代,公历 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 年为日语日历年平成 13。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." 因此,公历 1989 年是日语日历平成元年。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 系统上测试应用程序以确保针对元号更改的准备情况信息。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类不支持的明治和 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) 1,2019 年 5 提供May 1, 2019 to present
44 平成 (日本平成 12)平成 (Heisei) 平 (H,h)平 (H, h) 年 1 月 8 日 1989 1989年提供January 8, 1989 to present
33 昭和 (Showa)昭和 (Showa) 昭 (S,s)昭 (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日日到 1926 年 12 月 24日,July 30, 1912 to December 24, 1926
11 明治 (明治)明治 (Meiji) 明 (M、 m)明 (M, m) 1868 年 9 月 8日日至 1912 年 7 月 29日日September 8, 1868 to July 29, 1912

目前,JapaneseLunisolarCalendar不使用任何支持的区域性CultureInfo类。Currently, 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. 若要执行此操作,设置Calendar的属性DateTimeFormatInfo返回的对象CultureInfo.DateTimeFormat属性设置为新CalendarTo do this, set the Calendar property of the DateTimeFormatInfo object returned by the CultureInfo.DateTimeFormat property to the new Calendar.

构造函数

JapaneseLunisolarCalendar() JapaneseLunisolarCalendar() JapaneseLunisolarCalendar() JapaneseLunisolarCalendar()

初始化 JapaneseLunisolarCalendar 类的新实例。Initializes a new instance of the JapaneseLunisolarCalendar class.

字段

CurrentEra CurrentEra CurrentEra CurrentEra

表示当前日历的当前纪元。Represents the current era of the current calendar. 字段的值为 0。The value of this field is 0.

(Inherited from Calendar)
JapaneseEra JapaneseEra JapaneseEra JapaneseEra

指定当前纪元。Specifies the current era.

属性

AlgorithmType AlgorithmType AlgorithmType AlgorithmType

获取一个值,该值指示当前日历是阳历、阴历还是二者的组合。Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both.

(Inherited from EastAsianLunisolarCalendar)
DaysInYearBeforeMinSupportedYear DaysInYearBeforeMinSupportedYear DaysInYearBeforeMinSupportedYear DaysInYearBeforeMinSupportedYear

获取 MinSupportedDateTime 属性指定的年份之前的年中天数。Gets the number of days in the year that precedes the year that is specified by the MinSupportedDateTime property.

Eras Eras Eras Eras

获取与 JapaneseLunisolarCalendar 对象相关的纪元。Gets the eras that are relevant to the JapaneseLunisolarCalendar object.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

获取一个值,该值指示此 Calendar 对象是否为只读。Gets a value indicating whether this Calendar object is read-only.

(Inherited from Calendar)
MaxSupportedDateTime MaxSupportedDateTime MaxSupportedDateTime MaxSupportedDateTime

获取 JapaneseLunisolarCalendar 类支持的最晚日期和时间。Gets the maximum date and time supported by the JapaneseLunisolarCalendar class.

MinSupportedDateTime MinSupportedDateTime MinSupportedDateTime MinSupportedDateTime

获取 JapaneseLunisolarCalendar 类支持的最早日期和时间。Gets the minimum date and time supported by the JapaneseLunisolarCalendar class.

TwoDigitYearMax TwoDigitYearMax TwoDigitYearMax TwoDigitYearMax

获取或设置可以用两位数年份表示的 100 年范围内的最后一年。Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.

(Inherited from EastAsianLunisolarCalendar)

方法

AddDays(DateTime, Int32) AddDays(DateTime, Int32) AddDays(DateTime, Int32) AddDays(DateTime, Int32)

返回与指定 DateTime 相距指定天数的 DateTimeReturns a DateTime that is the specified number of days away from the specified DateTime.

(Inherited from Calendar)
AddHours(DateTime, Int32) AddHours(DateTime, Int32) AddHours(DateTime, Int32) AddHours(DateTime, Int32)

返回与指定 DateTime 相距指定小时数的 DateTimeReturns a DateTime that is the specified number of hours away from the specified DateTime.

(Inherited from Calendar)
AddMilliseconds(DateTime, Double) AddMilliseconds(DateTime, Double) AddMilliseconds(DateTime, Double) AddMilliseconds(DateTime, Double)

返回与指定 DateTime 相距指定毫秒数的 DateTimeReturns a DateTime that is the specified number of milliseconds away from the specified DateTime.

(Inherited from Calendar)
AddMinutes(DateTime, Int32) AddMinutes(DateTime, Int32) AddMinutes(DateTime, Int32) AddMinutes(DateTime, Int32)

返回与指定 DateTime 相距指定分钟数的 DateTimeReturns a DateTime that is the specified number of minutes away from the specified DateTime.

(Inherited from Calendar)
AddMonths(DateTime, Int32) AddMonths(DateTime, Int32) AddMonths(DateTime, Int32) AddMonths(DateTime, Int32)

计算与指定日期相距指定月数的日期。Calculates the date that is the specified number of months away from the specified date.

(Inherited from EastAsianLunisolarCalendar)
AddSeconds(DateTime, Int32) AddSeconds(DateTime, Int32) AddSeconds(DateTime, Int32) AddSeconds(DateTime, Int32)

返回与指定 DateTime 相距指定秒数的 DateTimeReturns a DateTime that is the specified number of seconds away from the specified DateTime.

(Inherited from Calendar)
AddWeeks(DateTime, Int32) AddWeeks(DateTime, Int32) AddWeeks(DateTime, Int32) AddWeeks(DateTime, Int32)

返回与指定 DateTime 相距指定周数的 DateTimeReturns a DateTime that is the specified number of weeks away from the specified DateTime.

(Inherited from Calendar)
AddYears(DateTime, Int32) AddYears(DateTime, Int32) AddYears(DateTime, Int32) AddYears(DateTime, Int32)

计算与指定日期相距指定年数的日期。Calculates the date that is the specified number of years away from the specified date.

(Inherited from EastAsianLunisolarCalendar)
Clone() Clone() Clone() Clone()

创建表示当前 Calendar 对象副本的新对象。Creates a new object that is a copy of the current Calendar object.

(Inherited from Calendar)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetCelestialStem(Int32) GetCelestialStem(Int32) GetCelestialStem(Int32) GetCelestialStem(Int32)

计算甲子(60 年)循环中指定年份的天干。Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle.

(Inherited from EastAsianLunisolarCalendar)
GetDayOfMonth(DateTime) GetDayOfMonth(DateTime) GetDayOfMonth(DateTime) GetDayOfMonth(DateTime)

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

(Inherited from EastAsianLunisolarCalendar)
GetDayOfWeek(DateTime) GetDayOfWeek(DateTime) GetDayOfWeek(DateTime) GetDayOfWeek(DateTime)

计算指定日期中的周中日期。Calculates the day of the week in the specified date.

(Inherited from EastAsianLunisolarCalendar)
GetDayOfYear(DateTime) GetDayOfYear(DateTime) GetDayOfYear(DateTime) GetDayOfYear(DateTime)

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

(Inherited from EastAsianLunisolarCalendar)
GetDaysInMonth(Int32, Int32) GetDaysInMonth(Int32, Int32) GetDaysInMonth(Int32, Int32) GetDaysInMonth(Int32, Int32)

返回当前纪元的指定月份和年份中的天数。Returns the number of days in the specified month and year of the current era.

(Inherited from Calendar)
GetDaysInMonth(Int32, Int32, Int32) GetDaysInMonth(Int32, Int32, Int32) GetDaysInMonth(Int32, Int32, Int32) GetDaysInMonth(Int32, Int32, Int32)

计算指定纪元年份的指定月份中的天数。Calculates the number of days in the specified month of the specified year and era.

(Inherited from EastAsianLunisolarCalendar)
GetDaysInYear(Int32) GetDaysInYear(Int32) GetDaysInYear(Int32) GetDaysInYear(Int32)

返回当前纪元中指定年份的天数。Returns the number of days in the specified year of the current era.

(Inherited from Calendar)
GetDaysInYear(Int32, Int32) GetDaysInYear(Int32, Int32) GetDaysInYear(Int32, Int32) GetDaysInYear(Int32, Int32)

计算指定纪元年份中的天数。Calculates the number of days in the specified year and era.

(Inherited from EastAsianLunisolarCalendar)
GetEra(DateTime) GetEra(DateTime) GetEra(DateTime) GetEra(DateTime)

检索对应于指定 DateTime 的纪元。Retrieves the era that corresponds to the specified DateTime.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetHour(DateTime) GetHour(DateTime) GetHour(DateTime) GetHour(DateTime)

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

(Inherited from Calendar)
GetLeapMonth(Int32) GetLeapMonth(Int32) GetLeapMonth(Int32) GetLeapMonth(Int32)

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

(Inherited from Calendar)
GetLeapMonth(Int32, Int32) GetLeapMonth(Int32, Int32) GetLeapMonth(Int32, Int32) GetLeapMonth(Int32, Int32)

计算指定纪元年份的闰月。Calculates the leap month for the specified year and era.

(Inherited from EastAsianLunisolarCalendar)
GetMilliseconds(DateTime) GetMilliseconds(DateTime) GetMilliseconds(DateTime) GetMilliseconds(DateTime)

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

(Inherited from Calendar)
GetMinute(DateTime) GetMinute(DateTime) GetMinute(DateTime) GetMinute(DateTime)

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

(Inherited from Calendar)
GetMonth(DateTime) GetMonth(DateTime) GetMonth(DateTime) GetMonth(DateTime)

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

(Inherited from EastAsianLunisolarCalendar)
GetMonthsInYear(Int32) GetMonthsInYear(Int32) GetMonthsInYear(Int32) GetMonthsInYear(Int32)

返回当前纪元中指定年份的月数。Returns the number of months in the specified year in the current era.

(Inherited from Calendar)
GetMonthsInYear(Int32, Int32) GetMonthsInYear(Int32, Int32) GetMonthsInYear(Int32, Int32) GetMonthsInYear(Int32, Int32)

计算指定纪元年份中的月数。Calculates the number of months in the specified year and era.

(Inherited from EastAsianLunisolarCalendar)
GetSecond(DateTime) GetSecond(DateTime) GetSecond(DateTime) GetSecond(DateTime)

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

(Inherited from Calendar)
GetSexagenaryYear(DateTime) GetSexagenaryYear(DateTime) GetSexagenaryYear(DateTime) GetSexagenaryYear(DateTime)

计算与指定日期对应的甲子(60 年)循环中的年份。Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date.

(Inherited from EastAsianLunisolarCalendar)
GetTerrestrialBranch(Int32) GetTerrestrialBranch(Int32) GetTerrestrialBranch(Int32) GetTerrestrialBranch(Int32)

计算甲子(60 年)循环中指定年份的地支。Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle.

(Inherited from EastAsianLunisolarCalendar)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek)

返回一年中包含指定 DateTime 值中的日期的那个星期。Returns the week of the year that includes the date in the specified DateTime value.

(Inherited from Calendar)
GetYear(DateTime) GetYear(DateTime) GetYear(DateTime) GetYear(DateTime)

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

(Inherited from EastAsianLunisolarCalendar)
IsLeapDay(Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32)

确定当前纪元中的指定日期是否为闰日。Determines whether the specified date in the current era is a leap day.

(Inherited from Calendar)
IsLeapDay(Int32, Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32, Int32) IsLeapDay(Int32, Int32, Int32, Int32)

确定指定纪元中的指定日期是否为闰日。Determines whether the specified date in the specified era is a leap day.

(Inherited from EastAsianLunisolarCalendar)
IsLeapMonth(Int32, Int32) IsLeapMonth(Int32, Int32) IsLeapMonth(Int32, Int32) IsLeapMonth(Int32, Int32)

确定当前纪元中指定年份的指定月份是否为闰月。Determines whether the specified month in the specified year in the current era is a leap month.

(Inherited from Calendar)
IsLeapMonth(Int32, Int32, Int32) IsLeapMonth(Int32, Int32, Int32) IsLeapMonth(Int32, Int32, Int32) IsLeapMonth(Int32, Int32, Int32)

确定指定纪元年份中的指定月份是否为闰月。Determines whether the specified month in the specified year and era is a leap month.

(Inherited from EastAsianLunisolarCalendar)
IsLeapYear(Int32) IsLeapYear(Int32) IsLeapYear(Int32) IsLeapYear(Int32)

确定当前纪元中的指定年份是否为闰年。Determines whether the specified year in the current era is a leap year.

(Inherited from Calendar)
IsLeapYear(Int32, Int32) IsLeapYear(Int32, Int32) IsLeapYear(Int32, Int32) IsLeapYear(Int32, Int32)

确定指定纪元中的指定年份是否为闰年。Determines whether the specified year in the specified era is a leap year.

(Inherited from EastAsianLunisolarCalendar)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)

返回设置为当前纪元中指定日期和时间的 DateTimeReturns a DateTime that is set to the specified date and time in the current era.

(Inherited from Calendar)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

返回设置为指定的日期、时间和纪元的 DateTimeReturns a DateTime that is set to the specified date, time, and era.

(Inherited from EastAsianLunisolarCalendar)
ToFourDigitYear(Int32) ToFourDigitYear(Int32) ToFourDigitYear(Int32) ToFourDigitYear(Int32)

将指定的年份转换为四位数的年份。Converts the specified year to a four-digit year.

(Inherited from EastAsianLunisolarCalendar)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅