chinese_lunar_calendar library

Classes

Jing
Ke
刻 采取清代的定义,即一个时辰八刻:上四刻和下四刻 例如: 23:00 ~ 23:14 子初一刻 23:15 ~ 23:29 子初二刻 23:30 ~ 23:44 子初三刻 23:45 ~ 00:59 子初四刻 00:00 ~ 00:14 子正一刻 00:15 ~ 00:29 子正二刻 00:30 ~ 00:44 子正三刻 00:45 ~ 01:59 子正四刻
Located
LunarCalendar
LunarDate
阴历日期
LunarMonth
阴历月
LunarYear
阴历年
MoonPhase
SolarTerm
节气
TwoHourPeriod
时辰 0: 子时:23点到1点,三更; 1: 丑时:1点到3点,四更; 2: 寅时:3点到5点,五更; 3: 卯时:5点到7点; 4: 辰时:7点到9点; 5: 巳时:9点到11点; 6: 午时:11点到13点; 7: 未时:13点到15点; 8: 申时:15点到17点; 9: 酉时:17点到19点; 10: 戌时:19点到21点,一更; 11: 亥时:21点到23点,二更。
Weekday
Zodiac

Extensions

DateTimeDaysBetween on DateTime
Calculate days between two DateTime
DateTimeSolarTermsKey on DateTime
Generate the key for indicating solar term
IntDigits on int
Convert integer to an array of its digits
IntTwoDigitsString on int
Get an integer's last two digits in String if the integer is single digit, add a '0' on the left
JingCN on Jing
KeX on Ke
LunarCalendar8Char on LunarCalendar
八字相关扩展
LunarCalendarChineseNewYear on LunarCalendar
LunarCalendarTime on LunarCalendar
LunarDateCN on LunarDate
LunarDateMoonPhase on LunarDate
LunarMonthX on LunarMonth
LunarYearX on LunarYear
SolarTermDateTime on DateTime
TwoHourPeriodJing on TwoHourPeriod
TwoHourPeriodX on TwoHourPeriod

Constants

chu → const String
da → const String
dayStemToTwoHoursStemChart → const Map<String, List<String>>
日干时干对应表 https://www.hko.gov.hk/sc/gts/time/stemsandbranches.htm
jing → const String
ke → const String
leapMonthNumBit → const int
lunarDayNameList → const List<String>
日期汉字
lunarMonthData → const List<int>
农历数据 每个元素的存储格式如下: *1613 12 110 闰几月 闰月日数 112月份农历日数 1、bit0表示农历1月份日数,为1表示30天,为0表示29天。bit1表示农历2月份日数,依次类推。 2、bit12表示闰月日数,1为30天,0为29天。 3、bit16bit13表示第几月是闰月(注:为0表示该年无闰月) 例如:2023年 0 4 a d a 十六进制转换成二进制为: 0000 010 0 1010 1101 1010 2月闰月 闰月29天 12~1月天数
lunarNewYearList → const List<int>
农历数据 每个元素的存储格式如下: 76 51 春节月 春节日
monthDayBit → const int
nian → const String
ri → const String
sSolarTerms → const List<String>
简体中文节气名
startYear → const int
本万年历从1901年始
the10HeavenlyStems → const List<String>
天干
the10HeavenlyStemsAnd12EarthlyBranches → const List<String>
六十天干地支组合
the12EarthlyBranches → const List<String>
地支
tSolarTerms → const List<String>
繁体中文节气名
twoHourPeriodLuckyTimeList → const List<int>
时辰吉凶时间表
upperCNNum → const List<String>
数字汉字
weekDayCN → const List<String>
星期汉字
xiao → const String
yearStemToMonthStemChart → const Map<String, List<String>>
年干月干对应表 https://www.hko.gov.hk/sc/gts/time/stemsandbranches.htm
yue → const String
zheng → const String

Properties

ji → Located
吉
final
lunarMonthNameList → List<Located>
月份汉字
final
meridiansName → List<Located>
时辰经络
final
nextSolarTerm → SolarTerm?
no setter
phaseOfMoon → List<Located>
月相名
final
run → Located
闰
final
solarTermNames ↔ List<Located>
getter/setter pair
solarTermsData2023 → List<List<int>>
数据源 https://www.hko.gov.hk/sc/gts/astronomy/Solar_Term.htm 数据使用中国标准时间 数据精确到年月日时分 2023 solar terms year, month, day, hour, minute
final
solarTermsData2024 → List<List<int>>
2024 solar terms year, month, day, hour, minute
final
solarTermsData2025 → List<List<int>>
2025 solar terms year, month, day, hour, minute
final
solarTermsData2026 → List<List<int>>
2026 solar terms year, month, day, hour, minute
final
solarTermsData2027 → List<List<int>>
2027 solar terms year, month, day, hour, minute
final
solarTermsData2028 → List<List<int>>
2028 solar terms year, month, day, hour, minute
final
supportedSolarTermsYear → List<int>
支持的节气年份
final
todaySolarTerm → SolarTerm?
no setter
twoHourPeriodHanName → List<Located>
十二时辰汉代命名
final
xiong → Located
凶
final
zodiacList → List<Zodiac>
final

Functions

cstToUTC({required DateTime cst}) → DateTime
Convert CST to UTC
getChineseNewYear(int year) → DateTime
根据阳历年份查表计算春节日期 返回的是当地时间
getLichun(int year) → SolarTerm
getLocatedList({required List<String> traditional, required List<String> simplified}) → List<Located>
getSolarTerms(int year) → List<SolarTerm>
获取当年节气列表
getSolarTermsDataByYear({required int year}) → List<List<int>>
按年份获取节气时间列表
getSolarTermsDataByYearFromRoughData({required int year}) → List<List<int>>
getWeekDayCN(DateTime date) → String
计算汉字星期
parseCSTToUTC(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0]) → DateTime
Convert a CST time to UTC
utcToCST({required DateTime utc}) → DateTime
Convert UTC to CST

Exceptions / Errors

InvalidLunarDateException