Twilight, sunrise & sunset calculator

Plan dark hours with fixed thresholds: sunrise/set -0.833°, twilight -6/-12/-18°.

Other languages 日本語 | English | 简体中文 | Español | Português (Brasil) | Bahasa Indonesia | Français | हिन्दी | العربية

How to read A/B codes

Quick start (3 steps)

  1. Set location, date, and timezone.
  2. Optionally add horizon correction (degrees).
  3. Compute to get twilight events, night length, and the daily sun-altitude curve.

Inputs

Results

sunrise
sunset
Solar noon
Civil dawn / Civil dusk /
Nautical dawn / Nautical dusk /
Astronomical dawn / Astronomical dusk /
Astronomical night length (min)
Resolved TZ

Sun altitude chart

Definitions & notes

How to use this calculator effectively

This guide helps you use Twilight, sunrise & sunset calculator in a repeatable way: define a baseline, change one variable at a time, and explain each output using explicit assumptions before sharing results.

How it works

The calculator applies deterministic formulas to your input values and only rounds at the final display layer. This makes it useful for comparative analysis: keep one scenario as a baseline, then vary assumptions and measure the delta in both absolute terms and percentage terms. If a change appears too large or too small, verify units, period conventions, and sign direction before interpreting the result.

When to use

Use this page when you need a fast planning estimate, a classroom check, or a reproducible scenario that teammates can review. It is most effective at the decision-prep stage, where you need to compare options quickly and decide which assumptions deserve deeper modeling or external validation.

Common mistakes to avoid

Interpretation and worked example

Start with a baseline case and save that output. Next, edit one assumption to reflect your realistic alternative, then compare both the direction and size of change. If the direction matches domain intuition and magnitude is plausible, your setup is likely coherent. If not, check hidden defaults, unit conversions, boundary conditions, and date logic before drawing conclusions.

See also

FAQ

Why do sunrise/sunset sometimes show as None?

At high latitudes or near the solstice, the sun may not cross the horizon in one direction on that date. The script keeps the status explicit to avoid silent errors when no event exists.

What are civil, nautical, and astronomical twilight?

Twilight is categorized by sun altitude relative to the horizon. This calculator uses -6°, -12°, and -18° as practical thresholds for bright/blue/astronomical sky phases.

How does horizon correction affect results?

A positive horizon moves the reference line upward, so low-elevation events become harder to satisfy. This models terrain/building obstruction in a simplified way.

What should I enter first?

Start with the minimum required inputs shown above the calculate button, then keep optional settings at their defaults for a first pass. After getting a baseline, change one parameter at a time so you can explain which assumption moved the output.

How precise are the results?

The calculator keeps internal precision and rounds only for display. Small differences can still appear if another tool uses different constants, period conventions, or rounding rules. Align assumptions before comparing final values.