The sky, on time

How these times are calculated

Every time on this site comes from the same short chain: a pair of coordinates, an astronomical position formula, and the city’s own time zone. Nothing is looked up in a table and nothing is estimated beyond the tolerance stated below.

The calculation

Solar and lunar positions are computed with SunCalc, an open source JavaScript library by Vladimir Agafonkin. SunCalc implements the standard low-precision formulas for solar position and lunar position and distance, the same family of algorithms published by Jean Meeus in Astronomical Algorithms and used by the NOAA solar calculator. The library runs in your browser and on this site’s build, never against a paid data feed.

Sunrise and sunset are the moments the centre of the sun crosses an altitude of minus 0.833 degrees, which is the standard convention: it accounts for the sun’s apparent radius and for average atmospheric refraction near the horizon. The twilight bands use the conventional solar altitudes of minus 6 degrees (civil), minus 12 degrees (nautical) and minus 18 degrees (astronomical). Golden hour runs from a solar altitude of 6 degrees down to minus 0.833 degrees, blue hour from minus 0.833 down to minus 6 degrees.

Moon phase boundaries

The moon phase is a number between 0 and 1: 0 is new moon, 0.25 first quarter, 0.5 full moon, 0.75 last quarter. Naming a phase means putting boundaries on that number, and there is no single convention. This site uses narrow bands around the four principal phases, roughly one day of the 29.53-day cycle each, and wide bands for the four intermediate phases. That is why a moon that is 68 percent lit is called waning gibbous here and not last quarter: last quarter is 50 percent lit by definition.

Phase name by phase value
Phase valueName
0 to 0.0169 and 0.9831 to 1New Moon
0.0169 to 0.2331Waxing Crescent
0.2331 to 0.2669First Quarter
0.2669 to 0.4831Waxing Gibbous
0.4831 to 0.5169Full Moon
0.5169 to 0.7331Waning Gibbous
0.7331 to 0.7669Last Quarter
0.7669 to 0.9831Waning Crescent

Moon values are computed for local midnight at the start of the city’s own calendar day, so every page for the same city on the same day agrees to the percentage point.

City coordinates

The curated core of major world cities carries hand-checked centre coordinates. The rest comes from the GeoNames cities15000 dataset, licensed CC BY 4.0, filtered to places above 500,000 inhabitants. Coordinates are city-centre approximations: moving a few kilometres within a city shifts sunrise by seconds, so the approximation is well inside the stated accuracy.

How accurate are the times?

Every build of this site recomputes sunrise and sunset for 12 reference cities, from Reykjavik at 64.1° N to Buenos Aires at 34.6° S, on the four solstice and equinox dates of 2026. Each time is computed twice: once with SunCalc, the library behind every page, and once with NOAA’s published solar equations, implemented independently in this site’s own code. The two share no code, so the difference between them is a real check on the arithmetic.

Across all 96 comparisons the largest difference is 2.2 seconds (Reykjavik, sunset on 20 March) and the average is 1.0 seconds. For the cities between 60 degrees north and 60 degrees south the largest difference is 2.2 seconds. The calculation itself is therefore not where the uncertainty lies; the sky is, as the limits below explain.

Recomputed on every build, last on .

Sunrise and sunset in 2026, local time to the second: SunCalc against NOAA’s published solar equations, implemented independently. Difference is SunCalc minus NOAA in minutes; a positive value means SunCalc is later.
CityDateSunriseSunset
SunCalcNOAA equationsDifference (min)SunCalcNOAA equationsDifference (min)
Reykjavik
64.1° N
20 March07:28:3707:28:350.019:43:2819:43:260.0
21 June02:55:0902:55:080.000:04:02 next day00:04:01 next day0.0
22 September07:10:3907:10:390.019:28:3919:28:400.0
21 December11:22:2011:22:200.015:29:2415:29:240.0
Anchorage
61.2° N
20 March07:59:5507:59:530.020:15:2520:15:230.0
21 June04:20:1604:20:150.023:42:4423:42:430.0
22 September07:44:2107:44:220.019:58:3319:58:340.0
21 December10:14:2210:14:220.015:41:2415:41:240.0
London
51.5° N
20 March06:03:2406:03:220.018:13:3318:13:310.0
21 June04:43:0604:43:050.021:21:3521:21:340.0
22 September06:46:2806:46:290.018:59:0018:59:010.0
21 December08:03:4508:03:440.015:53:2515:53:250.0
New York
40.7° N
20 March06:59:1806:59:160.019:08:1319:08:110.0
21 June05:25:0205:25:010.020:30:4620:30:450.0
22 September06:43:3706:43:380.018:53:0318:53:040.0
21 December07:16:3507:16:340.016:31:4916:31:490.0
Tokyo
35.7° N
20 March05:45:4705:45:450.017:52:4417:52:420.0
21 June04:25:5004:25:490.019:00:2819:00:270.0
22 September05:28:5705:28:580.017:38:5917:39:000.0
21 December06:47:0106:47:010.016:31:3216:31:320.0
Dubai
25.2° N
20 March06:23:1106:23:090.018:30:0118:29:590.0
21 June05:29:2705:29:260.019:11:5919:11:580.0
22 September06:07:2506:07:260.018:15:3518:15:360.0
21 December06:59:4806:59:480.017:34:0117:34:010.0
Singapore
1.4° N
20 March07:09:0207:09:000.019:15:3119:15:290.0
21 June07:00:2707:00:260.019:12:3119:12:300.0
22 September06:54:1606:54:160.019:00:4819:00:490.0
21 December07:01:1407:01:140.019:04:0419:04:030.0
Quito
0.2° S
20 March06:18:0006:17:580.018:24:3118:24:290.0
21 June06:12:2306:12:220.018:19:0718:19:060.0
22 September06:03:1606:03:170.018:09:4518:09:460.0
21 December06:07:5906:07:590.018:16:0718:16:070.0
Sao Paulo
23.6° S
20 March06:10:1406:10:120.018:17:1918:17:170.0
21 June06:47:5306:47:520.017:28:5417:28:530.0
22 September05:56:0505:56:060.018:02:4018:02:410.0
21 December05:16:5505:16:550.018:52:2518:52:250.0
Sydney
33.9° S
20 March06:57:5906:57:570.019:06:5819:06:560.0
21 June06:59:5806:59:570.016:53:5016:53:490.0
22 September05:45:2005:45:210.017:51:1517:51:150.0
21 December05:40:3905:40:380.020:05:2520:05:250.0
Cape Town
33.9° S
20 March06:49:2406:49:220.018:57:3718:57:350.0
21 June07:51:2007:51:190.017:44:5517:44:540.0
22 September06:35:5806:35:590.018:42:3918:42:390.0
21 December05:31:4805:31:480.019:56:5419:56:540.0
Buenos Aires
34.6° S
20 March06:56:4506:56:430.019:04:3419:04:320.0
21 June08:00:2108:00:200.017:50:2617:50:250.0
22 September06:42:5206:42:530.018:50:0318:50:030.0
21 December05:37:1705:37:160.020:06:0520:06:050.0

