You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bear with me on this one. I am a perfectionist. I tested your library for Nov 2, 2013 as that is the last day of DST here in California. For my latitude and longitude, your library reports the next sunset after 0:00 Nov 2 as 18:09:04. I tried 18:00 Nov 2 and got a sunset of 18:08:20. I tried 18:08 Nov 2 and got a sunset of 18:08:17. So I increase the time during Nov 2, 2013 the sunset time changes by getting earlier!
Expected behavior:
For a particular latitude and longitude, the next sunset time should remain constant for all times between the previous sunset and that one.
The text was updated successfully, but these errors were encountered:
Instead of making the package do more than the basic calculations, if you need consistent output for each day, you can use the time at the beginning of the day, instead of the result of time.Now(), as the time argument:
package main
import (
"fmt"
"github.com/cpucycle/astrotime"
"time"
)
const (
Event = "sunrise"
X, Y = float64(12.345), float64(-12.345)
)
func Bod(t time.Time) time.Time {
yr, mth, day := t.Date()
return time.Date(yr, mth, day, 0, 0, 0, 0, t.Location())
}
func main() {
t := Bod(time.Now())
switch Event {
case "sunrise":
fmt.Println(astrotime.CalcSunrise(t, Y, -X))
case "sunset":
fmt.Println(astrotime.CalcSunset(t, Y, -X))
}
}
Bear with me on this one. I am a perfectionist. I tested your library for Nov 2, 2013 as that is the last day of DST here in California. For my latitude and longitude, your library reports the next sunset after 0:00 Nov 2 as 18:09:04. I tried 18:00 Nov 2 and got a sunset of 18:08:20. I tried 18:08 Nov 2 and got a sunset of 18:08:17. So I increase the time during Nov 2, 2013 the sunset time changes by getting earlier!
Expected behavior:
For a particular latitude and longitude, the next sunset time should remain constant for all times between the previous sunset and that one.
The text was updated successfully, but these errors were encountered: