Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Globalization.​JapaneseLunisolarCalendar
Assembly: System.Runtime
Inheritance: object → Calendar → EastAsianLunisolarCalendar → JapaneseLunisolarCalendar
Implemented Interfaces
- ICloneable Implemented by: Calendar
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.
Fields and Constants
public const
int
JapaneseEra
Specifies the current era.
Properties
protected
int
DaysInYearBeforeMinSupportedYear
Gets the number of days in the year that precedes the year that is specified by the <see cref="P:System.Globalization.JapaneseLunisolarCalendar.MinSupportedDateTime" /> property.
public
int[]
Eras
Gets the eras that are relevant to the <see cref="T:System.Globalization.JapaneseLunisolarCalendar" /> object.
public
DateTime
MaxSupportedDateTime
Gets the maximum date and time supported by the <see cref="T:System.Globalization.JapaneseLunisolarCalendar" /> class.
public
DateTime
MinSupportedDateTime
Gets the minimum date and time supported by the <see cref="T:System.Globalization.JapaneseLunisolarCalendar" /> class.
public
CalendarAlgorithmType
AlgorithmType
Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both.
public
int
TwoDigitYearMax
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
public
bool
IsReadOnly
Gets a value indicating whether this <see cref="T:System.Globalization.Calendar" /> object is read-only.
Methods
public
int
GetEra​(DateTime time)
Retrieves the era that corresponds to the specified <see cref="T:System.DateTime" /> .
Returns An integer that represents the era specified in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
DateTime
AddMonths​(DateTime time,
int months)
Inherited from EastAsianLunisolarCalendar
Calculates the date that is the specified number of months away from the specified date.
Returns A new <see cref="T:System.DateTime" /> that results from adding the specified number of months to the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to which to add <paramref name="months" /> .
months
The number of months to add.
public
DateTime
AddYears​(DateTime time,
int years)
Inherited from EastAsianLunisolarCalendar
Calculates the date that is the specified number of years away from the specified date.
Returns A new <see cref="T:System.DateTime" /> that results from adding the specified number of years to the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to which to add <paramref name="years" /> .
years
The number of years to add.
public
int
GetCelestialStem​(int sexagenaryYear)
Inherited from EastAsianLunisolarCalendar
Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle.
Returns A number from 1 through 10.
sexagenaryYear
An integer from 1 through 60 that represents a year in the sexagenary cycle.
public
int
GetDayOfMonth​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Calculates the day of the month in the specified date.
Returns An integer from 1 through 31 that represents the day of the month specified in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
DayOfWeek
GetDayOfWeek​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Calculates the day of the week in the specified date.
Returns One of the <see cref="T:System.DayOfWeek" /> values that represents the day of the week specified in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetDayOfYear​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Calculates the day of the year in the specified date.
Returns An integer from 1 through 354 in a common year, or 1 through 384 in a leap year, that represents the day of the year specified in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetDaysInMonth​(int year,
int month,
int era)
Inherited from EastAsianLunisolarCalendar
Calculates the number of days in the specified month of the specified year and era.
Returns The number of days in the specified month of the specified year and era.
year
An integer that represents the year.
month
An integer from 1 through 12 in a common year, or 1 through 13 in a leap year, that represents the month.
era
An integer that represents the era.
public
int
GetDaysInYear​(int year,
int era)
Inherited from EastAsianLunisolarCalendar
Calculates the number of days in the specified year and era.
Returns The number of days in the specified year and era.
year
An integer that represents the year.
era
An integer that represents the era.
public
int
GetLeapMonth​(int year,
int era)
Inherited from EastAsianLunisolarCalendar
Calculates the leap month for the specified year and era.
Returns A positive integer from 1 through 13 that indicates the leap month in the specified year and era.
-or-
Zero if this calendar does not support a leap month, or if the <paramref name="year" /> and <paramref name="era" /> parameters do not specify a leap year.
year
An integer that represents the year.
era
An integer that represents the era.
public
int
GetMonth​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Returns the month in the specified date.
Returns An integer from 1 to 13 that represents the month specified in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetMonthsInYear​(int year,
int era)
Inherited from EastAsianLunisolarCalendar
Calculates the number of months in the specified year and era.
Returns The number of months in the specified year in the specified era. The return value is 12 months in a common year or 13 months in a leap year.
year
An integer that represents the year.
era
An integer that represents the era.
public
int
GetSexagenaryYear​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date.
Returns A number from 1 through 60 in the sexagenary cycle that corresponds to the <paramref name="time" /> parameter.
time
A <see cref="T:System.DateTime" /> to read.
public
int
GetTerrestrialBranch​(int sexagenaryYear)
Inherited from EastAsianLunisolarCalendar
Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle.
Returns An integer from 1 through 12.
sexagenaryYear
An integer from 1 through 60 that represents a year in the sexagenary cycle.
public
int
GetYear​(DateTime time)
Inherited from EastAsianLunisolarCalendar
Returns the year in the specified date.
Returns An integer that represents the year in the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to read.
public
bool
IsLeapDay​(int year,
int month,
int day,
int era)
Inherited from EastAsianLunisolarCalendar
Determines whether the specified date in the specified era is a leap day.
Returns <see langword="true" /> if the specified day is a leap day; otherwise, <see langword="false" /> .
year
An integer that represents the year.
month
An integer from 1 through 13 that represents the month.
day
An integer from 1 through 31 that represents the day.
era
An integer that represents the era.
public
bool
IsLeapMonth​(int year,
int month,
int era)
Inherited from EastAsianLunisolarCalendar
Determines whether the specified month in the specified year and era is a leap month.
Returns <see langword="true" /> if the <paramref name="month" /> parameter is a leap month; otherwise, <see langword="false" /> .
year
An integer that represents the year.
month
An integer from 1 through 13 that represents the month.
era
An integer that represents the era.
public
bool
IsLeapYear​(int year,
int era)
Inherited from EastAsianLunisolarCalendar
Determines whether the specified year in the specified era is a leap year.
Returns <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" /> .
year
An integer that represents the year.
era
An integer that represents the era.
public
DateTime
ToDateTime​(int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond,
int era)
Inherited from EastAsianLunisolarCalendar
Returns a <see cref="T:System.DateTime" /> that is set to the specified date, time, and era.
Returns A <see cref="T:System.DateTime" /> that is set to the specified date, time, and era.
year
An integer that represents the year.
month
An integer from 1 through 13 that represents the month.
day
An integer from 1 through 31 that represents the day.
hour
An integer from 0 through 23 that represents the hour.
minute
An integer from 0 through 59 that represents the minute.
second
An integer from 0 through 59 that represents the second.
millisecond
An integer from 0 through 999 that represents the millisecond.
era
An integer that represents the era.
public
int
ToFourDigitYear​(int year)
Inherited from EastAsianLunisolarCalendar
Converts the specified year to a four-digit year.
Returns An integer that contains the four-digit representation of the <paramref name="year" /> parameter.
year
A two-digit or four-digit integer that represents the year to convert.
public
DateTime
AddDays​(DateTime time,
int days)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of days away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of days to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to which to add days.
days
The number of days to add.
public
DateTime
AddHours​(DateTime time,
int hours)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of hours away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of hours to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to which to add hours.
hours
The number of hours to add.
public
DateTime
AddMilliseconds​(DateTime time,
double milliseconds)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of milliseconds away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of milliseconds to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to add milliseconds to.
milliseconds
The number of milliseconds to add.
public
DateTime
AddMinutes​(DateTime time,
int minutes)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of minutes away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of minutes to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to which to add minutes.
minutes
The number of minutes to add.
public
DateTime
AddSeconds​(DateTime time,
int seconds)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of seconds away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of seconds to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to which to add seconds.
seconds
The number of seconds to add.
public
DateTime
AddWeeks​(DateTime time,
int weeks)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is the specified number of weeks away from the specified <see cref="T:System.DateTime" /> .
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of weeks to the specified <see cref="T:System.DateTime" /> .
time
The <see cref="T:System.DateTime" /> to which to add weeks.
weeks
The number of weeks to add.
public
object
Clone​()
Inherited from Calendar
Creates a new object that is a copy of the current <see cref="T:System.Globalization.Calendar" /> object.
Returns A new instance of <see cref="T:System.Object" /> that is the memberwise clone of the current <see cref="T:System.Globalization.Calendar" /> object.
public
int
GetDaysInMonth​(int year,
int month)
Inherited from Calendar
Returns the number of days in the specified month and year of the current era.
Returns The number of days in the specified month in the specified year in the current era.
year
An integer that represents the year.
month
A positive integer that represents the month.
public
int
GetDaysInYear​(int year)
Inherited from Calendar
Returns the number of days in the specified year of the current era.
Returns The number of days in the specified year in the current era.
year
An integer that represents the year.
public
int
GetHour​(DateTime time)
Inherited from Calendar
Returns the hours value in the specified <see cref="T:System.DateTime" /> .
Returns An integer from 0 to 23 that represents the hour in <paramref name="time" /> .
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetLeapMonth​(int year)
Inherited from Calendar
Calculates the leap month for a specified year.
Returns A positive integer that indicates the leap month in the specified year.
-or-
Zero if this calendar does not support a leap month or if the <paramref name="year" /> parameter does not represent a leap year.
year
A year.
public
double
GetMilliseconds​(DateTime time)
Inherited from Calendar
Returns the milliseconds value in the specified <see cref="T:System.DateTime" /> .
Returns A double-precision floating-point number from 0 to 999 that represents the milliseconds in the <paramref name="time" /> parameter.
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetMinute​(DateTime time)
Inherited from Calendar
Returns the minutes value in the specified <see cref="T:System.DateTime" /> .
Returns An integer from 0 to 59 that represents the minutes in <paramref name="time" /> .
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetMonthsInYear​(int year)
Inherited from Calendar
Returns the number of months in the specified year in the current era.
Returns The number of months in the specified year in the current era.
year
An integer that represents the year.
public
int
GetSecond​(DateTime time)
Inherited from Calendar
Returns the seconds value in the specified <see cref="T:System.DateTime" /> .
Returns An integer from 0 to 59 that represents the seconds in <paramref name="time" /> .
time
The <see cref="T:System.DateTime" /> to read.
public
int
GetWeekOfYear​(DateTime time,
CalendarWeekRule rule,
DayOfWeek firstDayOfWeek)
Inherited from Calendar
Returns the week of the year that includes the date in the specified <see cref="T:System.DateTime" /> value.
Returns A positive integer that represents the week of the year that includes the date in the <paramref name="time" /> parameter.
time
A date and time value.
rule
An enumeration value that defines a calendar week.
firstDayOfWeek
An enumeration value that represents the first day of the week.
public
bool
IsLeapDay​(int year,
int month,
int day)
Inherited from Calendar
Determines whether the specified date in the current era is a leap day.
Returns <see langword="true" /> if the specified day is a leap day; otherwise, <see langword="false" /> .
year
An integer that represents the year.
month
A positive integer that represents the month.
day
A positive integer that represents the day.
public
bool
IsLeapMonth​(int year,
int month)
Inherited from Calendar
Determines whether the specified month in the specified year in the current era is a leap month.
Returns <see langword="true" /> if the specified month is a leap month; otherwise, <see langword="false" /> .
year
An integer that represents the year.
month
A positive integer that represents the month.
public
bool
IsLeapYear​(int year)
Inherited from Calendar
Determines whether the specified year in the current era is a leap year.
Returns <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" /> .
year
An integer that represents the year.
public
DateTime
ToDateTime​(int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond)
Inherited from Calendar
Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.
Returns The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.
year
An integer that represents the year.
month
A positive integer that represents the month.
day
A positive integer that represents the day.
hour
An integer from 0 to 23 that represents the hour.
minute
An integer from 0 to 59 that represents the minute.
second
An integer from 0 to 59 that represents the second.
millisecond
An integer from 0 to 999 that represents the millisecond.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.