eli5: How do you tell a computer what time it is? You can tell a mechanical clock to tick every second using physics but how do you do the same to a non-moving electronic device?

1.13K views

eli5: How do you tell a computer what time it is? You can tell a mechanical clock to tick every second using physics but how do you do the same to a non-moving electronic device?

In: Technology

5 Answers

Anonymous 0 Comments

Well. The computer has an internal clock. With a small battery attached to it. That helps not just with keeping time, but also keeping track of basic settings like how many hard drives are installed and stuff like that.

But if the battery runs out, the computer will naturally fail to keep time.

And if you tell the computer that “nuhuh, actually. It’s not 2020-02-16 today, it’s actually 1994-02-07” it is going to believe you and go with that.

But that is for obvious reasons not really the most convenient way to do it. Because poor timekeeping is one of the main reasons that you don’t find your files when you look for them. And it makes any security audit near-useless, or at least excessively time consuming.

So, to work around that, all reasonably modern operating systems that has popped up in the era where most computers are assumed to have permanent internet access, nearly all operating systems have functionality where they at regular intervals contact a network time server and asks for the correct time.

NTP (the Network Time Protocol) does a lot of fiddly and neat things to take connection latency into account to get a time that is as accurate as possible. But it sort of comes with the concept that even if the computer clock runs two seconds late, it’s an extreme improvement to not really being sure what decade it is.

You are viewing 1 out of 5 answers, click here to view all answers.