Versions in this module Expand all Collapse all v2 v2.0.6 Dec 14, 2023 v2.0.4 Dec 14, 2023 Changes in this version + const DateFormatYMD + const DateFormatYMDHMS + const J2000 + const LeapMonthBig + const LeapMonthSmall + var ErrWrongConstellationTypes = errors.New("[chronos] wrong constellation types") + var ErrWrongDiZhiTypes = errors.New("[chronos] wrong dizhi types") + var ErrWrongGanZhiTypes = errors.New("[chronos] wrong ganzhi types") + var ErrWrongSolarTermFormat = errors.New("[chronos] wrong solar term format") + var ErrWrongSolarTermIndex = errors.New("[chronos] wrong solar term index") + var ErrWrongTianGanTypes = errors.New("[chronos] wrong tiangan types") + var ErrWrongZodiacTypes = errors.New("[chronos] wrong zodiac types") + var ErrYearNotHaveLeapMonth = errors.New("[chronos] year not have leap month") + var PillarDay = RiZhu + var PillarHour = ShiZhu + var PillarMonty = YueZhu + var PillarYear = NianZhu + func ConstellationChinese(c Constellation) (string, error) + func ConstellationChineseV2(c Constellation) string + func DiZhiChinese(dizhi DiZhi) (string, error) + func DiZhiChineseV2(dizhi DiZhi) string + func GanZhiChinese(ganzhi GanZhi) (string, error) + func GanZhiChineseV2(ganzhi GanZhi) string + func LeapMonth(t time.Time) (int, error) + func LeapMonthBS(t time.Time) (int, error) + func NianZhuChineseV2(t time.Time) string + func SolarTermChinese(st SolarTerm) (string, error) + func SolarTermChineseV2(st SolarTerm) string + func TianGanChinese(tiangan TianGan) (string, error) + func TianGanChineseV2(tiangan TianGan) string + func TimeFromY(y int) time.Time + func TimeFromYm(y int, m time.Month) time.Time + func TimeFromYmd(y int, m time.Month, d int) time.Time + func TimeFromYmdHms(Y int, M time.Month, D int, h, m, s int) time.Time + func YearGanZhiChinese(t time.Time) (string, error) + func YearSolarTermDate(t time.Time, st SolarTerm) (month time.Month, day int) + func YearSolarTermDay(t time.Time, st SolarTerm) (day int) + func YearSolarTermMonth(t time.Time, st SolarTerm) (month time.Month) + func YueZhuChineseV2(t time.Time) string + func ZodiacChinese(zodiac Zodiac) (string, error) + func ZodiacChineseV2(zodiac Zodiac) string + type Calendar interface + Lunar func() Lunar + Solar func() Solar + func NewSolarCalendar(v ...any) Calendar + func ParseSolarDate(year, month, day, hour, minute, second int) Calendar + func ParseSolarNow() Calendar + func ParseSolarString(s string, format ...string) Calendar + func ParseSolarTime(t time.Time) Calendar + func ParseTime(t time.Time) Calendar + type CalendarDate struct + Constellation Constellation + EightCharacter EightCharacter + IsSolarTermDay bool + IsToday bool + Lunar LunarDate + Solar SolarDate + SolarTerm SolarTerm + Zodiac Zodiac + type ChineseSupport interface + Chinese func() string + type Constellation int + const ConstellationAquarius + const ConstellationAries + const ConstellationCancer + const ConstellationCapricorn + const ConstellationGemini + const ConstellationLeo + const ConstellationLibra + const ConstellationMax + const ConstellationPisces + const ConstellationSagittarius + const ConstellationScorpio + const ConstellationTaurus + const ConstellationVirgo + func GetConstellation(t time.Time) Constellation + func ParseConstellation(name string) (Constellation, error) + func (x *Constellation) UnmarshalText(text []byte) error + func (x Constellation) Chinese() string + func (x Constellation) MarshalText() ([]byte, error) + func (x Constellation) String() string + type DiZhi uint32 + const DiZhiChen + const DiZhiChou + const DiZhiHai + const DiZhiMao + const DiZhiMax + const DiZhiShen + const DiZhiSi + const DiZhiWei + const DiZhiWu + const DiZhiXu + const DiZhiYin + const DiZhiYou + const DiZhiZi + func ParseDiZhi(name string) (DiZhi, error) + func (x *DiZhi) UnmarshalText(text []byte) error + func (x DiZhi) Chinese() string + func (x DiZhi) MarshalText() ([]byte, error) + func (x DiZhi) String() string + type EightChar interface + GetCangGan func() [4][]string + GetDaYun func(sex int) []int + GetNaYin func() [4]string + GetShiShenGan func() [4]string + GetShiShenZhi func() [4][]string + GetSiZhu func() [4]string + GetWuXing func() [4]string + String func() string + type EightCharIndex int + const EightCharDay + const EightCharMonth + const EightCharTime + const EightCharYear + type EightCharacter struct + NianZhu GanZhi + Rizhu GanZhi + ShiZhu GanZhi + YueZhu GanZhi + type GanZhi uint32 + const GanZhiBingChen + const GanZhiBingShen + const GanZhiBingWu + const GanZhiBingXu + const GanZhiBingYin + const GanZhiBingZi + const GanZhiDingChou + const GanZhiDingHai + const GanZhiDingMao + const GanZhiDingSi + const GanZhiDingWei + const GanZhiDingYou + const GanZhiGengChen + const GanZhiGengShen + const GanZhiGengWu + const GanZhiGengXu + const GanZhiGengYin + const GanZhiGengZi + const GanZhiGuiChou + const GanZhiGuiHai + const GanZhiGuiMao + const GanZhiGuiSi + const GanZhiGuiWei + const GanZhiGuiYou + const GanZhiJiChou + const GanZhiJiHai + const GanZhiJiMao + const GanZhiJiSi + const GanZhiJiWei + const GanZhiJiYou + const GanZhiJiaChen + const GanZhiJiaShen + const GanZhiJiaWu + const GanZhiJiaXu + const GanZhiJiaYin + const GanZhiJiaZi + const GanZhiMax + const GanZhiRenChen + const GanZhiRenShen + const GanZhiRenWu + const GanZhiRenXu + const GanZhiRenYin + const GanZhiRenZi + const GanZhiWuChen + const GanZhiWuShen + const GanZhiWuWu + const GanZhiWuXu + const GanZhiWuYin + const GanZhiWuZi + const GanZhiXinChou + const GanZhiXinHai + const GanZhiXinMao + const GanZhiXinSi + const GanZhiXinWei + const GanZhiXinYou + const GanZhiYiChou + const GanZhiYiHai + const GanZhiYiMao + const GanZhiYiSi + const GanZhiYiWei + const GanZhiYiYou + func NianZhu(t time.Time) GanZhi + func ParseGanZhi(name string) (GanZhi, error) + func RiZhu(t time.Time) GanZhi + func ShiZhu(t time.Time) GanZhi + func YueZhu(t time.Time) GanZhi + func (x *GanZhi) UnmarshalText(text []byte) error + func (x GanZhi) Chinese() string + func (x GanZhi) MarshalText() ([]byte, error) + func (x GanZhi) String() string + type Lunar interface + GetAnimal func() string + GetChong func() string + GetChongDesc func() string + GetChongGan func() string + GetChongGanTie func() string + GetChongShengXiao func() string + GetCurrentJieQi func() *calendar.JieQi + GetDay func() int + GetDayChong func() string + GetDayChongDesc func() string + GetDayChongGan func() string + GetDayChongGanTie func() string + GetDayChongShengXiao func() string + GetDayGan func() string + GetDayGanExact func() string + GetDayGanExact2 func() string + GetDayGanIndex func() int + GetDayGanIndexExact func() int + GetDayGanIndexExact2 func() int + GetDayInChinese func() string + GetDayInGanZhi func() string + GetDayInGanZhiExact func() string + GetDayInGanZhiExact2 func() string + GetDayJi func() *list.List + GetDayJiBySect func(sect int) *list.List + GetDayJiShen func() *list.List + GetDayLu func() string + GetDayNaYin func() string + GetDayNineStar func() *calendar.NineStar + GetDayPositionCai func() string + GetDayPositionCaiDesc func() string + GetDayPositionFu func() string + GetDayPositionFuBySect func(sect int) string + GetDayPositionFuDesc func() string + GetDayPositionFuDescBySect func(sect int) string + GetDayPositionTai func() string + GetDayPositionTaiSui func() string + GetDayPositionTaiSuiBySect func(sect int) string + GetDayPositionTaiSuiDesc func() string + GetDayPositionTaiSuiDescBySect func(sect int) string + GetDayPositionXi func() string + GetDayPositionXiDesc func() string + GetDayPositionYangGui func() string + GetDayPositionYangGuiDesc func() string + GetDayPositionYinGui func() string + GetDayPositionYinGuiDesc func() string + GetDaySha func() string + GetDayTianShen func() string + GetDayTianShenLuck func() string + GetDayTianShenType func() string + GetDayXiongSha func() *list.List + GetDayXun func() string + GetDayXunExact func() string + GetDayXunExact2 func() string + GetDayXunKong func() string + GetDayXunKongExact func() string + GetDayXunKongExact2 func() string + GetDayYi func() *list.List + GetDayYiBySect func(sect int) *list.List + GetDayZhi func() string + GetDayZhiExact func() string + GetDayZhiExact2 func() string + GetDayZhiIndex func() int + GetDayZhiIndexExact func() int + GetDayZhiIndexExact2 func() int + GetEightChar func() EightChar + GetFestivals func() *list.List + GetFoto func() *calendar.Foto + GetFu func() *calendar.Fu + GetGan func() string + GetGong func() string + GetHou func() string + GetHour func() int + GetJie func() string + GetLiuYao func() string + GetMinute func() int + GetMonth func() int + GetMonthGan func() string + GetMonthGanExact func() string + GetMonthGanIndex func() int + GetMonthGanIndexExact func() int + GetMonthInChinese func() string + GetMonthInGanZhi func() string + GetMonthInGanZhiExact func() string + GetMonthNaYin func() string + GetMonthNineStar func() *calendar.NineStar + GetMonthNineStarBySect func(sect int) *calendar.NineStar + GetMonthPositionTai func() string + GetMonthPositionTaiSui func() string + GetMonthPositionTaiSuiBySect func(sect int) string + GetMonthPositionTaiSuiDesc func() string + GetMonthPositionTaiSuiDescBySect func(sect int) string + GetMonthXun func() string + GetMonthXunExact func() string + GetMonthXunKong func() string + GetMonthXunKongExact func() string + GetMonthZhi func() string + GetMonthZhiExact func() string + GetMonthZhiIndex func() int + GetMonthZhiIndexExact func() int + GetOtherFestivals func() *list.List + GetPengZuGan func() string + GetPengZuZhi func() string + GetPositionCai func() string + GetPositionCaiDesc func() string + GetPositionFu func() string + GetPositionFuDesc func() string + GetPositionXi func() string + GetPositionXiDesc func() string + GetPositionYangGui func() string + GetPositionYangGuiDesc func() string + GetPositionYinGui func() string + GetPositionYinGuiDesc func() string + GetQi func() string + GetSeason func() string + GetSecond func() int + GetSha func() string + GetShou func() string + GetShuJiu func() *calendar.ShuJiu + GetSolar func() *calendar.Solar + GetSolarTerm func() SolarTerm + GetSolarTermDetail func() SolarTermDetail + GetTao func() *calendar.Tao + GetTime func() *calendar.LunarTime + GetTimeChong func() string + GetTimeChongDesc func() string + GetTimeChongGan func() string + GetTimeChongGanTie func() string + GetTimeChongShengXiao func() string + GetTimeGan func() string + GetTimeGanIndex func() int + GetTimeInGanZhi func() string + GetTimeJi func() *list.List + GetTimeNaYin func() string + GetTimeNineStar func() *calendar.NineStar + GetTimePositionCai func() string + GetTimePositionCaiDesc func() string + GetTimePositionFu func() string + GetTimePositionFuDesc func() string + GetTimePositionXi func() string + GetTimePositionXiDesc func() string + GetTimePositionYangGui func() string + GetTimePositionYangGuiDesc func() string + GetTimePositionYinGui func() string + GetTimePositionYinGuiDesc func() string + GetTimeSha func() string + GetTimeTianShen func() string + GetTimeTianShenLuck func() string + GetTimeTianShenType func() string + GetTimeXun func() string + GetTimeXunKong func() string + GetTimeYi func() *list.List + GetTimeZhi func() string + GetTimeZhiIndex func() int + GetTimes func() []*calendar.LunarTime + GetWeek func() int + GetWeekInChinese func() string + GetWuHou func() string + GetXiu func() string + GetXiuLuck func() string + GetXiuSong func() string + GetYear func() int + GetYearGan func() string + GetYearGanByLiChun func() string + GetYearGanExact func() string + GetYearGanIndex func() int + GetYearGanIndexByLiChun func() int + GetYearGanIndexExact func() int + GetYearInChinese func() string + GetYearInGanZhi func() string + GetYearInGanZhiByLiChun func() string + GetYearInGanZhiExact func() string + GetYearNaYin func() string + GetYearNineStar func() *calendar.NineStar + GetYearNineStarBySect func(sect int) *calendar.NineStar + GetYearPositionTaiSui func() string + GetYearPositionTaiSuiBySect func(sect int) string + GetYearPositionTaiSuiDesc func() string + GetYearPositionTaiSuiDescBySect func(sect int) string + GetYearXun func() string + GetYearXunByLiChun func() string + GetYearXunExact func() string + GetYearXunKong func() string + GetYearXunKongByLiChun func() string + GetYearXunKongExact func() string + GetYearZhi func() string + GetYearZhiByLiChun func() string + GetYearZhiExact func() string + GetYearZhiIndex func() int + GetYearZhiIndexByLiChun func() int + GetYearZhiIndexExact func() int + GetYueXiang func() string + GetZheng func() string + GetZhi func() string + GetZhiXing func() string + GetZodiac func() Zodiac + Next func(days int) *calendar.Lunar + String func() string + ToFullString func() string + func ParseLunarTime(t time.Time) Lunar + type LunarDate struct + Day int + Hour int + IsLeapMonth bool + LeapMonth int + Month int + Year int + type Solar interface + GetConstellation func() Constellation + GetDay func() int + GetFestivals func() *list.List + GetHour func() int + GetJulianDay func() float64 + GetLunar func() *calendar.Lunar + GetMinute func() int + GetMonth func() int + GetOtherFestivals func() *list.List + GetSecond func() int + GetWeek func() int + GetWeekInChinese func() string + GetYear func() int + IsLeapYear func() bool + Next func(days int, onlyWorkDays bool) *calendar.Solar + String func() string + ToFullString func() string + ToYmd func() string + ToYmdHms func() string + func ParseSolarByTime(date time.Time) Solar + type SolarDate struct + Day int + Hour int + Minute int + Month time.Month + Second int + WeekDay time.Weekday + Year int + type SolarTerm uint32 + const SolarTermBaiLu + const SolarTermChuShu + const SolarTermChunFen + const SolarTermDaHan + const SolarTermDaShu + const SolarTermDaXue + const SolarTermDongZhi + const SolarTermGuYu + const SolarTermHanLu + const SolarTermJingZhe + const SolarTermLiChun + const SolarTermLiDong + const SolarTermLiQiu + const SolarTermLiXia + const SolarTermMangZhong + const SolarTermMax + const SolarTermQingMing + const SolarTermQiuFen + const SolarTermShuangJiang + const SolarTermXiaZhi + const SolarTermXiaoHan + const SolarTermXiaoMan + const SolarTermXiaoShu + const SolarTermXiaoXue + const SolarTermYuShui + func CheckSolarTermDay(t time.Time) (SolarTerm, bool) + func ParseSolarTerm(name string) (SolarTerm, error) + func (x *SolarTerm) UnmarshalText(text []byte) error + func (x SolarTerm) Chinese() string + func (x SolarTerm) Explanation() string + func (x SolarTerm) GetYearDate(year int) (month time.Month, day int) + func (x SolarTerm) MarshalText() ([]byte, error) + func (x SolarTerm) SanHou() string + func (x SolarTerm) String() string + type SolarTermDetail struct + Explanation string + Index int + SanHou string + SolarTerm SolarTerm + Time string + func YearSolarTermDetail(t time.Time, st SolarTerm) (SolarTermDetail, error) + type StemBranch = GanZhi + type TianGan uint32 + const TianGanBing + const TianGanDing + const TianGanGeng + const TianGanGui + const TianGanJi + const TianGanJia + const TianGanMax + const TianGanRen + const TianGanWu + const TianGanXin + const TianGanYi + func ParseTianGan(name string) (TianGan, error) + func (x *TianGan) UnmarshalText(text []byte) error + func (x TianGan) Chinese() string + func (x TianGan) MarshalText() ([]byte, error) + func (x TianGan) String() string + type Zodiac uint32 + const ZodiacChicken + const ZodiacCow + const ZodiacDog + const ZodiacDragon + const ZodiacHorse + const ZodiacMax + const ZodiacMonkey + const ZodiacPig + const ZodiacRabbit + const ZodiacRat + const ZodiacSheep + const ZodiacSnake + const ZodiacTiger + func ParseZodiac(name string) (Zodiac, error) + func YearZodiac(t time.Time, lichun time.Time) Zodiac + func YearZodiacDay(t time.Time, lichun time.Time) Zodiac + func YearZodiacNoFix(year int) Zodiac + func (x *Zodiac) UnmarshalText(text []byte) error + func (x Zodiac) Chinese() string + func (x Zodiac) MarshalText() ([]byte, error) + func (x Zodiac) String() string Other modules containing this package github.com/godcong/chronos