Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type CalendarDate
- type ChineseSupport
- type Constellation
- type DiZhi
- type EightChar
- type EightCharIndex
- type EightCharacter
- type GanZhi
- type Lunar
- type LunarDate
- type Solar
- type SolarDate
- type SolarTerm
- 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
- func (x *SolarTerm) UnmarshalText(text []byte) error
- type SolarTermDetail
- type StemBranch
- type TianGan
- type Zodiac
Constants ¶
const ( // DateFormatYMD ... DateFormatYMD = "2006/01/02" // DateFormatYMDHMS ... DateFormatYMDHMS = "2006/01/02 15:04:05" )
const ( // LeapMonthSmall returns lunar small month LeapMonthSmall = 1 // LeapMonthBig returns lunar big month LeapMonthBig = 2 )
const J2000 = 2451545
Variables ¶
var ( // ErrYearNotHaveLeapMonth returns an error ErrYearNotHaveLeapMonth = errors.New("[chronos] year not have leap month") // ErrWrongTianGanTypes returns an error ErrWrongTianGanTypes = errors.New("[chronos] wrong tiangan types") // ErrWrongDiZhiTypes returns an error ErrWrongDiZhiTypes = errors.New("[chronos] wrong dizhi types") // ErrWrongGanZhiTypes returns an error ErrWrongGanZhiTypes = errors.New("[chronos] wrong ganzhi types") // ErrWrongZodiacTypes returns an error ErrWrongZodiacTypes = errors.New("[chronos] wrong zodiac types") // ErrWrongConstellationTypes returns an error ErrWrongConstellationTypes = errors.New("[chronos] wrong constellation types") // ErrWrongSolarTermFormat returns an error ErrWrongSolarTermFormat = errors.New("[chronos] wrong solar term format") // ErrWrongSolarTermIndex returns an error ErrWrongSolarTermIndex = errors.New("[chronos] wrong solar term index") )
var ( // PillarHour is an alias name of ShiZhu PillarHour = ShiZhu // PillarDay is an alias name of RiZhu PillarDay = RiZhu // PillarMonty is an alias name of YueZhu PillarMonty = YueZhu // PillarYear is an alias name of NianZhu PillarYear = NianZhu )
Functions ¶
func ConstellationChinese ¶
func ConstellationChinese(c Constellation) (string, error)
ConstellationChinese returns a constellation of the chinese @param Constellation @return string @return error
func ConstellationChineseV2 ¶
func ConstellationChineseV2(c Constellation) string
ConstellationChineseV2 returns a constellation of the chinese @param Constellation @return string
func DiZhiChinese ¶
DiZhiChinese returns the chinese DiZhi string @param DiZhi @return string @return error
func DiZhiChineseV2 ¶
DiZhiChineseV2 returns the chinese DiZhi string @param DiZhi @return string
func GanZhiChinese ¶
GanZhiChinese returns the chinese GanZhi string @param GanZhi @return string @return error
func GanZhiChineseV2 ¶
GanZhiChineseV2 returns the chinese GanZhi string @param GanZhi @return string
func LeapMonth ¶
LeapMonth returns the leap month if leap month is exists in the year @param time.Time @return int @return error
func LeapMonthBS ¶
LeapMonthBS returns the leap month of big month or small month @param time.Time @return int @return error
func NianZhuChineseV2 ¶
NianZhuChineseV2 returns the chinese NianZhu string @param time.Time @return string
func SolarTermChinese ¶
func SolarTermChineseV2 ¶
func TianGanChinese ¶
TianGanChinese returns the chinese TianGan string @param TianGan @return string @return error
func TianGanChineseV2 ¶
TianGanChineseV2 returns the chinese TianGan string @param TianGan @return string
func YearGanZhiChinese ¶
YearGanZhiChinese returns the year of the chinese GanZhi string @param int @return string @return error
func YearSolarTermDate ¶
YearSolarTermDate returns the year month day of the solar term @param time.Time @param SolarTerm @return month @return day
func YearSolarTermDay ¶
YearSolarTermDay returns the year day of the solar term @param time.Time @param SolarTerm @return day
func YearSolarTermMonth ¶
YearSolarTermMonth returns the year month of the solar term @param time.Time @param SolarTerm @return month
func YueZhuChineseV2 ¶
YueZhuChineseV2 returns the chinese YueZhuChineseV2 string @param time.Time @return string
func ZodiacChinese ¶
ZodiacChinese returns the chinese Zodiac string @param Zodiac @return string @return error
func ZodiacChineseV2 ¶
ZodiacChineseV2 returns the chinese Zodiac string @param Zodiac @return string
Types ¶
type Calendar ¶
Calendar returns a calendarTime
func NewSolarCalendar ¶
NewSolarCalendar can input three type of time to create the calendarTime "2006/01/02 03:04" format string time.Time value or nil to create a new time.Now() value
func ParseSolarDate ¶
ParseSolarDate returns Calendar parse from date(year, month, day, hour, minute, second) @param int @param int @param int @param int @param int @param int @return Calendar
func ParseSolarNow ¶
func ParseSolarNow() Calendar
ParseSolarNow returns Calendar parse from solar time now(time.Now()) @return Calendar
func ParseSolarString ¶
ParseSolarString returns Calendar parse from string(value,format?) @param string @param ...string @return Calendar
func ParseSolarTime ¶
ParseSolarTime returns Calendar parse from solar time @param time.Time @return Calendar
type CalendarDate ¶
type CalendarDate struct { IsToday bool `json:"is_today"` Solar SolarDate `json:"solar"` Lunar LunarDate `json:"lunar"` EightCharacter EightCharacter `json:"eight_character"` Zodiac Zodiac `json:"zodiac"` Constellation Constellation `json:"constellation"` IsSolarTermDay bool `json:"is_solar_day"` SolarTerm SolarTerm `json:"solar_term"` }
type ChineseSupport ¶
type ChineseSupport interface {
Chinese() string
}
ChineseSupport implements the interface, if support chinese language output
type Constellation ¶
type Constellation int
Constellation ENUM(Capricorn,Aquarius,Pisces,Aries,Taurus,Gemini,Cancer,Leo,Virgo,Libra,Scorpio,Sagittarius,Max)
const ( // ConstellationCapricorn is a Constellation of type Capricorn. ConstellationCapricorn Constellation = iota // ConstellationAquarius is a Constellation of type Aquarius. ConstellationAquarius // ConstellationPisces is a Constellation of type Pisces. ConstellationPisces // ConstellationAries is a Constellation of type Aries. ConstellationAries // ConstellationTaurus is a Constellation of type Taurus. ConstellationTaurus // ConstellationGemini is a Constellation of type Gemini. ConstellationGemini // ConstellationCancer is a Constellation of type Cancer. ConstellationCancer // ConstellationLeo is a Constellation of type Leo. ConstellationLeo // ConstellationVirgo is a Constellation of type Virgo. ConstellationVirgo // ConstellationLibra is a Constellation of type Libra. ConstellationLibra // ConstellationScorpio is a Constellation of type Scorpio. ConstellationScorpio // ConstellationSagittarius is a Constellation of type Sagittarius. ConstellationSagittarius // ConstellationMax is a Constellation of type Max. ConstellationMax )
func GetConstellation ¶
func GetConstellation(t time.Time) Constellation
GetConstellation get the constellation of date @param time.Time @return Constellation
func ParseConstellation ¶
func ParseConstellation(name string) (Constellation, error)
ParseConstellation attempts to convert a string to a Constellation.
func (Constellation) Chinese ¶
func (x Constellation) Chinese() string
func (Constellation) MarshalText ¶
func (x Constellation) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (Constellation) String ¶
func (x Constellation) String() string
String implements the Stringer interface.
func (*Constellation) UnmarshalText ¶
func (x *Constellation) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type DiZhi ¶
type DiZhi uint32
DiZhi ENUM(Zi , Chou , Yin , Mao , Chen , Si , Wu , Wei , Shen , You , Xu , Hai , Max)
const ( // DiZhiZi is a DiZhi of type Zi. DiZhiZi DiZhi = iota // DiZhiChou is a DiZhi of type Chou. DiZhiChou // DiZhiYin is a DiZhi of type Yin. DiZhiYin // DiZhiMao is a DiZhi of type Mao. DiZhiMao // DiZhiChen is a DiZhi of type Chen. DiZhiChen // DiZhiSi is a DiZhi of type Si. DiZhiSi // DiZhiWu is a DiZhi of type Wu. DiZhiWu // DiZhiWei is a DiZhi of type Wei. DiZhiWei // DiZhiShen is a DiZhi of type Shen. DiZhiShen // DiZhiYou is a DiZhi of type You. DiZhiYou // DiZhiXu is a DiZhi of type Xu. DiZhiXu // DiZhiHai is a DiZhi of type Hai. DiZhiHai // DiZhiMax is a DiZhi of type Max. DiZhiMax )
func ParseDiZhi ¶
ParseDiZhi attempts to convert a string to a DiZhi.
func (DiZhi) MarshalText ¶
MarshalText implements the text marshaller method.
func (*DiZhi) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type EightChar ¶
type EightChar interface { String() string //GetSect() int //SetSect(sect int) //GetDayGanIndex() int //GetDayZhiIndex() int //GetYear() string //GetYearGan() string //GetYearZhi() string //GetYearHideGan() []string //GetYearWuXing() string //GetYearNaYin() string //GetYearShiShenGan() string //GetYearShiShenZhi() *list.List //GetYearDiShi() string //GetMonth() string //GetMonthGan() string //GetMonthZhi() string //GetMonthHideGan() []string //GetMonthWuXing() string //GetMonthNaYin() string //GetMonthShiShenGan() string //GetMonthShiShenZhi() *list.List //GetMonthDiShi() string //GetDay() string //GetDayGan() string //GetDayZhi() string //GetDayHideGan() []string //GetDayWuXing() string //GetDayNaYin() string //GetDayShiShenGan() string //GetDayShiShenZhi() *list.List //GetDayDiShi() string //GetTime() string //GetTimeGan() string //GetTimeZhi() string //GetTimeHideGan() []string //GetTimeWuXing() string //GetTimeNaYin() string //GetTimeShiShenGan() string //GetTimeShiShenZhi() *list.List //GetTimeDiShi() string //GetTaiYuan() string //GetTaiYuanNaYin() string //GetTaiXi() string //GetTaiXiNaYin() string //GetMingGong() string //GetMingGongNaYin() string //GetShenGong() string //GetShenGongNaYin() string //GetLunar() *calendar.Lunar //GetYun(gender int) *calendar.Yun //GetYunBySect(gender int, sect int) *calendar.Yun //GetYearXun() string //GetYearXunKong() string //GetMonthXun() string //GetMonthXunKong() string //GetDayXun() string //GetDayXunKong() string //GetTimeXun() string //GetTimeXunKong() string GetWuXing() [4]string GetNaYin() [4]string GetSiZhu() [4]string GetShiShenGan() [4]string GetShiShenZhi() [4][]string GetCangGan() [4][]string GetDaYun(sex int) []int }
EightChar returns the lunar eight char
type EightCharIndex ¶
type EightCharIndex int
const ( EightCharYear EightCharIndex = iota EightCharMonth EightCharDay EightCharTime )
type EightCharacter ¶
type GanZhi ¶
type GanZhi uint32
GanZhi returns the GanZhi enum ENUM(JiaZi,YiChou,BingYin,DingMao,WuChen,JiSi,GengWu,XinWei,RenShen,GuiYou,JiaXu,YiHai, BingZi,DingChou,WuYin,JiMao,GengChen,XinSi,RenWu,GuiWei,JiaShen,YiYou,BingXu,DingHai, WuZi,JiChou,GengYin,XinMao,RenChen,GuiSi,JiaWu,YiWei,BingShen,DingYou,WuXu,JiHai, GengZi,XinChou,RenYin,GuiMao,JiaChen,YiSi,BingWu,DingWei,WuShen,JiYou,GengXu,XinHai, RenZi,GuiChou,JiaYin,YiMao,BingChen,DingSi,WuWu,JiWei,GengShen,XinYou,RenXu,GuiHai,Max)
const ( // GanZhiJiaZi is a GanZhi of type JiaZi. GanZhiJiaZi GanZhi = iota // GanZhiYiChou is a GanZhi of type YiChou. GanZhiYiChou // GanZhiBingYin is a GanZhi of type BingYin. GanZhiBingYin // GanZhiDingMao is a GanZhi of type DingMao. GanZhiDingMao // GanZhiWuChen is a GanZhi of type WuChen. GanZhiWuChen // GanZhiJiSi is a GanZhi of type JiSi. GanZhiJiSi // GanZhiGengWu is a GanZhi of type GengWu. GanZhiGengWu // GanZhiXinWei is a GanZhi of type XinWei. GanZhiXinWei // GanZhiRenShen is a GanZhi of type RenShen. GanZhiRenShen // GanZhiGuiYou is a GanZhi of type GuiYou. GanZhiGuiYou // GanZhiJiaXu is a GanZhi of type JiaXu. GanZhiJiaXu // GanZhiYiHai is a GanZhi of type YiHai. GanZhiYiHai // GanZhiBingZi is a GanZhi of type BingZi. GanZhiBingZi // GanZhiDingChou is a GanZhi of type DingChou. GanZhiDingChou // GanZhiWuYin is a GanZhi of type WuYin. GanZhiWuYin // GanZhiJiMao is a GanZhi of type JiMao. GanZhiJiMao // GanZhiGengChen is a GanZhi of type GengChen. GanZhiGengChen // GanZhiXinSi is a GanZhi of type XinSi. GanZhiXinSi // GanZhiRenWu is a GanZhi of type RenWu. GanZhiRenWu // GanZhiGuiWei is a GanZhi of type GuiWei. GanZhiGuiWei // GanZhiJiaShen is a GanZhi of type JiaShen. GanZhiJiaShen // GanZhiYiYou is a GanZhi of type YiYou. GanZhiYiYou // GanZhiBingXu is a GanZhi of type BingXu. GanZhiBingXu // GanZhiDingHai is a GanZhi of type DingHai. GanZhiDingHai // GanZhiWuZi is a GanZhi of type WuZi. GanZhiWuZi // GanZhiJiChou is a GanZhi of type JiChou. GanZhiJiChou // GanZhiGengYin is a GanZhi of type GengYin. GanZhiGengYin // GanZhiXinMao is a GanZhi of type XinMao. GanZhiXinMao // GanZhiRenChen is a GanZhi of type RenChen. GanZhiRenChen // GanZhiGuiSi is a GanZhi of type GuiSi. GanZhiGuiSi // GanZhiJiaWu is a GanZhi of type JiaWu. GanZhiJiaWu // GanZhiYiWei is a GanZhi of type YiWei. GanZhiYiWei // GanZhiBingShen is a GanZhi of type BingShen. GanZhiBingShen // GanZhiDingYou is a GanZhi of type DingYou. GanZhiDingYou // GanZhiWuXu is a GanZhi of type WuXu. GanZhiWuXu // GanZhiJiHai is a GanZhi of type JiHai. GanZhiJiHai // GanZhiGengZi is a GanZhi of type GengZi. GanZhiGengZi // GanZhiXinChou is a GanZhi of type XinChou. GanZhiXinChou // GanZhiRenYin is a GanZhi of type RenYin. GanZhiRenYin // GanZhiGuiMao is a GanZhi of type GuiMao. GanZhiGuiMao // GanZhiJiaChen is a GanZhi of type JiaChen. GanZhiJiaChen // GanZhiYiSi is a GanZhi of type YiSi. GanZhiYiSi // GanZhiBingWu is a GanZhi of type BingWu. GanZhiBingWu // GanZhiDingWei is a GanZhi of type DingWei. GanZhiDingWei // GanZhiWuShen is a GanZhi of type WuShen. GanZhiWuShen // GanZhiJiYou is a GanZhi of type JiYou. GanZhiJiYou // GanZhiGengXu is a GanZhi of type GengXu. GanZhiGengXu // GanZhiXinHai is a GanZhi of type XinHai. GanZhiXinHai // GanZhiRenZi is a GanZhi of type RenZi. GanZhiRenZi // GanZhiGuiChou is a GanZhi of type GuiChou. GanZhiGuiChou // GanZhiJiaYin is a GanZhi of type JiaYin. GanZhiJiaYin // GanZhiYiMao is a GanZhi of type YiMao. GanZhiYiMao // GanZhiBingChen is a GanZhi of type BingChen. GanZhiBingChen // GanZhiDingSi is a GanZhi of type DingSi. GanZhiDingSi // GanZhiWuWu is a GanZhi of type WuWu. GanZhiWuWu // GanZhiJiWei is a GanZhi of type JiWei. GanZhiJiWei // GanZhiGengShen is a GanZhi of type GengShen. GanZhiGengShen // GanZhiXinYou is a GanZhi of type XinYou. GanZhiXinYou // GanZhiRenXu is a GanZhi of type RenXu. GanZhiRenXu // GanZhiGuiHai is a GanZhi of type GuiHai. GanZhiGuiHai // GanZhiMax is a GanZhi of type Max. GanZhiMax )
func ParseGanZhi ¶
ParseGanZhi attempts to convert a string to a GanZhi.
func ShiZhu ¶
ShiZhu returns a GanZhi of hour @param time.Time @return GanZhi @descriptions 子 丑 寅 卯 辰 己 23-01:01-03:03-05 :05-07:07-09:09-11 午 未 申 酉 戊 亥 11-13:13-15:15-17:17-19:19-21:21-23 `甲子`, `乙丑`, `丙寅`, `丁卯`, `戊辰`, `己巳`, `庚午`, `辛未`, `壬申`, `癸酉`, `甲戌`, `乙亥`, //甲或己日 `丙子`, `丁丑`, `戊寅`, `己卯`, `庚辰`, `辛巳`, `壬午`, `癸未`, `甲申`, `乙酉`, `丙戌`, `丁亥`, //乙或庚日 `戊子`, `己丑`, `庚寅`, `辛卯`, `壬辰`, `癸巳`, `甲午`, `乙未`, `丙申`, `丁酉`, `戊戌`, `己亥`, //丙或辛日 `庚子`, `辛丑`, `壬寅`, `癸卯`, `甲辰`, `乙巳`, `丙午`, `丁未`, `戊申`, `己酉`, `庚戌`, `辛亥`, //丁或壬日 `壬子`, `癸丑`, `甲寅`, `乙卯`, `丙辰`, `丁巳`, `戊午`, `己未`, `庚申`, `辛酉`, `壬戌`, `癸亥`, //戊或癸日
func (GanZhi) MarshalText ¶
MarshalText implements the text marshaller method.
func (*GanZhi) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Lunar ¶
type Lunar interface { GetGan() string GetYearGan() string GetYearGanByLiChun() string GetYearGanExact() string GetZhi() string GetYearZhi() string GetYearZhiByLiChun() string GetYearZhiExact() string GetYearInGanZhi() string GetYearInGanZhiByLiChun() string GetYearInGanZhiExact() string GetMonthGan() string GetMonthGanExact() string GetMonthZhi() string GetMonthZhiExact() string GetMonthInGanZhi() string GetMonthInGanZhiExact() string GetDayGan() string GetDayGanExact() string GetDayGanExact2() string GetDayZhi() string GetDayZhiExact() string GetDayZhiExact2() string GetDayInGanZhi() string GetDayInGanZhiExact() string GetDayInGanZhiExact2() string GetTimeGan() string GetTimeZhi() string GetTimeInGanZhi() string GetZodiac() Zodiac GetYearInChinese() string GetMonthInChinese() string GetDayInChinese() string GetSeason() string GetJie() string GetQi() string GetWeek() int GetWeekInChinese() string GetXiu() string GetXiuLuck() string GetXiuSong() string GetZheng() string GetAnimal() string GetGong() string GetShou() string GetFestivals() *list.List GetOtherFestivals() *list.List GetPengZuGan() string GetPengZuZhi() string GetPositionXi() string GetPositionXiDesc() string GetPositionYangGui() string GetPositionYangGuiDesc() string GetPositionYinGui() string GetPositionYinGuiDesc() string GetPositionFu() string GetPositionFuDesc() string GetPositionCai() string GetPositionCaiDesc() string GetDayPositionXi() string GetDayPositionXiDesc() string GetDayPositionYangGui() string GetDayPositionYangGuiDesc() string GetDayPositionYinGui() string GetDayPositionYinGuiDesc() string GetDayPositionFu() string GetDayPositionFuBySect(sect int) string GetDayPositionFuDesc() string GetDayPositionFuDescBySect(sect int) string GetDayPositionCai() string GetDayPositionCaiDesc() string GetYearPositionTaiSui() string GetYearPositionTaiSuiBySect(sect int) string GetYearPositionTaiSuiDesc() string GetYearPositionTaiSuiDescBySect(sect int) string GetMonthPositionTaiSuiBySect(sect int) string GetMonthPositionTaiSui() string GetMonthPositionTaiSuiDesc() string GetMonthPositionTaiSuiDescBySect(sect int) string GetDayPositionTaiSuiBySect(sect int) string GetDayPositionTaiSui() string GetDayPositionTaiSuiDesc() string GetDayPositionTaiSuiDescBySect(sect int) string GetTimePositionXi() string GetTimePositionXiDesc() string GetTimePositionYangGui() string GetTimePositionYangGuiDesc() string GetTimePositionYinGui() string GetTimePositionYinGuiDesc() string GetTimePositionFu() string GetTimePositionFuDesc() string GetTimePositionCai() string GetTimePositionCaiDesc() string GetChong() string GetDayChong() string GetChongGan() string GetDayChongGan() string GetChongGanTie() string GetDayChongGanTie() string GetChongShengXiao() string GetDayChongShengXiao() string GetChongDesc() string GetDayChongDesc() string GetSha() string GetDaySha() string GetYearNaYin() string GetMonthNaYin() string GetDayNaYin() string GetTimeNaYin() string GetEightChar() EightChar GetZhiXing() string GetDayTianShen() string GetTimeTianShen() string GetDayTianShenType() string GetTimeTianShenType() string GetDayTianShenLuck() string GetTimeTianShenLuck() string GetDayPositionTai() string GetMonthPositionTai() string GetTimeChong() string GetTimeSha() string GetTimeChongGan() string GetTimeChongGanTie() string GetTimeChongShengXiao() string GetTimeChongDesc() string GetSolarTerm() SolarTerm GetSolarTermDetail() SolarTermDetail //GetJieQiTable() map[string]*calendar.Solar //GetJieQiList() *list.List GetDayYi() *list.List GetDayYiBySect(sect int) *list.List GetDayJi() *list.List GetDayJiBySect(sect int) *list.List GetDayJiShen() *list.List GetDayXiongSha() *list.List GetTimeYi() *list.List GetTimeJi() *list.List GetYueXiang() string GetYearNineStarBySect(sect int) *calendar.NineStar GetYearNineStar() *calendar.NineStar GetMonthNineStarBySect(sect int) *calendar.NineStar GetMonthNineStar() *calendar.NineStar GetDayNineStar() *calendar.NineStar GetTimeNineStar() *calendar.NineStar GetCurrentJieQi() *calendar.JieQi String() string ToFullString() string GetYear() int GetMonth() int GetDay() int GetHour() int GetMinute() int GetSecond() int GetTimeGanIndex() int GetTimeZhiIndex() int GetDayGanIndex() int GetDayGanIndexExact() int GetDayGanIndexExact2() int GetDayZhiIndex() int GetDayZhiIndexExact() int GetDayZhiIndexExact2() int GetMonthGanIndex() int GetMonthGanIndexExact() int GetMonthZhiIndex() int GetMonthZhiIndexExact() int GetYearGanIndex() int GetYearGanIndexByLiChun() int GetYearGanIndexExact() int GetYearZhiIndex() int GetYearZhiIndexByLiChun() int GetYearZhiIndexExact() int GetSolar() *calendar.Solar Next(days int) *calendar.Lunar GetYearXun() string GetYearXunByLiChun() string GetYearXunExact() string GetYearXunKong() string GetYearXunKongByLiChun() string GetYearXunKongExact() string GetMonthXun() string GetMonthXunExact() string GetMonthXunKong() string GetMonthXunKongExact() string GetDayXun() string GetDayXunExact() string GetDayXunExact2() string GetDayXunKong() string GetDayXunKongExact() string GetDayXunKongExact2() string GetTimeXun() string GetTimeXunKong() string GetShuJiu() *calendar.ShuJiu GetFu() *calendar.Fu GetLiuYao() string GetHou() string GetWuHou() string GetDayLu() string GetTime() *calendar.LunarTime GetTimes() []*calendar.LunarTime GetFoto() *calendar.Foto GetTao() *calendar.Tao }
Lunar returns the lunar time
func ParseLunarTime ¶
type Solar ¶
type Solar interface { IsLeapYear() bool GetWeek() int GetWeekInChinese() string GetConstellation() Constellation GetFestivals() *list.List GetOtherFestivals() *list.List GetYear() int GetMonth() int GetDay() int GetHour() int GetMinute() int GetSecond() int //GetCalendar() time.Time GetJulianDay() float64 ToYmd() string ToYmdHms() string String() string ToFullString() string Next(days int, onlyWorkDays bool) *calendar.Solar GetLunar() *calendar.Lunar }
Solar returns the solar time
func ParseSolarByTime ¶
type SolarTerm ¶
type SolarTerm uint32
SolarTerm ENUM(XiaoHan,DaHan,LiChun,YuShui,JingZhe,ChunFen,QingMing,GuYu,LiXia,XiaoMan,MangZhong,XiaZhi,XiaoShu,DaShu,LiQiu,ChuShu,BaiLu,QiuFen,HanLu,ShuangJiang,LiDong,XiaoXue,DaXue,DongZhi,Max)
const ( // SolarTermXiaoHan is a SolarTerm of type XiaoHan. SolarTermXiaoHan SolarTerm = iota // SolarTermDaHan is a SolarTerm of type DaHan. SolarTermDaHan // SolarTermLiChun is a SolarTerm of type LiChun. SolarTermLiChun // SolarTermYuShui is a SolarTerm of type YuShui. SolarTermYuShui // SolarTermJingZhe is a SolarTerm of type JingZhe. SolarTermJingZhe // SolarTermChunFen is a SolarTerm of type ChunFen. SolarTermChunFen // SolarTermQingMing is a SolarTerm of type QingMing. SolarTermQingMing // SolarTermGuYu is a SolarTerm of type GuYu. SolarTermGuYu // SolarTermLiXia is a SolarTerm of type LiXia. SolarTermLiXia // SolarTermXiaoMan is a SolarTerm of type XiaoMan. SolarTermXiaoMan // SolarTermMangZhong is a SolarTerm of type MangZhong. SolarTermMangZhong // SolarTermXiaZhi is a SolarTerm of type XiaZhi. SolarTermXiaZhi // SolarTermXiaoShu is a SolarTerm of type XiaoShu. SolarTermXiaoShu // SolarTermDaShu is a SolarTerm of type DaShu. SolarTermDaShu // SolarTermLiQiu is a SolarTerm of type LiQiu. SolarTermLiQiu // SolarTermChuShu is a SolarTerm of type ChuShu. SolarTermChuShu // SolarTermBaiLu is a SolarTerm of type BaiLu. SolarTermBaiLu // SolarTermQiuFen is a SolarTerm of type QiuFen. SolarTermQiuFen // SolarTermHanLu is a SolarTerm of type HanLu. SolarTermHanLu // SolarTermShuangJiang is a SolarTerm of type ShuangJiang. SolarTermShuangJiang // SolarTermLiDong is a SolarTerm of type LiDong. SolarTermLiDong // SolarTermXiaoXue is a SolarTerm of type XiaoXue. SolarTermXiaoXue // SolarTermDaXue is a SolarTerm of type DaXue. SolarTermDaXue // SolarTermDongZhi is a SolarTerm of type DongZhi. SolarTermDongZhi // SolarTermMax is a SolarTerm of type Max. SolarTermMax )
func ParseSolarTerm ¶
ParseSolarTerm attempts to convert a string to a SolarTerm.
func (SolarTerm) Explanation ¶
func (SolarTerm) MarshalText ¶
MarshalText implements the text marshaller method.
func (*SolarTerm) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type SolarTermDetail ¶
type SolarTermDetail struct { Index int `json:"index"` SolarTerm SolarTerm `json:"solar_term"` Time string `json:"time"` SanHou string `json:"san_hou"` Explanation string `json:"explanation"` }
SolarTermDetail 24节气表
func YearSolarTermDetail ¶
func YearSolarTermDetail(t time.Time, st SolarTerm) (SolarTermDetail, error)
YearSolarTermDetail get the details of year solar term @param time.Time @param SolarTerm @return SolarTermDetail @return error
type TianGan ¶
type TianGan uint32
TianGan ENUM(Jia , Yi , Bing , Ding , Wu , Ji , Geng , Xin , Ren , Gui , Max)
const ( // TianGanJia is a TianGan of type Jia. TianGanJia TianGan = iota // TianGanYi is a TianGan of type Yi. TianGanYi // TianGanBing is a TianGan of type Bing. TianGanBing // TianGanDing is a TianGan of type Ding. TianGanDing // TianGanWu is a TianGan of type Wu. TianGanWu // TianGanJi is a TianGan of type Ji. TianGanJi // TianGanGeng is a TianGan of type Geng. TianGanGeng // TianGanXin is a TianGan of type Xin. TianGanXin // TianGanRen is a TianGan of type Ren. TianGanRen // TianGanGui is a TianGan of type Gui. TianGanGui // TianGanMax is a TianGan of type Max. TianGanMax )
func ParseTianGan ¶
ParseTianGan attempts to convert a string to a TianGan.
func (TianGan) MarshalText ¶
MarshalText implements the text marshaller method.
func (*TianGan) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Zodiac ¶
type Zodiac uint32
Zodiac ENUM(Rat, Cow, Tiger, Rabbit, Dragon, Snake, Horse, Sheep, Monkey, Chicken, Dog, Pig, Max)
const ( // ZodiacRat is a Zodiac of type Rat. ZodiacRat Zodiac = iota // ZodiacCow is a Zodiac of type Cow. ZodiacCow // ZodiacTiger is a Zodiac of type Tiger. ZodiacTiger // ZodiacRabbit is a Zodiac of type Rabbit. ZodiacRabbit // ZodiacDragon is a Zodiac of type Dragon. ZodiacDragon // ZodiacSnake is a Zodiac of type Snake. ZodiacSnake // ZodiacHorse is a Zodiac of type Horse. ZodiacHorse // ZodiacSheep is a Zodiac of type Sheep. ZodiacSheep // ZodiacMonkey is a Zodiac of type Monkey. ZodiacMonkey // ZodiacChicken is a Zodiac of type Chicken. ZodiacChicken // ZodiacDog is a Zodiac of type Dog. ZodiacDog // ZodiacPig is a Zodiac of type Pig. ZodiacPig // ZodiacMax is a Zodiac of type Max. ZodiacMax )
func ParseZodiac ¶
ParseZodiac attempts to convert a string to a Zodiac.
func YearZodiac ¶
YearZodiac returns the zodiac of year.(ps: this will auto fix zodiac with LiChun check stopped at seconds) @param time.Time @return Zodiac @return error
func YearZodiacDay ¶
YearZodiacDay returns the zodiac of year.(ps: this will auto fix zodiac with LiChun check stopped at day) @param time.Time @return Zodiac @return error
func YearZodiacNoFix ¶
YearZodiacNoFix returns the zodiac of year.(ps: this is not support LiChun day fix) @param int @return Zodiac
func (Zodiac) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Zodiac) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.