Some machines have a tiny clock inside. 

Many machines have a tiny clock inside. 

A real-time clock, or RTC, is a special tool. 
An RTC is helpful for many reasons. It keeps the time even if the power goes out. It can do this if it has a backup power source. 
Most RTCs use a crystal oscillator to count time. 
Some machines do not have an RTC. A maker might leave it out to save money. Other machines get the time from the internet. They can also get time from radio signals or GPS. This keeps the clock very accurate.
A real-time clock, or RTC, is a special electronic device. It measures the passage of time in human units like hours and minutes. 

Using an RTC has many helpful benefits for a machine. It reliably keeps the time even during disruptive events. This includes when a system hangs, reboots, or goes into sleep mode. 
Most RTCs work using a crystal oscillator to keep time. This is a tiny part that vibrates at a very steady rate. The frequency is usually 32,768 Hz, which is the same used in quartz watches. This specific number is helpful because it is exactly 2 to the 15th power. This makes it easy for simple circuits to count the vibrations. The low frequency helps save power while staying quiet. Most of these crystals do not change size much when they get warm or cold. This helps the clock stay accurate even as the temperature changes. Some newer chips use tiny resonators built right onto the silicon. These are smaller and cheaper but can be more sensitive to heat.
History shows how these tools have changed over many years. The IBM PC/AT introduced the RTC to compatible computers in 1984. That specific machine used a Motorola MC146818 chip. Later, Dallas Semiconductor made compatible versions that people still find on older motherboards today. 
Today, we see RTCs working in many ways that connect to our world. Some modern computers do not rely only on a tiny crystal. They can receive time information through digital radio or the internet. For example, cell phone networks like LTE provide the current local time. Computers can also use the Network Time Protocol to get time from the web. Some special computers use GPS signals to stay perfectly on track. Even if a computer lacks a hardware RTC, programmers can use math to create a software version. This uses the computer's own timers to mimic a real clock. It is amazing how much work goes into making sure we always know the time.
A real-time clock, or RTC, is a specialized electronic device used to measure time in human units. Most often, these devices take the form of an integrated circuit, which is a tiny chip that holds many electronic parts. While many people associate RTCs with personal computers or servers, they are actually present in almost any electronic device that must maintain an accurate time of day. It is important to distinguish an RTC from ordinary hardware clocks. Standard hardware clocks only provide timing signals to govern digital electronics. They do not count time in units like minutes or hours. An RTC, however, provides a continuous and reliable record of time. 
Using an RTC offers several technical advantages for a computer system. One primary benefit is reliability during disruptive system states. An RTC can maintain the current time during system hangs, reboots, or sleep modes. If the device is provided with sufficient backup power, the RTC can even keep time during a full hardware shutdown. This prevents the need for a user to reset the time every time the machine starts. RTCs are also designed for low power consumption. This makes them ideal for running on alternate power sources. Additionally, having a dedicated RTC frees up the main system processor to focus on time-critical tasks. 
To keep time, most RTCs rely on a crystal oscillator. This component vibrates at a very specific and steady frequency. The most common frequency used is 32.768 kHz, which is the same rate used in quartz watches. This number is chosen because it is exactly 2 to the 15th power. This mathematical property makes it very convenient for simple binary counter circuits to process. The low frequency is efficient because it saves power while remaining above the range of human hearing. Most quartz crystals are used because their size does not change much with temperature. This stability ensures the frequency remains consistent. Some modern RTCs use a micromechanical resonator, or MEMS, built directly onto the silicon chip. While MEMS reduce cost and size, they are more sensitive to temperature changes. 
Accuracy is a key specification for these devices. Typical crystal RTCs have an accuracy of ±100 to ±20 parts per million. In practical terms, this means they might gain or lose between 1.7 and 8.6 seconds per day. For even higher precision, temperature-compensated RTC ICs are available. These can be accurate to less than 5 parts per million, which is precise enough for celestial navigation. In 2011, a new level of precision arrived with chip-scale atomic clocks. These are much more expensive and power-hungry than standard crystals. While a standard RTC uses less than 1 microwatt of power, an atomic clock uses about 120 milliwatts. However, they are incredibly stable, keeping time within 50 parts per trillion.
The history of the RTC is closely tied to the evolution of the personal computer. The IBM PC/AT introduced the RTC to compatible computers in 1984. This specific model used a Motorola MC146818 RTC chip. Later, Dallas Semiconductor produced compatible versions that became very common. You can still find these on older motherboards today. They are easily identified by their distinctive black battery caps and silkscreened logos. 
Some systems do not use a dedicated hardware chip at all. Instead, they use software-based RTCs. This is common in embedded systems that lack a built-in clock. Programmers can use the computer's existing hardware timers to mimic an RTC. These timers use quartz crystals to produce periodic interrupts, such as 50 Hz. Because these hardware timers can be slightly inaccurate, the software must perform complex math to adjust the time. The software tracks the rate of the clock and makes tiny adjustments, known as jitter, to maintain accuracy. This can involve using mathematical models like polynomials to compensate for temperature changes. For example, a 3rd-degree polynomial can characterize the rate changes in SC-cut crystals.
Finally, RTCs are part of a much larger global system for timekeeping. Many modern devices stay accurate by receiving time from external sources. For instance, cell phone protocols like LTE provide the current local time directly. Computers can also use the Network Time Protocol to sync with the internet. Some high-level local time servers use GPS or ultra-low frequency radio transmissions from national standards organizations. This connectivity ensures that even if a local clock drifts, the device can quickly return to the correct global time.
🖼️ Images & Media (4)
More to explore
✨ What else?
Related topics you might enjoy
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.