dorkhub

go-sunrise

Go package for calculating the sunrise and sunset times for a given location

nathan-osman
Go17621 forksMITupdated 2 years ago
git clone https://github.com/nathan-osman/go-sunrise.gitnathan-osman/go-sunrise

go-sunrise

Build Status Coverage Status Go Report Card GoDoc MIT License

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{}.

more like this

ForwardWidgets

Widgets for Douban and Trakt watchlists plus personalized recommendations, live TV streaming including PlutoTV, Yatu ra…

JavaScript247

webgpu

Zero-CGO WebGPU bindings for Go — GPU-accelerated graphics and compute in pure Go

Go52

YiMao

YiMao · 云海求片助手 — 双核心 Telegram 影视求片机器人。订阅模式:TMDB 智能搜索一键订阅 / 趣味求片模式:AI 生成五层地狱闯关,通关解锁优先求片。深度集成 MoviePilot + Emby/Jellyfin。…

Go52

search

search projects, people, and tags