Gloss Tools

Sunrise & Sunset Calculator

Enter a date with a latitude, longitude, and fixed UTC offset to compute local sunrise, solar noon, sunset, and day length with the NOAA approximation. At high latitudes, a polar day or polar night is reported as a status instead of fake times. Eight city presets are built in; for daylight-saving time, add an hour to the offset yourself.

Input

Format YYYY-MM-DD, from 1900-01-01 to 2100-12-31.

Choosing a city fills in its latitude, longitude, and standard-time offset; you can edit the three fields afterwards, which switches the preset back to custom.

−89.9 to 89.9, north is positive, up to 4 decimal places.

−180 to 180, east is positive, up to 4 decimal places.

Format ±HH:MM with minutes 00, 15, 30 or 45, from −12:00 to +14:00. For daylight-saving time, add an hour yourself.

Nothing calculated yet. Enter a date and coordinates, or load the example.

How it is calculated

The algorithm is the NOAA Global Monitoring Laboratory Solar Calculator approximation: the day of year and fractional year γ (evaluated at local noon) give the equation of time and the solar declination, and the hour angle is solved at the fixed zenith 90.833° (which already includes atmospheric refraction and the solar disc radius) to produce sunrise, solar noon, and sunset. Day length is computed from the unrounded sunrise and sunset and rounded once.

Latitude is limited to ±89.9 rather than ±90 because the formulas degenerate at the poles (cos φ is 0 and tan φ diverges); polar day and polar night are decided by the domain of the hour-angle cosine instead. Results use only the fixed offset; there is no time-zone database and no daylight-saving detection.

Frequently asked questions

Why is this a minute or two off the official time?
This tool uses the NOAA approximation with γ evaluated at local noon and a single fixed offset; official almanacs use more precise ephemerides and local time-zone rules, so a difference of a few minutes is expected.
Why is there no daylight-saving option?
The offset is a fixed input; for daylight-saving time add an hour yourself, e.g. use +11:00 for Sydney in summer.
What is solar noon?
The moment the sun crosses the local meridian; under a fixed offset it is usually not 12:00.

All computation runs locally in this page. Your input is never uploaded, stored, or logged.