Documentation ¶
Index ¶
- Variables
- func CalcSuntimeAstro(lat float64, lng float64, date time.Time) (*time.Time, *time.Time, error)
- func GetSunriseSunset(latitude float64, longitude float64, utcOffset float64, date time.Time) (sunrise time.Time, sunset time.Time, err error)
- func LeapYear(year int) bool
- type Params
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LocalCST 本地时区 LocalCST = time.FixedZone("CST", 8*3600) )
Functions ¶
func CalcSuntimeAstro ¶
CalcSuntimeAstro 使用starainrt/astro库计算日出日落 // year int, month time.Month, day int
func GetSunriseSunset ¶
func GetSunriseSunset(latitude float64, longitude float64, utcOffset float64, date time.Time) (sunrise time.Time, sunset time.Time, err error)
GetSunriseSunset function is responsible for calculate the apparent Sunrise and Sunset times. If some parameter is wrong it will return an error.
Types ¶
type Params ¶
type Params struct { SunResult sync.Map Latitude float64 Longitude float64 UtcOffset float64 Year int }
Params The Parameters struct can also be used to manipulate the data and get the sunrise and sunset sunrise/sunset int hh*60+mm
func (*Params) Calculation ¶
Calculation 使用当前年份计算全年日出日落时间hh*60+mm,非润年,2月29日采用28日时间
Click to show internal directories.
Click to hide internal directories.