diff --git a/astrotime.go b/astrotime.go index 9b47b1e..e60f442 100755 --- a/astrotime.go +++ b/astrotime.go @@ -335,10 +335,7 @@ func CalcDawn(t time.Time, latitude float64, longitude float64, solarElevation f // CalcSunrise calculates the sunrise, in local time, on the day t at the // location specified in longitude and latitude. func CalcSunrise(t time.Time, latitude float64, longitude float64) time.Time { - jd := CalcJD(t) - sunriseUTC := time.Duration(math.Floor(calcSunriseUTC(jd, latitude, longitude, SUNRISE)*60) * 1e9) - loc, _ := time.LoadLocation("UTC") - return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc).Add(sunriseUTC).In(t.Location()) + return CalcDawn(t, latitude, longitude, SUNRISE) } // Calculates the refractive correction for the specified solar elevation.