· · Updated

NTP: How Your Phone Knows the Exact Time

NTP: How Your Phone Knows the Exact Time
Written and fact-checked by Yasir HafeezFigures verified against published astronomical and calendar sources · Last reviewed 2026-07
Quick answer

This guide explains ntp in plain language, with the exact figures and how to work them out yourself.

Live figures — calculated as this page loaded
Today
Sunday, 1 November 2026 · ISO week 44 · day 305 of the year

Computed on every visit from the time-zone database and standard astronomical formulas, so these never go stale. The article below is unchanged.

Every time your phone shows the correct time, you’re seeing the Network Time Protocol at work. NTP, designed by David Mills in the 1980s and still running the world’s clocks today, is one of the oldest internet protocols in continuous use. Its job sounds simple — copy the right time from a server to your device — but doing it accurately across a network where messages take unpredictable milliseconds to travel is a genuine engineering feat.

Modern mobile operating systems like iOS and Android, along with desktop platforms and cloud servers, rely on NTP to keep internal system clocks synchronized within a few milliseconds of Coordinated Universal Time (UTC). Without this continuous background synchronization, internal clock drift caused by temperature variations in quartz crystal oscillators would accumulate to several seconds of error every week.

How NTP Cancels Network Delay: The Math and Worked Example

The core challenge of synchronizing clocks across the internet is network latency. If a server sends a message saying “it is exactly 12:00:00.000”, that message might take 15 milliseconds or 80 milliseconds to arrive over Wi-Fi or cellular networks. If your device sets its clock to 12:00:00.000 upon receiving the packet, its clock is already late by the exact duration the packet spent traveling across the wire.

NTP solves this by exchanging four precise timestamps between the client device and the time server across UDP port 123. The exchange records four specific moments in time:

From these four timestamps, NTP derives two crucial operational figures: the total round-trip network delay (δ) and the precise clock offset between the client and server (θ).

The round-trip delay equation subtracts server processing time from total client elapsed time:

Round-trip delay (δ) = (T4 – T1) – (T3 – T2)

Assuming that transit time to the server equals transit time back to the client, the offset between the two clocks is calculated as:

Clock offset (θ) = ((T2 – T1) + (T3 – T4)) / 2

Step-by-Step Numerical Example

Consider a practical synchronization attempt between a mobile phone and a public time server:

  1. T1 (Client departure): 10:00:00.000 (10,000.000 s)
  2. T2 (Server arrival): 10:00:00.020 (10,000.020 s)
  3. T3 (Server departure): 10:00:00.022 (10,000.022 s)
  4. T4 (Client arrival): 10:00:00.050 (10,000.050 s)

Applying the offset and delay formulas yields:

The result proves the client clock is ahead of true server time by 4 milliseconds. The client operating system adjusts its internal clock back by 4 milliseconds to bring it into alignment.

The Hierarchy of Time: Understanding Strata Layers

NTP organizes the world’s time servers into layers called strata. Stratum 0 is the reference hardware itself — atomic clocks (cesium or rubidium standards) and GPS receivers. Stratum 1 servers connect directly to those references; stratum 2 servers sync to stratum 1, and so on down the pyramid. Your phone typically talks to a pool of public servers a few strata down, each ultimately anchored to national atomic time.

A station clock hanging from a metallic ceiling
Stratum Level Hardware Source / Reference Type Typical Accuracy Primary Function
Stratum 0 Cesium/Rubidium atomic clocks, GPS receivers Nanoseconds to UTC Physical precision timekeeping (not network-connected directly).
Stratum 1 Primary time servers attached directly to Stratum 0 hardware Sub-millisecond Serves Stratum 2 servers over dedicated network backbones.
Stratum 2 Secondary time servers synced over IP networks to Stratum 1 1–10 milliseconds Feeds regional public server pools and enterprise networks.
Stratum 3 Tertiary servers, corporate routers, domain controllers 10–50 milliseconds Distributes synchronized time to local desktops and mobile devices.
Stratum 16 Unsynchronized end devices Unspecified / Invalid Indicates the device clock is disconnected or untrusted.

Clock Adjustment: Slewing vs. Stepping

Rather than jumping a wrong clock abruptly — which can confuse running software — NTP usually “slews” it, speeding or slowing the clock imperceptibly until it aligns. This gentleness matters: databases, backups, and security certificates all misbehave when time leaps backward.

High Stakes: Security, Commerce, and Systems

The stakes are higher than convenience. Financial regulations require trades to be timestamped within fractions of a second; TLS certificates that secure websites are validity-checked against the clock, so a badly wrong device can’t load secure pages; distributed systems order events by time. When NTP fails, login errors and mysterious outages follow within hours.

The system’s scale is astonishing: billions of devices, syncing continuously, coordinated by volunteer server pools and national labs, invisible to nearly everyone. The clocks at itsdately.com simply display what NTP has already delivered to your device — the quiet consensus of the world’s atomic timekeepers.

NTP vs. PTP: When Milliseconds Aren’t Enough

