sun_times
Compute sunrise, sunset, solar noon, and civil twilight for any latitude/longitude on a given date. Times are computed in code from the standard NOAA solar-position equations (no third-party API is called, so the result is dependency-free and resale-safe). Times are returned in UTC by default; pass tz_offset (hours from UTC, e.g. -7 for US Pacific Daylight Time) to shift the output to local clock time. Polar day and polar night are reported when the sun does not rise or set. Use it for daylight planning, photography golden-hour timing, or agriculture and energy calculations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude in decimal degrees (positive north). | |
| lon | Yes | Longitude in decimal degrees (negative west). | |
| date | No | Date, 'YYYY-MM-DD'. Defaults to today (UTC). | |
| tz_offset | No | Hours from UTC applied to output times, e.g. -7 for US Pacific Daylight Time. Default 0 (UTC). |