Documentation
¶
Index ¶
- func GetChnChar(nNumber int) string
- func GetChnCharFromYear(nYear int) string
- func GetDiZhiFromNumber(nValue int) string
- func GetGanZhiFromNumber(nValue int) string
- func GetJieQiDate(pSolarDate *TSolarDate) (*TJieQiDate, *TJieQiDate)
- func GetJieQiFromNumber(nValue int) string
- func GetLiChunYear(pSolarDate *TSolarDate) int
- func GetNaYinFromNumber(nValue int) string
- func GetShiShenFromNumber(nValue int) string
- func GetShiShenLongFromNumber(nValue int) string
- func GetTianGanFromNumber(nValue int) string
- func GetWuXingColorFromNumber(nValue int) string
- func GetWuXingFromNumber(nValue int) string
- func GetYinYangFromNumber(nValue int) string
- type TBazi
- type TBaziDate
- type TCangGan
- type TDaYun
- type TGan
- type TGanZhi
- type THeHuaChong
- type TJieQi
- type TJieQiDate
- type TLunarDate
- func (m *TLunarDate) Day() string
- func (m *TLunarDate) Get64TimeStamp() int64
- func (m *TLunarDate) GetAllDays() int
- func (m *TLunarDate) GetDateIsValid() bool
- func (m *TLunarDate) GetDayTimeFrom64TimeStamp(nTimeStamp int64)
- func (m *TLunarDate) GetLeapMonth() int
- func (m *TLunarDate) GetMonthDays() int
- func (m *TLunarDate) GetMonthFrom64TimeStamp(nTimeStamp int64)
- func (m *TLunarDate) GetYearFrom64TimeStamp(nTimeStamp int64) *TLunarDate
- func (m *TLunarDate) Hour() string
- func (m *TLunarDate) Month() string
- func (m *TLunarDate) String() string
- func (m *TLunarDate) ToSolarDate() *TSolarDate
- func (m *TLunarDate) Year() string
- type TNaYin
- type TShiShen
- type TSiZhu
- type TSolarDate
- func (m *TSolarDate) Day() int
- func (m *TSolarDate) Get64TimeStamp() int64
- func (m *TSolarDate) GetAllDays() int
- func (m *TSolarDate) GetBasicDays(nYear, nMonth, nDay int) int
- func (m *TSolarDate) GetCalendarType(nYear, nMonth, nDay int) int
- func (m *TSolarDate) GetDateIsValid(nYear, nMonth, nDay int) bool
- func (m *TSolarDate) GetDayTimeFrom64TimeStamp(nTimeStamp int64)
- func (m *TSolarDate) GetDiffSeconds(other *TSolarDate) int64
- func (m *TSolarDate) GetIsLeapYear(nYear int) bool
- func (m *TSolarDate) GetLeapDays(nYear, nMonth, nDay int) int
- func (m *TSolarDate) GetMonthDays(nYear, nMonth int) int
- func (m *TSolarDate) GetMonthFrom64TimeStamp(nTimeStamp int64)
- func (m *TSolarDate) GetYearFrom64TimeStamp(nTimeStamp int64) *TSolarDate
- func (m *TSolarDate) Hour() int
- func (m *TSolarDate) Minute() int
- func (m *TSolarDate) Month() int
- func (m *TSolarDate) Second() int
- func (m *TSolarDate) String() string
- func (m *TSolarDate) ToBaziDate() *TBaziDate
- func (m *TSolarDate) ToLunarDate() *TLunarDate
- func (m *TSolarDate) Year() int
- type TTianGanWuHe
- type TWuXing
- type TXiYong
- type TYinYang
- type TZhi
- type TZhu
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChnChar ¶ added in v1.0.2
func GetChnCharFromYear ¶ added in v1.0.2
GetChnCharFromYear 年份转成汉字形式
func GetDiZhiFromNumber ¶ added in v1.0.1
GetDiZhiFromNumber 从数字获得地支名, 0-9
func GetGanZhiFromNumber ¶ added in v1.0.1
GetGanZhiFromNumber 从数字获得天干地支名, 0-59
func GetJieQiDate ¶ added in v1.0.1
func GetJieQiDate(pSolarDate *TSolarDate) (*TJieQiDate, *TJieQiDate)
GetJieQiDate 获取某个日期的节气, 和前后两个节气的日期
func GetJieQiFromNumber ¶ added in v1.0.1
GetJieQiFromNumber 从数字获得节气名, 0-23
func GetLiChunYear ¶ added in v1.0.1
func GetLiChunYear(pSolarDate *TSolarDate) int
GetLiChunYear 获取某个日期的立春年
func GetNaYinFromNumber ¶ added in v1.0.1
GetNaYinFromNumber 从数字获得纳音名, 0-29
func GetShiShenFromNumber ¶ added in v1.0.1
GetShiShenFromNumber 从数字获得十神名, 0-9
func GetShiShenLongFromNumber ¶ added in v1.0.2
GetShiShenLongFromNumber 从数字获取十神长名, 0-9
func GetTianGanFromNumber ¶ added in v1.0.1
GetTianGanFromNumber 从数字获得天干名, 0-9
func GetWuXingColorFromNumber ¶ added in v1.0.2
GetWuXingColorFromNumber 获取五行的颜色
func GetWuXingFromNumber ¶ added in v1.0.1
GetWuXingFromNumber 从数字获得五行名, 0-4
func GetYinYangFromNumber ¶ added in v1.0.1
GetYinYangFromNumber (阴 == 0, 阳 == 1)
Types ¶
type TBazi ¶
type TBazi struct {
// contains filtered or unexported fields
}
TBazi 八字大类
func NewBaziFromLunarDate ¶ added in v1.0.1
func NewBaziFromLunarDate(pLunarDate *TLunarDate, nSex int) *TBazi
NewBaziFromLunarDate 新建八字 从农历
type TBaziDate ¶ added in v1.0.1
type TBaziDate struct {
// contains filtered or unexported fields
}
TBaziDate 八字历法 八字历法的年 和 新历的 和 农历的都不一样. 八字历法是按照立春为1年. 然后每个节气为月
func NewBaziDate ¶ added in v1.0.1
func NewBaziDate(pSolarDate *TSolarDate) *TBaziDate
NewBaziDate 从新历转成八字历
func (*TBaziDate) PreviousJie ¶ added in v1.0.1
func (m *TBaziDate) PreviousJie() *TJieQiDate
PreviousJie 上一个节气
type TCangGan ¶ added in v1.0.1
type TCangGan struct {
// contains filtered or unexported fields
}
TCangGan 藏干
func NewCangGan ¶ added in v1.0.1
NewCangGan 新建藏干
type TDaYun ¶ added in v1.0.1
type TDaYun struct {
// contains filtered or unexported fields
}
TDaYun 大运
type TGanZhi ¶ added in v1.0.1
type TGanZhi int
TGanZhi 干支
func CombineGanZhi ¶ added in v1.0.1
CombineGanZhi 将天干地支组合成干支,0-9 0-11 转换成 0-59
func NewGanZhiFromDay ¶ added in v1.0.1
NewGanZhiFromDay 获得八字天的干支, 0-59 对应 甲子到癸亥
func NewGanZhiFromYear ¶ added in v1.0.1
NewGanZhiFromYear 获得八字年的干支,0-59 对应 甲子到癸亥
func (*TGanZhi) ExtractGanZhi ¶ added in v1.0.1
ExtractGanZhi 将干支拆分成天干地支,0-59 转换成 0-9 0-11
type TJieQiDate ¶ added in v1.0.1
type TJieQiDate struct {
Year int // 年
Month int // 月
Day int // 日
Hour int // 时
Minute int // 分
Second int // 秒
JieQi TJieQi // 节气
}
TJieQiDate 节气
func (*TJieQiDate) ToSolarDate ¶ added in v1.0.1
func (m *TJieQiDate) ToSolarDate() *TSolarDate
ToSolarDate 节气日期 转成 普通日期用
type TLunarDate ¶ added in v1.0.1
type TLunarDate struct {
// contains filtered or unexported fields
}
TLunarDate 农历日期
func NewLunarDate ¶ added in v1.0.1
NewLunarDate 新建一个农历日期, 顺序月
func NewLunarDateFrom64TimeStamp ¶ added in v1.0.1
func NewLunarDateFrom64TimeStamp(nTimeStamp int64) *TLunarDate
NewLunarDateFrom64TimeStamp 从64位时间戳反推日期
func NewLunarDateFromLeap ¶ added in v1.0.1
func NewLunarDateFromLeap(nYear int, nMonth int, nDay int, nHour int, nMinute int, nSecond int, isLeap bool) *TLunarDate
NewLunarDateFromLeap 新建一个农历日期, 带闰月
func (*TLunarDate) Get64TimeStamp ¶ added in v1.0.1
func (m *TLunarDate) Get64TimeStamp() int64
Get64TimeStamp 获取64位时间戳
func (*TLunarDate) GetAllDays ¶ added in v1.0.1
func (m *TLunarDate) GetAllDays() int
GetAllDays 获取距离公元原点的日数, 这里是农历来的年月日
func (*TLunarDate) GetDateIsValid ¶ added in v1.0.1
func (m *TLunarDate) GetDateIsValid() bool
GetDateIsValid 返回日期是否合法
func (*TLunarDate) GetDayTimeFrom64TimeStamp ¶ added in v1.0.1
func (m *TLunarDate) GetDayTimeFrom64TimeStamp(nTimeStamp int64)
GetDayTimeFrom64TimeStamp 从64位时间戳反推其他参数
func (*TLunarDate) GetLeapMonth ¶ added in v1.0.1
func (m *TLunarDate) GetLeapMonth() int
GetLeapMonth 获取闰月
func (*TLunarDate) GetMonthDays ¶ added in v1.0.1
func (m *TLunarDate) GetMonthDays() int
GetMonthDays 获取某农历年的第N个月是大月30天还是小月29天
func (*TLunarDate) GetMonthFrom64TimeStamp ¶ added in v1.0.1
func (m *TLunarDate) GetMonthFrom64TimeStamp(nTimeStamp int64)
GetMonthFrom64TimeStamp .
func (*TLunarDate) GetYearFrom64TimeStamp ¶ added in v1.0.1
func (m *TLunarDate) GetYearFrom64TimeStamp(nTimeStamp int64) *TLunarDate
GetYearFrom64TimeStamp 从64位时间戳反推年
func (*TLunarDate) String ¶ added in v1.0.1
func (m *TLunarDate) String() string
func (*TLunarDate) ToSolarDate ¶ added in v1.0.2
func (m *TLunarDate) ToSolarDate() *TSolarDate
ToLunarDate 转成农历年
type TShiShen ¶ added in v1.0.1
type TShiShen int
TShiShen 十神
func NewShiShenFromGan ¶ added in v1.0.1
NewShiShenFromGan 从日干和目标干获取十神 nDayGan 日干 Gan2 目标干
type TSiZhu ¶ added in v1.0.1
type TSiZhu struct {
// contains filtered or unexported fields
}
TSiZhu 四柱
func NewSiZhu ¶ added in v1.0.1
func NewSiZhu(pSolarDate *TSolarDate, pBaziDate *TBaziDate) *TSiZhu
NewSiZhu 新四柱
type TSolarDate ¶ added in v1.0.1
type TSolarDate struct {
// contains filtered or unexported fields
}
TSolarDate 日期
func NewQiYun ¶ added in v1.0.1
func NewQiYun(isShunNi bool, dtPreviousJie *TSolarDate, dtNextJie *TSolarDate, dtSolarDate *TSolarDate) *TSolarDate
NewQiYun 起运时间
func NewSolarDate ¶ added in v1.0.1
func NewSolarDate(nYear, nMonth, nDay, nHour, nMinute, nSecond int) *TSolarDate
NewSolarDate 创建一个新历时间
func NewSolarDateFrom64TimeStamp ¶ added in v1.0.1
func NewSolarDateFrom64TimeStamp(nTimeStamp int64) *TSolarDate
NewSolarDateFrom64TimeStamp 从64位时间戳反推日期
func (*TSolarDate) Get64TimeStamp ¶ added in v1.0.1
func (m *TSolarDate) Get64TimeStamp() int64
Get64TimeStamp 生成64位时间戳
func (*TSolarDate) GetAllDays ¶ added in v1.0.1
func (m *TSolarDate) GetAllDays() int
GetAllDays 获得距公元原点的日数 这里是公历的年月日
func (*TSolarDate) GetBasicDays ¶ added in v1.0.1
func (m *TSolarDate) GetBasicDays(nYear, nMonth, nDay int) int
GetBasicDays 获取基本数据
func (*TSolarDate) GetCalendarType ¶ added in v1.0.1
func (m *TSolarDate) GetCalendarType(nYear, nMonth, nDay int) int
GetCalendarType 根据公历日期判断当时历法
func (*TSolarDate) GetDateIsValid ¶ added in v1.0.1
func (m *TSolarDate) GetDateIsValid(nYear, nMonth, nDay int) bool
GetDateIsValid 返回公历日期是否合法
func (*TSolarDate) GetDayTimeFrom64TimeStamp ¶ added in v1.0.1
func (m *TSolarDate) GetDayTimeFrom64TimeStamp(nTimeStamp int64)
GetDayTimeFrom64TimeStamp 从64位时间戳反推其他参数
func (*TSolarDate) GetDiffSeconds ¶ added in v1.0.1
func (m *TSolarDate) GetDiffSeconds(other *TSolarDate) int64
GetDiffSeconds 获取两个日期之间相差的秒数
func (*TSolarDate) GetIsLeapYear ¶ added in v1.0.1
func (m *TSolarDate) GetIsLeapYear(nYear int) bool
GetIsLeapYear 返回某公历是否闰年
func (*TSolarDate) GetLeapDays ¶ added in v1.0.1
func (m *TSolarDate) GetLeapDays(nYear, nMonth, nDay int) int
GetLeapDays 获取闰年天数
func (*TSolarDate) GetMonthDays ¶ added in v1.0.1
func (m *TSolarDate) GetMonthDays(nYear, nMonth int) int
GetMonthDays 取本月天数,不考虑 1582 年 10 月的特殊情况
func (*TSolarDate) GetMonthFrom64TimeStamp ¶ added in v1.0.1
func (m *TSolarDate) GetMonthFrom64TimeStamp(nTimeStamp int64)
GetMonthFrom64TimeStamp 从64位时间戳反推月,
func (*TSolarDate) GetYearFrom64TimeStamp ¶ added in v1.0.1
func (m *TSolarDate) GetYearFrom64TimeStamp(nTimeStamp int64) *TSolarDate
GetYearFrom64TimeStamp 从64位时间戳反推年
func (*TSolarDate) String ¶ added in v1.0.1
func (m *TSolarDate) String() string
func (*TSolarDate) ToBaziDate ¶ added in v1.0.1
func (m *TSolarDate) ToBaziDate() *TBaziDate
ToBaziDate 转成八字日期
func (*TSolarDate) ToLunarDate ¶ added in v1.0.1
func (m *TSolarDate) ToLunarDate() *TLunarDate
ToLunarDate 转成农历年
type TWuXing ¶ added in v1.0.1
type TWuXing int
TWuXing 五行
func GetWuXingFromGan ¶ added in v1.0.1
GetWuXingFromGan 获得某干的五行,0-4 对应 金木水火土 甲乙为木,丙丁为火,戊己为土,庚辛为金,壬癸为水,
type TXiYong ¶ added in v1.0.1
type TXiYong struct {
// contains filtered or unexported fields
}
TXiYong 喜用神
type TYinYang ¶ added in v1.0.1
type TYinYang int
TYinYang 阴阳
func NewYinYangFromGan ¶ added in v1.0.1
NewYinYangFromGan 从干里创建阴阳
func NewYinYangFromZhu ¶ added in v1.0.1
NewYinYangFromZhu 从柱里创建阴阳