# README
calendar
Chinese Lunar Calendar, Solar Calendar and cron time rules.
About
//Solar structure
type Solar struct {
time.Time
}
//Luanr structure
type Lunar struct {
year int
month int
day int
hour int
minute int
second int
nanosecond int
leapMonth int
isLeapMonth bool
}
func NewSolar(year, month, day, hour, min, sec, nsec int) *Solar
func NewSolarNow() *Solar
func NewLunar(year, month, day, hour, min, sec, nsec int, leapFirst bool) *Lunar
func NewLunarNow() *Lunar
Lunar or Solar has a method Convert
to convert itself to the opposite one.
func (s *Solar) Convert() *Lunar
func (l *Lunar) Convert() *Solar
func (l Lunar) Add(years, months, days, hours, mins, secs, nsecs int) *Lunar
NOTICE
This package's year range is [1900,2050]
and month range is [1,12]
.
Example
package main
import ""
import "fmt"
func main() {
l0 := lunar.NewLunar(1988, 2, 11, 9, 9, 9, 0, false)
fmt.Println(l0)
s0 := l0.Convert()
fmt.Println(s0)
s1 := lunar.NewSolar(1988, 3, 28, 9, 9, 9, 0)
fmt.Println(s1)
l1 := s0.Convert()
fmt.Println(l1)
s := lunar.NewSolarNow()
fmt.Println(s)
l := lunar.NewLunarNow()
fmt.Println(l)
s2l := s.Convert()
fmt.Println(s2l)
l2s := l.Convert()
fmt.Println(l2s)
}
Cron
# Functions
Sheng Xiao.
No description provided by the author
Tian Gan.
Tian Gan && Di Zhi.
Input: solar (year,month,day).
IsLeapYear determines whether it is a leap year.
IsLunarZero judge whether the lunar time is equal to lunar zero time.
y年的第n个节气为几日 n range [1,24].
No description provided by the author
month range [1,12].
No description provided by the author
LeapDays the days of this year's leap month.
LeapMonth which month leaps in this year? return 1-12(if there is one) or 0(no leap month).
LunarDayString used Only by Lunar Object.
LunarMonthDays the days of the m-th month of this year.
LunarMonths the total lunar months of this year.
LunarMonthString used Only by Lunar Object.
LunarYearDays the total days of this year.
LunarYearString used Only by Lunar Object.
No description provided by the author
No description provided by the author
NewLunar creates a lunar time.
NewLunarNow creates current lunar time.
NewSolar creates a solar time.
NewSolarNow creates current solar time.
NewSolarTime creates a solar time from time.Time.
SolarMonthDays the days of the m-th month of this year.
SplitDuration split duration, accurate to second.
Di Zhi.
hour range [0,23] return: start point DiZhi.
# Variables
No description provided by the author
CST CST China Standard Time UT 8:00.
1900 2月春分后为 庚子年.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LunarZero lunar zero time.
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author