Skip to content

Sunrise and Sunset Calculator

Updated:

Enter a date, latitude, longitude and UTC offset to get sunrise, sunset, solar noon and total daylight duration for any place on Earth, computed with NOAA solar position equations.

Estimate Sunrise, Sunset and Daylight for Any Location

Input Fields
The date you want the times for (YYYY-MM-DD).
φ
°
Positive for the northern hemisphere, negative for the southern.
λ
°
Positive east of Greenwich, negative west (e.g. New York is −74.006).
h
Hours added to UTC at your location (e.g. 5 for UTC+5, −8 for UTC−8). Use the standard time offset; daylight saving is not applied.
If enabled, the result will update automatically when you change any value.

Sunrise and Sunset Formula

Formula
\[ \cos H = \frac{\cos 90.833^\circ}{\cos\varphi\,\cos\delta} - \tan\varphi\,\tan\delta \\ t_{\text{noon}} = 720 - 4\lambda - E \\ t_{\text{rise}} = t_{\text{noon}} - 4H, \qquad t_{\text{set}} = t_{\text{noon}} + 4H \]

Where:

  • \(\varphi\) — latitude of the location (degrees, positive in the northern hemisphere)
  • \(\lambda\) — longitude (degrees, positive east of Greenwich)
  • \(\delta\) — solar declination on the chosen date (degrees)
  • \(E\) — equation of time (minutes)
  • \(H\) — hour angle of the Sun at the horizon (degrees)
  • \(90.833^\circ\) — the official zenith angle of sunrise and sunset: \(90^\circ\) plus the Sun's apparent radius (\(\approx 0.267^\circ\)) and standard atmospheric refraction (\(\approx 0.567^\circ\))

The declination \(\delta\) and the equation of time \(E\) are derived from the date using the NOAA solar position equations. All times \(t\) are in minutes past midnight UTC — add the UTC offset (multiplied by 60) to get local time. The factor \(4H\) converts degrees of hour angle into minutes of time, because the Earth turns 1° in 4 minutes. If \(\cos H > 1\) the Sun never rises (polar night); if \(\cos H < -1\) it never sets (midnight sun).

Sunrise and Sunset – Calculation Example

Example: the June solstice, 21 June 2025, in London (latitude 51.5074°, longitude −0.1278°, UTC offset 0).

\[ \delta = 23.44^\circ, \qquad E \approx -1.7\ \text{min} \]

\[ t_{\text{noon}} = 720 - 4 \times (-0.1278) - (-1.7) \approx 722\ \text{min} \rightarrow \text{12:02} \]

\[ \cos H = \frac{\cos 90.833^\circ}{\cos 51.5074^\circ \cos 23.44^\circ} - \tan 51.5074^\circ \tan 23.44^\circ \approx -0.570 \rightarrow H \approx 124.8^\circ \rightarrow 4H \approx 499\ \text{min} \]

\[ t_{\text{rise}} = 722 - 499 = 223\ \text{min} \rightarrow \text{03:43}, \qquad t_{\text{set}} = 722 + 499 = 1221\ \text{min} \rightarrow \text{20:21} \]

Result: sunrise 03:43, sunset 20:21, solar noon 12:02 and 16 h 38 min of daylight, all in UTC (offset 0). In real life Britain uses BST (UTC+1) in June, so add one hour to get the clock times: 04:43 and 21:21 — exactly what an almanac shows for London on that date.

How to Use the Calculator

  1. Enter the Date you want the times for, in the format YYYY-MM-DD.
  2. Enter the Latitude of the location in degrees — positive for the northern hemisphere, negative for the southern (e.g. Sydney is −33.87).
  3. Enter the Longitude in degrees — positive east of Greenwich, negative west (e.g. New York is −74.006).
  4. Enter the UTC Offset of your location in hours, using the standard time offset (e.g. 5 for UTC+5, −8 for UTC−8). Daylight saving time is not applied automatically.
  5. Press Calculate and read the results: Sunrise and Sunset in local time, Solar Noon, the Daylight Duration, and the Details block, which shows the solar declination, the equation of time, and special messages for polar night or midnight sun.

What Sunrise and Sunset Times Mean

By international convention, sunrise and sunset are the moments when the upper edge of the Sun's disk appears or disappears at an ideal sea-level horizon. Because the atmosphere bends sunlight (refraction) and the Sun has a visible radius, this happens when the centre of the Sun is still about 0.833° below the geometric horizon — that is where the zenith angle of 90.833° in the formula comes from. Official almanacs and weather services use the same convention, so the results here can be compared directly with published tables.

Solar noon is the instant the Sun crosses your local meridian and stands highest in the sky that day. At that moment shadows point exactly north or south (depending on your hemisphere). Solar noon rarely falls exactly at 12:00 on the clock: your position within your time zone and the equation of time — the difference between sundial time and clock time caused by the Earth's tilted axis and elliptical orbit — can shift it by up to an hour or more near the edges of wide time zones.

