Civil Twilight Times Calculator
On 21 June 2026 at latitude 40.7128 and longitude -74.006, civil twilight begins at 08:51 UTC and ends at 01:04 UTC the next day. Enter a date and coordinates to get both moments, when the Sun sits 6 degrees below the horizon. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2026-06-21
- Latitude
- 40.7128
- Longitude
- -74.006
- Solar depression deg
- 6
- Accuracy
- approximate
- Status
- ok
- Civil twilight begin utc
- 2026-06-21T08:51:00Z
This civil twilight calculator estimates when morning civil twilight begins and evening civil twilight ends for a specific Gregorian date, latitude, and longitude. It returns deterministic UTC timestamps based only on the values you provide. Civil twilight uses the conventional threshold at which the Sun's center is 6 degrees below the horizon. The result is useful for planning, scheduling, photography, outdoor operations, and data workflows that need a reproducible approximation rather than live observations or a location lookup.
Enter an exact date and location
Provide the calendar date in strict YYYY-MM-DD form, then enter latitude and longitude as decimal degrees. Positive latitude is north and negative latitude is south; positive longitude is east and negative longitude is west. The calculation does not infer a city, time zone, elevation, or daylight-saving rule.
UTC is especially helpful in automated systems because it avoids duplicated or missing local clock times around daylight-saving transitions. A returned timestamp can fall on the preceding or following UTC calendar date for locations far east or west of Greenwich, which is normal and does not mean the requested local solar date changed. Validate coordinate signs carefully, because reversing a longitude moves the estimated events by many hours.
The accepted latitude range is -90 through 90 and the longitude range is -180 through 180. Impossible dates and non-finite coordinates are rejected instead of being silently adjusted.
Understand the approximation
Civil twilight is conventionally bounded by a solar zenith of 96 degrees, equivalent to the center of the Sun being 6 degrees below an ideal horizon. The calculator estimates the Sun's mean anomaly, true longitude, right ascension, declination, and hour angle, then converts the two threshold crossings to UTC. Results are rounded to the nearest minute because this compact solar-position method is an approximation; displaying artificial sub-second precision would misrepresent it.
Atmospheric refraction, observer elevation, terrain, buildings, sea-horizon dip, unusual weather, and small higher-order astronomical corrections are not modeled. Those factors can shift what a person actually sees. Treat the output as a planning estimate, not as a safety-critical observation or an official almanac.
Interpret normal and polar results
Morning begin marks the Sun crossing upward through 6 degrees below the horizon; evening end marks its downward crossing. Near the Arctic or Antarctic circles, the chosen threshold may never be crossed on a particular date. When presenting the result to people, convert the UTC timestamps with a trusted time-zone library and clearly label the target zone.
When scheduling machinery or field work, add an operational margin and consult authoritative local sources, since terrain and atmospheric conditions can change visible light independently of the calculated geometric threshold.
What you can do with it
Plan an outdoor photo session
Estimate the UTC window around dawn and dusk before converting it to the location's civil time zone.
Schedule lighting automation
Create reproducible daily switching estimates from stored dates and coordinates without calling a weather or geocoding service.
Annotate environmental data
Classify observations relative to approximate civil twilight boundaries with a deterministic calculation suitable for repeatable pipelines.
FAQ
What does civil twilight mean?
It is the period when the Sun's center is between the horizon and 6 degrees below it. This calculator estimates the outer 6-degree crossings.
Are the returned times local?
No. They are ISO 8601 UTC timestamps ending in Z. Convert them separately if you need a named local time zone.
How accurate are the results?
They are planning approximations rounded to the nearest minute. Elevation, terrain, refraction, weather, and higher-order astronomical effects are not modeled.
Why are times absent for some polar locations?
On some dates the Sun never crosses 6 degrees below the horizon. The response reports that condition and omits nonexistent event timestamps.
Does it use my device clock or a live service?
No. It uses only the supplied date, latitude, and longitude, so identical inputs produce identical results.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/date/civil-twilight-approx \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2026-06-21","lat":40.7128,"lon":-74.006}'const res = await fetch("https://api.kit.forhosting.com/date/civil-twilight-approx", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2026-06-21",
"lat": 40.7128,
"lon": -74.006
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/civil-twilight-approx",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2026-06-21",
"lat": 40.7128,
"lon": -74.006
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/civil-twilight-approx", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2026-06-21","lat":40.7128,"lon":-74.006}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2026-06-21","lat":40.7128,"lon":-74.006}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/civil-twilight-approx", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"date": "2026-06-21",
"lat": 40.7128,
"lon": -74.006
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.civil_twilight_approx",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Enter an exact date and location
That makes the contract unambiguous: the same three inputs always produce the same UTC result, wherever the request runs.
Interpret normal and polar results
For most populated latitudes and dates, status is ok and the response includes civil_twilight_begin_utc and civil_twilight_end_utc as ISO 8601 timestamps ending in Z. In that case the response intentionally omits both event timestamps, reports no_civil_twilight_crossing, and identifies whether the Sun remains above or below the civil-twilight threshold all day. This is more accurate than inventing midnight values or returning null fields that downstream code might mistake for events.
Technical questions
What does an API request cost?
The base price is $0.002 per request. The same deterministic logic can also run in the browser experience.