Why does a computer keep the correct time even when not connected to the internet

Why Your Computer Keeps Accurate Time Even Without Internet

First, computers don’t rely on the internet to know the time. Network Time Protocol (NTP) is merely an auxiliary channel used to reduce errors.

When offline, the system can still maintain reasonably accurate time through the hardware clock and the operating system’s timing mechanism.


Hardware Clock vs. System Clock

  • Hardware Clock (RTC/CMOS)
    • The motherboard has an independent Real-Time Clock (RTC) chip, equipped with a quartz crystal oscillator and a coin cell battery. Even when powered off, the RTC continues running and maintains the current date and time.
    • Upon booting, the operating system reads the RTC as the initial time reference. Some systems also write the system time back to the RTC during shutdown or at regular intervals.
    • If the motherboard battery runs out, the RTC may lose time, resulting in abnormal time display at startup.
  • System Clock (Kernel Clock)
    • After the system boots, the operating system maintains the current time (wall clock time) and monotonic time (used for timing/timeouts) in memory.
    • Timing relies on high-precision time sources and timers. The kernel continuously accumulates time through periodic interrupts and timestamp counters, independent of the network.
    • Due to hardware frequency variations and temperature effects, the system clock experiences minor drift, but this is typically very small.

Why Offline Doesn’t Affect Time Accuracy

  • Initial value at boot comes from the RTC
  • During operation, time is maintained by the local system timing

The Role of Network Time Synchronization

  • Not mandatory, but for calibration. NTP fine-tunes the system time to higher precision when connected to the network, compensating for drift and handling leap seconds.
  • Calibration is primarily done through gradual adjustment rather than instantaneous jumps, avoiding time rollbacks or jumps that could affect applications.

How to Keep Time Accurate Long-Term

  • Hardware Maintenance
    • Replace the motherboard coin cell battery every few years
    • Avoid extreme temperatures to reduce crystal oscillator drift
  • System Settings
    • Enable “Set time/time zone automatically”

The hardware RTC handles timekeeping when the system is off, while the operating system relies on local timing sources to keep time moving forward during runtime, ensuring reasonably accurate time in everyday scenarios. Network time synchronization is the icing on the cake, used for long-term and high-precision corrections.


Why does a computer keep the correct time even when not connected to the internet
https://en.lvlele.top/104-computer-time-accurate-no-internet/
Author
Lvlele 吕了了
Posted on
June 4, 2026
Licensed under