Daylight duration depends almost entirely on latitude and season. Around the equinoxes (roughly 20 March and 22–23 September) every place on Earth gets close to 12 hours of daylight. Away from the equator, days lengthen toward the summer solstice and shorten toward the winter solstice, and the effect grows stronger with latitude. Above the polar circles (about ±66.6°) the Sun may never set (midnight sun) or never rise (polar night) — the calculator detects both cases and tells you which one applies.

Accuracy, Assumptions and Practical Tips

  • Accuracy: the NOAA equations give times accurate to about 1–3 minutes at moderate latitudes. Near the poles, where the Sun grazes the horizon at a shallow angle, real times can shift by several minutes.
  • Daylight saving time is not applied. If DST is in effect at your location on the chosen date, add 1 hour to the displayed times yourself.
  • Fixed UTC offset: the calculator uses the offset you enter, not the political boundaries of real time zones, so it works for any point on the globe, including the open sea.
  • Flat sea-level horizon assumed: hills, mountains or buildings on the horizon delay sunrise and advance sunset. Local air temperature and pressure also change refraction slightly, which shifts the real crossing times by a few seconds to a minute.
  • Rounding: all times are rounded to the nearest minute, so a displayed daylight duration may differ from sunset minus sunrise by up to a minute.

If you are planning around these times, the Days Between Dates calculator helps you count how far away a chosen date is, and the Monthly Calendar Generator lets you lay the date out on a printable calendar next to the sunrise and sunset times you compute here.

Frequently Asked Questions

Why is there more than 12 hours of daylight on the equinox?

Two effects stretch the day beyond 12 hours: sunrise and sunset are defined by the upper edge of the Sun's disk, and atmospheric refraction lifts the image of the Sun by about \(0.567^\circ\), so the Sun is still geometrically below the horizon when it officially rises or sets. Together these add roughly 6–8 minutes of extra daylight, so mid-latitudes typically see 12 h 10 min or more of daylight around 20 March and 22–23 September.

How do I find the latitude and longitude for my location?

Right-click your location in Google Maps or a similar mapping service — the coordinates appear as two decimal numbers, e.g. \(40.7128, -74.0060\). The first is latitude (positive north, negative south), the second is longitude (positive east, negative west). Enter them with their signs exactly as shown. Note that most map apps list the sign as N/S or E/W letters: convert these to plus or minus before entering the values.

Why does the earliest sunset come before the winter solstice, and the latest sunrise after it?

The shortest day is at the solstice, but the earliest sunset typically falls one to four weeks earlier and the latest sunrise the same span later. The cause is the equation of time \(E\): solar days in December run slightly longer than 24 hours, so the whole daylight window drifts later on the clock day by day. Run the calculator for several dates around the solstice to see the effect.

Does the calculator handle places with unusual UTC offsets, like India or Nepal?

Yes. The UTC offset field accepts any value in steps of 0.5, so you can enter 5.5 for India (UTC+5:30), 5.75 for Nepal (UTC+5:45), 9.5 for parts of Australia, or 13 for Tonga. Because the offset is applied as \(\text{offset} \times 60\) minutes to the UTC result, half-hour and quarter-hour zones work exactly the same as whole-hour ones.

Can I use this to plan the golden hour or twilight for photography?

The calculator gives sunrise and sunset but not twilight. As a rule of thumb, civil twilight (enough light to see the horizon, and roughly the golden hour) lasts about 20–35 minutes before sunrise and after sunset at mid-latitudes — around \(H_c\) for a zenith of \(96^\circ\). Near the poles twilight stretches for hours. For precise twilight times you would need the hour-angle formula with zenith angles of \(96^\circ\), \(102^\circ\) or \(108^\circ\) for civil, nautical and astronomical twilight.

Why do my results differ by a minute or two from weather websites?

Small differences come from three sources: this calculator evaluates the Sun's position once per day (at UTC noon), while some services recompute continuously; rounding to the nearest minute can shift a value either way; and local conditions — elevation above sea level, air temperature and pressure — change refraction by seconds to a minute. Differences of 1–2 minutes between reputable sources are normal and rarely matter for everyday planning.

How do I adjust the times for daylight saving time (DST)?

Add 1 hour to every displayed time if DST is in effect on your chosen date — the calculator does not apply it automatically. For example, sunrise 06:12 standard time becomes 07:12 in summer. Remember that DST rules differ by country and have changed historically: check whether the date falls inside the DST period for your specific location, and note that in the southern hemisphere DST runs through the December solstice, not the June one.

Leave a Reply

Your email address will not be published. Required fields are marked *