Search code examples
architectureoperating-systemsystem

How does an operating system know the time without an internet connection?


Specifically, how does an operating system know the time (yes, actual time from any time zone) without any knowledge from the internet and only prior knowledge of the last time recorded when the machine was actually turned on. Example: I boot the machine for the first time and set the time to 2 pm CST, then proceed to shut the machine down completely. When I boot the machine back up 2 hours later, how does it know that it is now 4 pm CST?


Solution

  • The time is maintained by a chip called RTC(Real Time Clock). To power the chip the motherboard has a battery known as CMOS battery which keeps it running when the system is powered off. ... The computer keeps track of time (even when the power is off) with a very low-power clock that runs off battery.

    Credit: https://www.quora.com/How-do-computers-keep-time