addon module¶
- ziptimezone.addon.get_sunrise_sunset_for_zip(zip_code, date=None)[source]¶
Calculate sunrise and sunset times for a given ZIP code on a specified date, considering DST adjustments. If no date is provided, today’s date is used.
- Parameters:
zip_code (str) – The ZIP code for which to calculate sunrise and sunset times.
date (datetime.date, optional) – The date for which to calculate the times. Defaults to today’s date if not provided.
- Returns:
- A dictionary containing the sunrise and sunset times as strings (local time),
with keys ‘sunrise_time’ and ‘sunset_time’.
- Return type:
dict