Module calendrical_calculations::chinese_based
source Β· Expand description
Chinese-like lunar calendars (Chinese, Dangi)
Structs§
- A type implementing
ChineseBased
for the Chinese calendar - chinese_based_date_from_fixed returns extra things for use in caching
- A type implementing
ChineseBased
for the Dangi (Korean) calendar - Marks the bounds of a lunar year
Constants§
- CHINES
E_ πEPOCH - CHINES
E_ πEPOC H_ ISO - FIXE
D_ π1908 - FIXE
D_ π1912 - FIXE
D_ π1954 - FIXE
D_ π1961 - KOREA
N_ πELEVATION - KOREA
N_ πEPOCH - KOREA
N_ πEPOC H_ ISO - KOREA
N_ πLATITUDE - KOREA
N_ πLOCATIO N_ 1908 - KOREA
N_ πLOCATIO N_ 1912 - KOREA
N_ πLOCATIO N_ 1954 - KOREA
N_ πLOCATIO N_ 1961 - KOREA
N_ πLONGITUDE - UTC_
OFFSE πT_ 1908 - UTC_
OFFSE πT_ 1912 - UTC_
OFFSE πT_ 1954 - UTC_
OFFSE πT_ 1961 - UTC_
OFFSE πT_ ORIGINAL The Korean Dangi calendar relies on knowing the current day at the moment of a new moon; however, this can vary depending on location. As such, new moon calculations are based on the time in Seoul. Before 1908, local time was used, represented as UTC+(3809/450 h). This changed multiple times as different standard timezones were adopted in Korea. Currently, UTC+9h is used. - UTC_
OFFSE πT_ POST_ 1929 - UTC_
OFFSE πT_ PRE_ 1929 The Chinese calendar relies on knowing the current day at the moment of a new moon; however, this can vary depending on location. As such, new moon calculations are based on the time in Beijing. Before 1929, local time was used, represented as UTC+(1397/180 h). In 1929, China adopted a standard time zone based on 120 degrees of longitude, meaning from 1929 onward, all new moon calculations are based on UTC+8h.
Traits§
- The trait ChineseBased is used by Chinese-based calendars to perform computations shared by such calendar. To do so, calendars should:
Functions§
- bind_
winter_ πsolstice This function forces the RataDie to be on December 20, 21, 22, or 23. It was created for practical considerations and is not in the text. - Get a chinese based date from a fixed date, with the related ISO year
- Returns the number of days in the given
month
after the givennew_year
. Also returns the RataDie of the new moon beginning the next month. - Given a new year, calculate the number of days in the previous year
- Calculated the numbers of days in the given year
- Given the new year and a month/day pair, calculate the number of days until the first day of the given month
- Get a RataDie in the middle of a year.
- Given that
new_year
is the first day of a leap year, find which month in the year is a leap month. - Whether this year is a leap year
- The last month and day in this year
- Get the current major solar term of a fixed date, output as an integer from 1..=12.
- midnight πUniversal time of midnight at start of a Momentβs day at the observation location
- Returns the number of days in the given (year, month).
- Returns the length of each month in the year, as well as a leap month index (1-indexed) if any.
- new_
moon_ πbefore The fixed date in standard time at the observation location of the previous new moon before a given Moment. - new_
moon_ πon_ or_ after The fixed date in standard time at the observation location of the next new moon on or after a given Moment. - new_
year_ πin_ sui Determines the fixed date of the lunar new year given the start of its corresponding solar year (ζ²), which is also the winter solstice - Get the fixed date of the nearest Lunar New Year on or before a given fixed date. This function also returns the solstice following a given date for optimization (see #3743).
- Get the fixed date of the nearest winter solstice, in the Chinese time zone, on or before a given fixed date.