How we calculate

Last updated 11 November 2026

Everything on this site is calculated in your browser, from public data and published formulas. Here is exactly what we use, and where the limits are.

Current time and time zones

Your device keeps the current moment (in UTC). To turn that into a local time, we ask your browser to format it for a named time zone such as Asia/Seoul or America/New_York, using the standard Intl.DateTimeFormat interface. Browsers ship the IANA time zone database — the same source used by phones, operating systems and servers — which records every country’s offset from UTC and every daylight saving rule, past and planned.

Because the rules live in your browser, updates arrive with browser updates, and nothing about you (not even your time zone) is sent to us.

Limit: the clocks can only be as accurate as your device’s clock. Most devices sync automatically to within a fraction of a second; if yours is set manually it may be off.

Daylight saving time

To find the next clock change for a city, we step through the calendar one day at a time and ask for the city’s UTC offset each day. When the offset changes, we narrow it down to the exact minute. We do this for the current year and the next two, which is how city pages can say “clocks go back 1 hour at 02:00 on Sunday, 1 November”. To detect places that used to change their clocks but stopped (Russia in 2011, Turkey in 2016, Brazil in 2019, Mexico in 2022…), we scan back to the year 2000.

The daylight saving page does the same live in your browser: it looks 400 days ahead and behind for the city you pick and for two dozen major time zones, and sorts the next changes by date. The US–Europe “gap weeks” are the periods when the New York–London difference is not its usual value, found by comparing both cities’ offsets between their clock changes.

Sunrise, sunset and day length

We use the sunrise equation from the NOAA Solar Calculator family of formulas: the sun’s mean anomaly, equation of centre, ecliptic longitude and declination give the time of solar noon and the hour angle at which the sun’s centre is 0.833° below the horizon (this allows for the sun’s radius and atmospheric refraction). Civil dawn and dusk use 6° below the horizon.

On the sunrise and sunset calculator, the same equation with other heights gives the light photographers care about. Golden hour is when the sun is between 4° below and 6° above the horizon; blue hour is between 6° and 4° below. There is no single official definition of either — these are common ones, and we use them everywhere on the site. Where the sun never reaches one of those heights on a given day (high latitudes in summer or winter), the calculator says so — for example, a golden hour that runs through the night.

  • Results are for the city centre at sea level, and are accurate to about a minute. Mountains, tall buildings and unusual weather can shift what you actually see.
  • Near the poles the sun may not set or rise at all; pages say so rather than show a time.

Equinoxes and solstices

The solstices and equinoxes page finds each event with the method in chapter 27 of Jean Meeus’s Astronomical Algorithms: a polynomial for the mean instant, corrected by 24 periodic terms for the Moon and planets. That gives Terrestrial Time; we subtract ΔT (about a minute, from the Espenak–Meeus approximation published with NASA’s eclipse tables) to get UTC, and your browser shows it in the chosen city’s time zone. Our tests compare the results with the US Naval Observatory’s published times and require agreement within two minutes. The point where the sun is overhead at that moment uses the sun’s right ascension (exactly 0h, 6h, 12h or 18h at these events) and Greenwich sidereal time. Day length on the day is the sunrise-to-sunset time described above.

Moon phases, moonrise and moonset

The moon phase page finds new moons, first quarters, full moons and last quarters with chapter 49 of Meeus’s Astronomical Algorithms: the mean time of each phase plus periodic corrections for the sun’s and moon’s positions and fourteen planetary terms, converted from Terrestrial Time to UTC with the same ΔT as above. Our tests check the results against NASA and US Naval Observatory times and require agreement within two minutes; in practice they agree to the minute. The moon’s position at any moment uses the truncated ELP-2000/82 series in Meeus’s chapter 47 (about 120 terms), and the sun’s position the low-precision formulas of chapter 25. The illuminated fraction is (1 + cos i) ÷ 2, where i is the phase angle found from the sun–moon elongation and their distances (chapter 48). The moon’s age is the time since the previous new moon.

Moonrise and moonset are the moments when the moon’s geocentric altitude equals 0.7275 × its horizontal parallax − 0.5667°, the standard value that allows for the moon’s radius, its parallax and 34′ of atmospheric refraction (Meeus, chapter 15). We sample each local day every ten minutes and refine every crossing to the second. Results are for the city centre at sea level with a flat horizon and are usually within two minutes of almanac values. The “moonless dark sky” figure samples the night every five minutes and counts the time when the sun is more than 18° below the horizon and the moon is down, so its edges are accurate to about five minutes. The drawing shows the lit fraction on the correct side for the city’s hemisphere; it does not show the moon’s exact tilt at a particular hour.

Day and night on the globe

The globe marks the subsolar point — the place where the sun is directly overhead right now — from the sun’s declination (its latitude, between 23.44° N and 23.44° S through the year) and the equation of time. Each land dot is coloured by the sun’s altitude there: above the horizon is day, down to 6° below is twilight, lower is night. The land outline is Natural Earth data at 1:50m scale via world-atlas, sampled into 5,789 evenly spaced points.

Jet lag plans

The jet lag planner takes the UTC offset of the departure city at take-off and of the destination at landing, so daylight saving time on the travel date is included. The difference is folded into the range −12 to +12 hours (an exact 12 counts as later), because the body clock moves the short way: Los Angeles to Auckland is +20 hours on the clock but 4 hours later for your body. Positive means advancing (earlier sleep, as after flying east), negative means delaying.

