How Computers Manage to Know What Time it is at All Times

Have you ever wondered how computers can know what time it is at all times ? Even if you keep it off, the next time you turn it on it will still show the correct time, but how do they do it? In this article, we will explore how your PC always knows what time it is, and how it is capable of remembering it even when you turn it off.

Many of you may already know the answer to the second question: the motherboard has a small battery that, among other things, allows the computer to keep counting time and keeping on time. However, that stack is no longer so important in modern PCs, since PCs know what time it is in other ways, which we will tell you below.

How Computers Manage to Know What Time it is

How does your PC know what time it is?

It is likely that when you bought a computer and turned it on for the first time, it would already show you the time correctly, even if you bought it piece by piece and assembled it yourself. This is because most modern operating systems – be they Windows, Linux or Mac OS – use the Internet to synchronize with a time server , which allows the PC to always know what time it is and adjust its clock accordingly.

El PC sabe siempre qué hora es

For example, the Windows 10 clock uses the NTP Stratum 1 time server for Spain (if you live in another country, it is likely that it uses another server but since they are all synchronized with each other, it is not important). These servers use atomic cesium clocks to keep track of time, and are extremely accurate since they do not use moving parts that can become out of sync, making them the most reliable there is. As a curiosity, a unit of time is defined by 9,192,631,770 cycles of cesium , which means that these clocks use the same technology that scientists use to define a second in the first place.

In the most modern computers this goes further, and is that even the BIOS is able to connect to the Internet and synchronize the time , so it knows it even before you install the operating system.

How does the PC remember the time even when it is turned off?

This is all well and good, but let’s consider a specific scenario. Suppose you lose your internet connection, which means that your PC can no longer sync the time, so you get mad and turn off your PC. The next morning, you are still without Internet but when you turn on your PC, you check that it continues to show the time correctly; How is this possible? How can the PC still know what time it is?

This is because even without synchronization with Internet time servers, the PC is able to remember and track time on its own. In fact, you can see the ability of your PC to remember the time in the UEFI / BIOS, as this is loaded before starting the operating system.

Qué hora es en el PC

Inside all computers there is an internal clock, and even when you turn off and disconnect the PC from the mains it will still be on time. This is, as you already know, because the motherboards have a small 3V battery that powers the CMOS chip, in charge of keeping the clock on -among other things- even when the rest of the PC has no power.

These batteries have a lifespan of around 10 years (so you rarely have to change it), but they can still cause problems. If you get a “CMOS error” when starting your PC or the time is not displayed correctly, it may mean that it is running out of charge and that you will have to change it or even that the CMOS chip is damaged.

In any case, even if you did not have the battery on the motherboard (it would give you an error when starting) the PC would still know what time it is as long as you have it connected to the Internet, since it does not need it to synchronize with the Internet servers that let you know the time.