Product Promotion
0x5a.live
for different kinds of informations and explorations.
GitHub - nathan-osman/go-sunrise: Go package for calculating the sunrise and sunset times for a given location
Go package for calculating the sunrise and sunset times for a given location - nathan-osman/go-sunrise
Visit SiteGitHub - nathan-osman/go-sunrise: Go package for calculating the sunrise and sunset times for a given location
Go package for calculating the sunrise and sunset times for a given location - nathan-osman/go-sunrise
Powered by 0x5a.live ๐
go-sunrise
Go package for calculating the sunrise and sunset times for a given location based on this method.
Usage
To calculate sunrise and sunset times, you will need the following information:
- the date for which you wish to calculate the times
- the latitude and longitudinal coordinates of the location
Begin by importing the package:
import "github.com/nathan-osman/go-sunrise"
Next, feed the information into the SunriseSunset() method:
rise, set := sunrise.SunriseSunset(
43.65, -79.38, // Toronto, CA
2000, time.January, 1, // 2000-01-01
)
The two return values will be the sunrise and sunset times for the location on the given day as time.Time values. If sun does not rise or set, both return values will be time.Time{}.
GoLang Resources
are all listed below.
Made with โค๏ธ
to provide different kinds of informations and resources.