NOAA algorithm · golden / blue hour · live

Sunrise, sunset & golden hour for any place

Pick latitude, longitude and a date. We compute sunrise, sunset, solar noon, civil/nautical/astronomical twilight using the NOAA solar algorithm. Accurate to ±1 minute.

Quick Start

How solar times are computed

The NOAA algorithm derives solar declination and equation of time from Julian centuries since J2000, then projects sun events for your latitude and longitude.

  1. 01

    Enter location

    WGS-84 lat/lng. Decimal degrees. Negative south/west.

    Parsing accepts ISO 8601, RFC 3339, RFC 2822, and Unix epoch seconds/milliseconds. The Date constructor handles the rest with browser-engine consistency.

    locISO 8601RFC 3339epochlive
    lat,lng · timestampWGS-84 · ISO
    40.71, -74.01
    loaded · ISO 8601zone · ready
  2. 02

    Pick a date

    Any calendar date. The algorithm handles polar days.

    All math runs in UTC internally to avoid DST landmines; presentation converts back to the user’s zone via Intl.DateTimeFormat.

    dateUTC mathIntlDST-safelive
    date · optionsinput · live
    2026-05-21
    options applied · UTCDST-safe
  3. 03

    Solar geometry

    Declination + equation-of-time → solar noon and hour angle.

    Output respects the chosen timezone offset (Z vs +05:30) and pads digits per ISO conventions so sorts stay chronological.

    sunoffsetzone-awaresortablepadded
    noon · computed12:55 · ready
    hour angle = …
    computed · instantsortable
  4. 04

    Read events

    Sunrise, sunset, golden hour (civil twilight) and astronomical twilight all derived from zenith angles.

    Copy writes via the Async Clipboard API; nothing pings a time server — the browser’s clock is the only oracle.

    eventsclipboardno oracledeterministicclient-side
    ✓ · copiedready · done
    05:39 → 20:18
    shipped · ready to shipsuccess
Pro tips

Time math without DST landmines

Always store UTC

Convert to local for display only. UTC storage avoids DST jumps and timezone drift in databases.

Watch leap seconds

POSIX time doesn’t count leap seconds; some systems do. Don’t use timestamps for sub-second precision across boundaries.

Prefer Temporal eventually

The Date API has many quirks. Temporal is shipping in modern engines and handles zones correctly.

Cron is timezone-tricky

Cron expressions run in the daemon’s local zone unless told otherwise. Pin a TZ explicitly for predictable runs.

ISO 8601 sorts naturally

YYYY-MM-DDTHH:mm:ss sorts correctly as a string. Don’t use US-style MM/DD/YYYY for anything machine-readable.

Beware Y2K38

Signed 32-bit Unix timestamps overflow in 2038. Use 64-bit storage end-to-end for long-lived systems.

Use Cases

When to query sun times

Photography, agriculture, travel.

Photography

Plan a shoot during golden hour. Math runs in UTC under the hood to dodge DST jumps — local time is only for display. That means scheduling logic and date diffs survive March / November fall-back without the classic off-by-one-hour bug.

DST-safe

Astronomy

Astronomical twilight tells you when the sky goes dark. Browser clock is the only source — no external time server, no privacy leak, no rate limit. Pair with NTP-synced server time for high-accuracy use cases, but for human-scale work the browser clock is plenty.

UTC-correct

Agriculture

Match field work with daylight. ISO 8601 output sorts naturally as strings, perfect for filenames (report-2026-01-15.pdf) and log lines that need chronological ordering without parsing. Drop into S3 keys for free time-bucketing.

ISO-sortable

Smart home

Trigger lights at civil twilight. Pairs cleanly with cron, scheduled tasks, and timestamped log analysis. The tool's output drops directly into APScheduler, Linux cron, or GitHub Actions schedule expressions without re-formatting.

spec-grade

Travel

Plan hikes to finish before dark. Output respects the chosen timezone offset (Z vs +05:30) so REST APIs and database TIMESTAMP WITH TIME ZONE columns round-trip cleanly. No ambiguity between "noon UTC" and "noon local".

zone-aware

Religious obs.

Know prayer / fast windows. Confirms the difference between epoch seconds (10 digits) and milliseconds (13 digits) before you commit code that mis-multiplies by 1000 — a classic bug in cross-language time handling.

epoch-accurate
FAQ

Frequently asked questions

Within ±1 minute for most latitudes. Polar regions degrade due to the algorithm's approximations.
Civil: sun 6° below horizon (lights useful). Nautical: 12° (horizon visible). Astronomical: 18° (stars fully visible).
Your browser timezone — change OS TZ to see another place.
Polar day — happens in summer above ~66.5° latitude.
No. The whole NOAA calc runs in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!