Turn a computer off overnight and its clock is usually correct when you start it the next morning. It can even remember the date after spending much longer disconnected from normal power. That may seem surprising because the operating system was not running to count the passing seconds.

The computer does not rely on the operating system for this job. It has a small hardware clock that can continue keeping time while most of the machine is off. After startup, the operating system reads that clock and can later compare its time with a trusted source over the internet.

This separation between keeping time while powered off and correcting time while online explains both why computer clocks normally work so quietly and why they can occasionally become wrong.

A computer has more than one sense of time

While a computer is running, the operating system maintains the time that applications see. It needs this for ordinary tasks such as displaying the clock, timestamping files, arranging calendar events, and recording when something happened.

But software running on the main processor cannot keep doing that after the computer has shut down. Most of the system is no longer operating.

To bridge that gap, computers use a real-time clock, often shortened to RTC. This is a low-power hardware clock designed to keep track of calendar time independently of the main operating system.

A useful mental model is to think of the operating system as taking over a clock at startup. The hardware clock has kept a basic record of time while the machine was off. The operating system reads that record, starts maintaining its own working system time, and may then correct it using other sources.

The analogy is not exact: modern operating systems and hardware handle time through several clocks and timers for different purposes. The important distinction is that the calendar time shown to you does not depend on an application continuously running while the computer is off.

The real-time clock uses very little power

An RTC is designed to operate with a tiny amount of electrical power. On many desktop computers, a small coin-cell battery on the motherboard provides backup power for the clock and for some firmware settings when the machine is unplugged.

Laptops and other compact devices can arrange backup power differently. Their clock circuitry may use the device’s main battery, a separate backup source, or another hardware design. The exact implementation depends on the device, so a visible coin-cell battery is not a requirement for every computer to remember time.

This low-power arrangement matters because the RTC has a narrow job. It does not need to keep the display, processor, storage, Wi-Fi, or cooling system running. It only needs enough power for the small amount of circuitry involved in retaining time and related state.

That is why a desktop computer can be disconnected from the wall and still know roughly what time it is when power returns.

Startup connects the hardware clock to the operating system

When a computer starts, its firmware and operating system obtain an initial date and time from the hardware clock. The operating system can then maintain system time while the machine is running.

The hardware clock and the operating system’s time are related, but they are not simply one clock shown in two places. Operating systems use additional hardware timers and software mechanisms to measure elapsed time accurately enough for running programs. They also have rules for representing calendar time and time zones.

Those details can differ between platforms. For example, systems do not all use the same convention for what value should be stored in the hardware clock. That difference can become noticeable on a computer configured to start more than one operating system, because each system may interpret or update the hardware clock according to its own configuration.

For everyday use, however, the practical sequence is simple: the hardware clock supplies a starting point, and the running operating system manages the time you normally see.

A hardware clock is not perfectly accurate

The RTC can keep running for a long time, but that does not mean it measures each second with perfect accuracy.

Electronic clocks use an oscillator as a timing reference. Real oscillators have small errors. Their rate can also be influenced by factors such as component tolerances, temperature, aging, and circuit design. A clock that runs just slightly fast or slow accumulates that error over time. This gradual difference from correct time is called clock drift.

Imagine a clock gaining a tiny fraction of a second repeatedly. The error is barely noticeable over a short period, but the accumulated difference can eventually become seconds or more. The exact amount varies with the hardware and conditions, so there is no single drift rate that applies to every computer.

This is one reason a computer does not normally treat its RTC as an unquestionable source of perfect time.

Internet time synchronization corrects accumulated error

When a computer has network access, the operating system can compare its clock with network time sources. Most modern systems provide automatic time synchronization, although the service used and its configuration vary by platform and organization.

Network time systems ultimately rely on clocks maintained elsewhere. The computer exchanges timing information with a time service, estimates the difference between its own clock and the reference, and adjusts its system time as appropriate.

