From 007eea327bd35cc630d8dd2779c34f6d83c55af7 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Jun 2024 00:42:10 -0700 Subject: [PATCH] Update solarconditions.py --- solarconditions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solarconditions.py b/solarconditions.py index 283450e..0cb53ac 100644 --- a/solarconditions.py +++ b/solarconditions.py @@ -92,7 +92,8 @@ def get_sun(lat=0, lon=0): sun_table['set_time'] = local_sunset.strftime('%a %d %I:%M') #if sunset is before sunrise, then it's tomorrow if local_sunset < local_sunrise: - local_sunset = local_sunset + timedelta(1) + local_sunset = ephem.localtime(obs.next_setting(sun)) + timedelta(1) + sun_table['set_time'] = local_sunset.strftime('%a %d %I:%M') sun_data = f"Sun Rise: " + sun_table['rise_time'] + "\nSet: " + sun_table['set_time'] return sun_data