Why the two can differ, and why the sky can differ from both

  • The method. Both follow the solar position series in Jean Meeus’s Astronomical Algorithms, so close agreement is expected. They part where the position is turned into a clock time: SunCalc measures the sun’s hour angle from sidereal time and its right ascension, while NOAA’s equations use a closed-form equation of time. The difference column is the size of that disagreement.
  • Refraction. Both put sunrise and sunset at the moment the centre of the sun is 0.833 degrees below a flat horizon, which assumes average atmospheric refraction. Real refraction changes with temperature and pressure, so the sun you see can appear or disappear a little earlier or later than either calculation says.
  • Height and horizon. Both assume sea level and an unobstructed horizon. An observer on a hill sees the sun earlier in the morning and later in the evening; a mountain or a building in the way does the opposite.
  • Rounding. The table shows seconds so that the differences are visible. The rest of the site shows whole minutes and drops the seconds, so a source that rounds to the nearest minute can show the same instant one minute later.
  • Latitude. Far from the equator the sun crosses the horizon at a shallow angle, so any small difference in altitude, from the method or from the air, moves the time by more. The 2 cities above 60 degrees in the table are there to show that edge honestly.

Sources for the equations: NOAA Solar Calculator and NOAA solar calculation details, both from NOAA’s Global Monitoring Laboratory. The figures in the NOAA columns are computed by this site from those published equations; they are not read from NOAA’s calculator. The SunCalc columns use the same code as every city page, and the JSON API returns those SunCalc instants in UTC for any city and date, so you can hold them against your own calculation.

Accuracy and known limits

Time zones

Every time is rendered in the city’s own IANA time zone, not yours, using the time zone database built into the runtime. Daylight saving transitions are therefore handled automatically, including the days on which a clock change makes the apparent day length jump by an hour.

Frequently asked questions

How accurate are the sunrise and sunset times?

About a minute for a flat, unobstructed horizon at sea level. Terrain, tall buildings, altitude and atmospheric conditions can shift the moment the sun is actually visible by several minutes, and that shift is larger the further you are from the equator.

Which library computes the positions?

SunCalc, an open source JavaScript library by Vladimir Agafonkin, which implements the standard low-precision solar and lunar position formulas from Astronomy Answers and Jean Meeus's Astronomical Algorithms.

Where do the city coordinates come from?

A curated core of major world cities with hand-checked coordinates, extended with the GeoNames cities15000 dataset for places above 500,000 inhabitants. Coordinates are city-centre approximations. A few kilometres of position shifts sunrise by seconds, not minutes.

Which moment of the day is the moon phase calculated for?

Local midnight at the start of the city's own calendar day, so a city page and its moon page always agree. The moon moves about twelve degrees a day, so a figure computed later that same day, such as the JSON API's figure for the moment of the request, can differ by up to about 11 percentage points of illumination, most around first and last quarter.

Do the times account for daylight saving time?

Yes. Every time is rendered in the city's IANA time zone using the browser and runtime time zone database, so summer time transitions are handled automatically.

Do these times agree with NOAA's solar equations?

Yes, to within 2.2 seconds. On every build the site computes sunrise and sunset for 12 reference cities on the solstice and equinox dates of 2026 twice: with SunCalc, and with NOAA's published solar equations, implemented independently. The largest of the 96 differences is 2.2 seconds (Reykjavik, sunset on 20 March) and the average is 1.0 seconds.

Who is responsible for this

SunAndMoon is built and maintained by FusionStudios. If a time looks wrong, tell us and we will check it: contact. The raw numbers are available without a key through the JSON API, so you can verify any figure on this site against your own calculation.