Documentation
¶
Overview ¶
Package lunar is part of the carbon package.
Index ¶
- type Gregorian
- type Lunar
- func (l Lunar) Animal() string
- func (l Lunar) Day() int
- func (l Lunar) Festival() string
- func (l Lunar) Hour() int
- func (l Lunar) IsDogYear() bool
- func (l Lunar) IsDragonYear() bool
- func (l Lunar) IsGoatYear() bool
- func (l Lunar) IsHorseYear() bool
- func (l Lunar) IsLeapMonth() bool
- func (l Lunar) IsLeapYear() bool
- func (l Lunar) IsMonkeyYear() bool
- func (l Lunar) IsOxYear() bool
- func (l Lunar) IsPigYear() bool
- func (l Lunar) IsRabbitYear() bool
- func (l Lunar) IsRatYear() bool
- func (l Lunar) IsRoosterYear() bool
- func (l Lunar) IsSnakeYear() bool
- func (l Lunar) IsTigerYear() bool
- func (l Lunar) IsZero() bool
- func (l Lunar) LeapMonth() int
- func (l Lunar) Minute() int
- func (l Lunar) Month() int
- func (l Lunar) Second() int
- func (l Lunar) String() string
- func (l Lunar) ToDateString() string
- func (l Lunar) ToDayString() (day string)
- func (l Lunar) ToGregorian() (g Gregorian)
- func (l Lunar) ToMonthString() (month string)
- func (l Lunar) ToWeekString() (month string)
- func (l Lunar) ToYearString() (year string)
- func (l Lunar) Year() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gregorian ¶ added in v2.3.7
Gregorian defines a Gregorian struct. 定义 Gregorian 结构体
func FromGregorian ¶ added in v2.3.8
FromGregorian creates a Gregorian instance from time.Time. 从标准 time.Time 创建 Gregorian 实例
type Lunar ¶
type Lunar struct { Error error // contains filtered or unexported fields }
Lunar defines a Lunar struct. 定义 Lunar 结构体
func FromLunar ¶ added in v2.3.8
FromLunar creates a Lunar instance from lunar datetime. 从 农历日期 创建 Lunar 实例
func (Lunar) IsDragonYear ¶ added in v2.3.7
IsDragonYear reports whether is year of Dragon. 是否是龙年
func (Lunar) IsGoatYear ¶ added in v2.3.7
IsGoatYear reports whether is year of Goat. 是否是羊年
func (Lunar) IsHorseYear ¶ added in v2.3.7
IsHorseYear reports whether is year of Horse. 是否是马年
func (Lunar) IsLeapMonth ¶ added in v2.3.7
IsLeapMonth reports whether is leap month. 是否是农历闰月
func (Lunar) IsLeapYear ¶ added in v2.3.7
IsLeapYear reports whether is leap year. 是否是农历闰年
func (Lunar) IsMonkeyYear ¶ added in v2.3.7
IsMonkeyYear reports whether is year of Monkey. 是否是猴年
func (Lunar) IsRabbitYear ¶ added in v2.3.7
IsRabbitYear reports whether is year of Rabbit. 是否是兔年
func (Lunar) IsRoosterYear ¶ added in v2.3.7
IsRoosterYear reports whether is year of Rooster. 是否是鸡年
func (Lunar) IsSnakeYear ¶ added in v2.3.7
IsSnakeYear reports whether is year of Snake. 是否是蛇年
func (Lunar) IsTigerYear ¶ added in v2.3.7
IsTigerYear reports whether is year of Tiger. 是否是虎年
func (Lunar) String ¶ added in v2.3.7
String implements Stringer interface and outputs a string in YYYY-MM-DD HH::ii::ss format like "2019-12-07 00:00:00". 实现 Stringer 接口, 输出 YYYY-MM-DD HH::ii::ss 格式字符串,如 "2019-12-07 00:00:00"
func (Lunar) ToDateString ¶ added in v2.3.7
ToDateString outputs a string in lunar date format like "二零二零年腊月初五". 获取农历日期字符串,如 "二零二零年腊月初五"
func (Lunar) ToDayString ¶ added in v2.3.7
ToDayString outputs a string in lunar day format like "廿一". 获取农历日字符串,如 "廿一"
func (Lunar) ToGregorian ¶ added in v2.3.7
ToGregorian converts Lunar instance to Gregorian instance. 将 Lunar 实例转化为 Gregorian 实例
func (Lunar) ToMonthString ¶ added in v2.3.7
ToMonthString outputs a string in lunar month format like "正月". 获取农历月份字符串,如 "正月"
func (Lunar) ToWeekString ¶ added in v2.3.8
ToWeekString outputs a string in week layout like "周一". 输出完整农历星期字符串,如 "周一"
func (Lunar) ToYearString ¶ added in v2.3.7
ToYearString outputs a string in lunar year format like "二零二零". 获取农历年份字符串,如 "二零二零"