-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
simple example:
from astral import LocationInfo
TZ= 'GMT+2'
where = LocationInfo('here', 'Switzerland', TZ, 47.2, 7.0)
print((
f"Information for {where.name}/{where.region}\n"
f"Timezone: {where.timezone}\n"
f"Latitude: {where.latitude:.02f}; Longitude: {where.longitude:.02f}\n"
))
from datetime import datetime
from astral.sun import sun
s = sun(where.observer, date=datetime.now())
print((
f'Sunrise: {s["sunrise"]}\n'
))
result:
Information for here/Switzerland
Timezone: GMT+2
Latitude: 47.20; Longitude: 7.00
Sunrise: 2025-04-20 11:30:48+00:00
What I expect
timezone used to display times should match timezone specified for observer
Information for here/Switzerland
Timezone: GMT+2
Latitude: 47.20; Longitude: 7.00
Sunrise: 2025-04-20 13:30:48+02:00
Note
actual times are bogus
PanderMusubi
Metadata
Metadata
Assignees
Labels
No labels