The correction is not necessarily a dramatic jump every time a tiny difference appears. Timekeeping software can make controlled adjustments so that the system remains useful for applications that care about the order and timing of events. The exact correction strategy is implementation-dependent.

This creates a useful division of labor:

  • the RTC gives the computer a reasonable time even before it has an internet connection;
  • the operating system maintains working time while the computer is running;
  • network synchronization can correct drift and other small errors when a suitable time source is available.

A computer therefore does not need continuous internet access merely to make its clock advance. Internet access mainly gives it a way to check and correct that clock.

The time zone is a separate issue

A computer can know the current moment correctly and still display the wrong local hour if its time-zone setting is wrong.

Time zones are rules for converting a common time reference into local civil time. They include offsets from Coordinated Universal Time and, in some regions, changes such as daylight-saving transitions. The operating system applies these rules when it displays local time.

This distinction helps when troubleshooting. If a clock is consistently wrong by a whole number of hours, especially after travel or an operating-system change, the problem may be the selected time zone rather than the hardware clock losing time.

If the clock gradually becomes a few minutes wrong, drift or failed synchronization is a more plausible direction to investigate.

What happens when backup power is lost

A desktop motherboard’s coin-cell battery can eventually become depleted. If that battery is responsible for maintaining the RTC while external power is absent, the computer may lose reliable date and time information after being unplugged.

The symptoms depend on the hardware and firmware. A machine might start with an incorrect date, report a clock or firmware-setting problem, or forget some firmware configuration. Once the operating system gets online, automatic synchronization may correct the displayed time, which can make the underlying backup-power problem less obvious.

An incorrect clock does not prove that a backup battery has failed. Time synchronization can be disabled or unavailable, firmware settings can be wrong, operating-system configuration can be incorrect, and hardware faults are possible. The pattern matters.

If a desktop repeatedly loses its date or time specifically after being disconnected from power, checking the motherboard documentation and the condition of its RTC backup battery is a reasonable troubleshooting step. Battery type and replacement procedure vary by device, and some systems are not designed for easy user replacement.

Why correct time matters beyond the clock in the corner

The displayed clock is only the most visible use of system time. Computers also attach timestamps to files, messages, logs, backups, and many other records. Applications use time to decide when scheduled actions should happen and to put events in order.

A substantially incorrect system clock can therefore create confusing effects. Newly created files can appear to come from the past or future. Calendar reminders can occur at unexpected times. Logs from different devices can be difficult to compare.

Some internet services also depend on reasonably correct time when checking time-sensitive information. The exact tolerance and behavior depend on the service and protocol, but this is another reason operating systems normally try to keep their clocks synchronized rather than leaving them to drift indefinitely.

A practical way to diagnose a wrong computer clock

When the time is wrong, first identify how it is wrong rather than immediately changing hardware.

If the minutes are correct but the hour is consistently wrong, check the time zone and automatic time-zone behavior. Menu names differ between operating systems, so look for the system’s date and time settings rather than relying on a platform-specific path.

If the clock slowly gains or loses time while the computer remains in use, check whether automatic time synchronization is enabled and able to reach its configured time service.

If a desktop forgets the date or returns to a clearly incorrect time after it has been unplugged, investigate the RTC backup power and firmware settings. If the clock becomes correct shortly after connecting to the internet, that suggests network synchronization is repairing an inaccurate starting value rather than the hardware clock being accurate on its own.

These observations separate three different layers: hardware timekeeping, operating-system configuration, and network correction. Treating them separately usually makes the problem easier to understand.

Conclusion

A computer can keep time while turned off because a low-power real-time clock continues operating independently of the main processor and operating system. When the computer starts, that hardware clock provides an initial time. The operating system then maintains working system time and can use network time synchronization to correct drift.

The result is a system with several layers rather than one perfect clock. The RTC preserves continuity, the operating system manages time for applications, the time-zone rules determine what local time you see, and network synchronization keeps accumulated error under control. Knowing which layer does what makes an incorrect clock much easier to diagnose.