Before the flight, sleep moves by one hour a day for up to three days; after landing, the remaining gap shrinks by 1 hour a day when advancing and 1.5 hours a day when delaying — the average rates given in the CDC Yellow Book. For light, we estimate the body clock’s daily low point as three hours before your usual wake time plus the hours your body is still behind (or minus the hours it is ahead). When advancing, the four hours after that point are the bright-light window and the four hours before it the dim window; when delaying, the other way round. Both are trimmed to your waking hours, with a plain morning or evening window when the calculated one falls entirely in your sleep. Sunrise and sunset come from the formulas above. Flight time defaults to the great-circle distance at 800 km/h plus 40 minutes. This is a simple model of published guidance, not a personal or medical prediction.

Distances and travel times

Distances are great-circle distances between city centres, calculated with the haversine formula and the Earth’s mean radius of 6,371 km. Travel times divide that distance by a constant speed:

  • Walking: 5 km/h
  • Running: 10 km/h
  • Cycling: 18 km/h
  • Driving: 90 km/h
  • Container ship: 37 km/h
  • Airliner: 870 km/h
  • Orbital rocket: 28,000 km/h
  • Speed of light: 299,792 km per second

These are thought experiments — no stops, no roads, no sea lanes — so real journeys take longer.

Cities

The 150 cities are capitals and large cities chosen so that every widely used clock is represented, including half-hour and quarter-hour zones. Names, coordinates, populations and time zones come from GeoNames, licensed under CC BY 4.0. Population is for the city proper as recorded by GeoNames, not the wider metropolitan area.

Local time notes on city pages

The pages for 27 major business cities carry a short list of local time notes: market hours, the working week, holidays that close offices, and the history of the city’s clock. Each note names its source. Notes marked as calculated by us come from the same time zone database and solar formulas as the rest of the site — for example the years a city used daylight saving time, or the office hours it shares with London, New York or Tokyo — and we re-check them against the database with automated tests. The other city pages keep the live clock and calculated tables only.

Stopwatch

The stopwatch reads performance.now(), the browser’s monotonic clock, when you press Start, Lap or Stop, and the elapsed time is always the difference between two readings. It does not count timer ticks, so it stays correct when a background tab is slowed down, and it is not moved by daylight saving time or by your device correcting its clock. Times are shown truncated, not rounded, to the hundredth: 59.996 seconds reads 00:59.99. The clock time of each press comes from your device’s ordinary clock and is written in the chosen time zone with its UTC offset (ISO 8601). After a reload the page cannot read the previous page’s monotonic clock, so it adds the change in the ordinary clock since the last save, and never a negative amount. Consistency is the population standard deviation of the lap times; “vs average” is each lap minus their mean.

Countdown timer

The countdown timer works like the stopwatch in reverse: time left is the length you set minus the difference between two readings of performance.now(), so a slowed background tab or a corrected device clock does not change it. The display rounds the time left up to the whole second, so it reads 00:00 exactly when the time is up, and after that it counts the overtime. When you press Start, the finishing sound is scheduled on the Web Audio clock for the exact end time, which keeps running when the browser throttles a tab’s timers. For a countdown to a date, the local date and time you enter in a city is turned into a single instant with the IANA time zone database. A time skipped when clocks go forward is moved later by the size of the jump; a time that happens twice when clocks go back resolves to the first occurrence unless you choose the second. “Real time left” is the difference between that instant and now; the calendar figure is the same span measured on the city’s wall clock, and the two differ by the net daylight saving change in between. Calendar days count the city’s midnights. Sunrise and sunset targets use the same NOAA-based formula as the sunrise calculator, rounded up to the minute.

Pomodoro timer

The Pomodoro timer times each phase exactly like the countdown timer, on performance.now(). Phases are numbered in order — focus, break, focus, break — and the break after every nth focus block is the long one. With auto-advance on, each new phase starts at the instant the previous one reached zero, so if a background tab wakes up late the page replays every phase change it missed rather than starting the next phase late. The plan adds the time left in the current phase to the full lengths of the phases after it; a focus block fits when it ends at or before your stop, and breaks after the last fitting block are left out. Auto-advance stops instead of starting a focus block that would end after the stop, and after a focus block it also checks the following break. A clock-time stop is the next time your device’s clock shows that time, using the IANA time zone database; a sunset stop is the next sunset in the chosen city from the same NOAA-based formula as the sunrise calculator. A focus block is logged only when its timer reaches zero, under the calendar day of your device’s time zone, and the log stays in local storage for 35 days.

Alarm clock

The alarm clock works out each alarm’s next ring from your device clock, once a second. For a clock-time alarm it takes the alarm’s time on each upcoming date in the alarm’s time zone — your device’s zone for “My clock”, or the chosen city’s — and turns that wall-clock time into a single instant with the IANA time zone database, keeping the first instant after now that falls on a selected weekday. Weekdays are counted in the alarm’s own time zone. A time skipped when clocks go forward rings at the instant of the jump; a time repeated when clocks go back rings once, at its first occurrence. Sunrise and sunset alarms use the same NOAA-based formula as the sunrise calculator for the city’s coordinates, rounded to the nearest minute, plus your offset; on days with no sunrise or sunset there is no ring. Once sound is allowed, every ring due within 24 hours is scheduled on the Web Audio clock, and rescheduled if that clock drifts from the device clock by more than a second (for example after sleep). A ring the page only notices more than five minutes late, because the tab was closed or the device asleep, is reported as missed instead of played.

Working hours and meeting times

Unless you change them, “working hours” mean 9:00 to 18:00 local time. An hour counts as a good meeting hour when every city is inside its window for the whole hour, including cities on half-hour offsets.

Found a problem?

Please tell us the city, the time you saw and the time you expected. We check reports against the IANA database and fix our side quickly.