Where milliseconds aren’t good enough, industry reaches for NTP’s stricter sibling, the Precision Time Protocol (PTP, defined by IEEE 1588), which uses hardware timestamping in network cards to synchronize machines within microseconds or better — the standard in trading data centers, power-grid substations, and broadcast studios.

A vintage analog alarm clock on a wooden surface

While NTP performs timestamping at the operating system kernel level, PTP records packet entry and exit directly at the physical network interface card (NIC). This eliminates variable delays introduced by CPU scheduling and operating system packet queues, achieving microsecond accuracy across local industrial Ethernet networks.

Handling Leap Seconds and Smearing

And when leap seconds arrive, large operators protect their systems by “smearing”: instead of inserting a 61st second, servers stretch every second slightly across the surrounding hours, so software never witnesses the impossible time 23:59:60 at all.

Standard NTP handles leap seconds by adding a 61st second (23:59:60) at midnight UTC on June 30 or December 31. Because unpatched server kernels and database software often crash when encountering this extra second, time servers maintained by major platforms spread the extra second evenly across an 18 to 24-hour window, preserving clock stability without disrupting running software.

Algorithmic Filtering: Rejecting Falsetickers

The protocol’s resilience comes from designed distrust. NTP clients treat every server as potentially wrong, comparing several, weighting by measured stability, and flagging “falsetickers” whose answers disagree with the majority — democracy applied to clocks.

An oval analog wall clock on a wooden wall

An NTP client runs three distinct filtering algorithms on collected peer responses:

  1. Filter Algorithm: Selects the best samples from a single time server over time, discarding high-jitter packet responses.
  2. Intersection Algorithm: Groups server responses into candidate intervals to isolate and disqualify “falsetickers” (servers producing erroneous time spikes).
  3. Clustering Algorithm: Sorts remaining “truechimers” to produce a combined weighted average, minimizing residual clock offset.

The public NTP pool, a volunteer federation of thousands of servers, absorbs billions of requests daily from devices whose owners will never know it exists. Its greatest achievement is the absence anyone would notice: a planet of clocks that simply agree, morning after morning, without a single person setting one.

Common Time Sync Failures and Practical Fixes

When devices fail to maintain accurate time synchronization, troubleshooting usually reveals network or firewall obstacles:

1. UDP Port 123 Blocked by Network Firewalls

Problem: Corporate firewalls or cloud security groups often block UDP traffic on port 123, stopping NTP request and response packets from reaching public servers.

Fix: Create inbound and outbound UDP port 123 rules in server firewall configurations, or point local endpoints to an internal Stratum 2 router or domain controller.

2. Network Route Asymmetry

Problem: NTP math assumes that packet transit time to the server equals return time to the client. If asymmetrical routing causes outbound travel to take 10 ms while inbound transit takes 40 ms, NTP computes a systematic offset error.

Fix: Synchronize devices against local Stratum 1 or Stratum 2 servers located inside the same subnet or local network facility to minimize path asymmetry.

3. Mobile Battery Saver Restrictions

Problem: Smartphones suspended in low-power modes may pause background NTP sync routines, leading to time drift over extended offline periods.

Fix: Mobile phones supplement NTP with Network Information Time Zone (NITZ) signals broadcast directly by cellular towers. Toggling automatic time off and back on in settings triggers an immediate re-sync across cellular or Wi-Fi connections.

Who This Advice Does and Does Not Suit

Frequently asked questions

What is NTP and why does my phone use it?

NTP (Network Time Protocol) is a network protocol that synchronizes system clocks across devices. Mobile phones use NTP to continuously correct quartz oscillator drift, maintaining accurate time display, valid web security certificates, and correct log ordering.

How accurate is NTP on ordinary Wi-Fi?

On typical Wi-Fi or cellular connections, NTP keeps device clocks accurate within 5 to 20 milliseconds of true atomic standard time. On stable wired local networks, NTP can achieve sub-millisecond precision.

What is the difference between NTP and PTP?

NTP uses software timestamping at the operating system level, providing millisecond-level synchronization suitable for general internet devices. Precision Time Protocol (PTP / IEEE 1588) relies on hardware timestamping inside network interface cards, achieving microsecond or nanosecond accuracy for industrial and trading systems.

Why is UDP port 123 critical for time synchronization?

NTP relies specifically on UDP port 123 to send and receive four-timestamp sync packets. If network firewalls block UDP port 123, devices cannot calculate clock offset or delay, causing synchronization to fail.

What is leap second smearing?

Leap second smearing is a technique where time servers stretch or compress seconds by small fractions over several hours during a leap second event. This avoids inserting an awkward 23:59:60 timestamp, preventing software crashes and database errors.


Related on itsdately: How Atomic Clocks Work: The Machines That Define the Second · Why GPS Would Fail Without Einstein: Relativity in Your Pocket · What Is a Leap Second — and Why It’s Being Retired

Further reading: The NTP Project.

🕰 Quick time & date converter
← Back to the live clocks, calendars & calculators