Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1288

Python • Re: twilight times

$
0
0
"dusk" and "dawn" would be close to 'twilight' which does not exist in the provided data.
Or use
import astral.sun
timezone = zoneinfo.ZoneInfo("Europe/Brussels")
city = LocationInfo("Brussels", "Belgium", "Europe/Brussels", 50.84, 4.35)
s = astral.sun.twilight(city.observer, date=datetime.date(2025, 3, 17), tzinfo=timezone)
print(s)

Statistics: Posted by ghp — Mon Mar 17, 2025 7:58 pm



Viewing all articles
Browse latest Browse all 1288

Trending Articles