
How Does My Computer Keep Time When It's Turned Off?
Or: your computer has been counting while you were gone. A tiny battery, a drifting clock, and a connection to atomic physics — all so your taskbar says the right thing.
Or: Your Computer Has Been Counting While You Were Gone
Shut down your computer tonight. Unplug it from the wall. Leave it all weekend. Plug it back in Monday morning and turn it on — and it knows what time it is. Not approximately. Usually the correct time within seconds.
That's a little strange. The computer was off. Windows wasn't running. The processor wasn't doing anything. So who was keeping track of the weekend?
The Real-Time Clock
Inside your computer is a small piece of hardware called the Real-Time Clock, or RTC. Its job is narrow: count seconds. It doesn't run your processor, light up RGB strips, or keep RAM alive. It just tracks the passage of time while the rest of the machine is off.
When you turn the computer back on, the operating system reads the current time from the RTC instead of starting fresh from some arbitrary default. Without it, every boot would begin with the computer confidently declaring it's January 1, 1970.
But if the computer is unplugged, the RTC needs its own power source.
The Coin-Cell Battery
Look at a desktop motherboard and you'll find a small silver coin cell — typically a CR2032. That battery provides the tiny amount of power the RTC needs to keep running while the rest of the machine has no power at all. A coin-cell battery can keep the relevant circuitry running for years because the RTC consumes almost nothing compared to the rest of the system.
PC users have long called this the CMOS battery. The name comes from older architecture where battery-backed CMOS memory stored both BIOS configuration and the clock. Modern computers store firmware settings in non-volatile flash memory that doesn't need continuous power — but the old name stuck, and you'll still hear "your CMOS battery is dead" when people mean that coin cell on the motherboard.
When the battery finally dies, the clock loses track of time whenever normal power is removed. The computer may reset to some default date (often 1980 or 2000, depending on the system) every time it's unplugged or loses power. That's the telltale sign. Desktop computers that stay plugged in can go years before the dead battery is discovered — because the motherboard still receives standby power from the power supply even when the PC appears off.
Why the Wrong Time Causes Bigger Problems Than You'd Expect
A computer that thinks it's 2018 when it's actually 2026 isn't just displaying the wrong time. Modern secure connections rely on digital certificates that are only valid during specific date ranges. A computer with the wrong date may conclude that perfectly valid certificates have expired or haven't become valid yet — and refuse to connect to websites securely. Authentication systems fail. Application licensing can break. Log files get nonsense timestamps that make troubleshooting nearly impossible.
Time isn't just what's displayed in the corner of the screen. It's part of how computers determine whether events and credentials make sense.
Clock Drift: Why Hardware Alone Isn't Enough
Even when the battery is healthy and the RTC is running, it isn't perfectly accurate. Electronic clocks rely on oscillators — components that produce regular cycles that get counted to measure time. But oscillators aren't absolutely precise. Manufacturing tolerances, temperature variations, and aging introduce tiny inaccuracies.
Maybe the clock gains a fraction of a second per day. Maybe it loses one. Not much individually, but these errors accumulate. After a month, a clock losing a second per day is half a minute behind. After a year, several minutes. This gradual wandering is called clock drift.
For a world where computers constantly coordinate events across networks — sometimes down to the millisecond — relying entirely on a hardware oscillator isn't good enough. So computers periodically ask something with a much better clock.
Network Time Protocol
Modern operating systems can synchronize their clocks with time servers using the Network Time Protocol (NTP). The computer asks "what time is it?" and a time server responds. The system compares the answer to its own clock, accounts for the round-trip travel time of the request, and adjusts accordingly.
Your computer and the hardware clock work together: the RTC maintains time while the machine is off and gives the OS a reasonable starting point on boot. NTP then corrects accumulated drift whenever the computer is online. The hardware clock handles everyday timekeeping; the network keeps it honest.
Those time servers don't make up their own time, either. NTP infrastructure traces its accuracy back to atomic clocks — instruments that use the extremely consistent behavior of atomic transitions as a frequency reference. Your laptop isn't directly contacting an atomic clock, but the time servers it queries ultimately derive their precision from systems vastly more accurate than any consumer oscillator. The time in your taskbar is connected, through a chain of servers, to some serious physics.
UTC, Time Zones, and the Political Mess of Local Time
There's a distinction computers have to navigate carefully: the current moment, and how humans choose to label that moment.
When it's noon in New York, someone in Los Angeles sees 9:00 AM. They're experiencing the same instant, described differently. Computing systems handle this by working internally in UTC — Coordinated Universal Time — a universal reference point, and then converting to the appropriate local time for display. A server records that an event occurred at a specific UTC time; your device converts that to your local time zone.
Time zones themselves are messier than they look. They're not mathematical slices of the globe — they're political decisions. Countries change their time zones. Regions adopt or abandon daylight saving time. The dates of clock changes can be altered by law. Operating systems maintain databases of time zone rules that get updated when governments change those rules. Even time zones get software patches.
This is one reason letting your computer set the time and time zone automatically is considerably easier than doing it manually. You're delegating an surprisingly complex bookkeeping problem to the machine.
When Servers Take Time Seriously
For most people, being a few seconds off is irrelevant. For servers, it matters more. Imagine a company with hundreds of servers trying to reconstruct the sequence of events after something goes wrong. If Server A thinks an event happened at 10:01:03, Server B at 10:00:47, and Server C at 10:01:19, reconstructing what actually happened in what order becomes a genuine challenge.
Financial trading systems, telecommunications networks, distributed databases, and security systems can all depend on precise shared time. The more distributed technology becomes, the more important it is for the machines involved to agree on when things happened.
The Bard's Take
The clock in the corner of your screen looks like one of the simplest things your computer does. Except it has to maintain time while the machine is off using a tiny battery powering a circuit that draws almost nothing. That clock gradually drifts because real oscillators aren't perfect, so the OS periodically synchronizes with time servers that trace their accuracy back to atomic clocks. Then it converts from a universal reference into the particular human mess of local time zones, daylight saving rules, and governments occasionally deciding the clocks should work differently.
All so you can glance at the bottom-right corner of your screen and think: crap, I'm late.
The coin-cell battery on your motherboard has been quietly doing its job the whole time you weren't watching. Most people never think about it until the day the computer boots up insisting it's 2004.
That's the sign.
Sources
- Why Do PCs Still Require a CMOS Battery? — How-To Geek
- Network Time Protocol — Wikipedia — Wikipedia
- How to Calibrate the System Clock Using NTP — NTP Support Wiki
- NIST Internet Time Service — NIST