How do phones (and other devices) show the exact date and time even after being switched on after a while?

243 views

My phone was switched off since the past hour and I switched it on right now and I realised how normal it was for It to show me the exact present time and date and I wonder how.

In: Technology

Even when turned off, there is still a little bit of power being used to keep some fundamental operations of the device running, one of them being the system clock.

Turning your phone off does not cut the power to everything in your phone. Mostly just the screen and main processor. There’s still a lot going on after you’ve powered it down.

It has a battery-backed clock on the inside. You don’t *have* to sync your time with the internet, and you don’t always have an internet connection. If you don’t, the phone still keeps relatively decent time while it’s on. How?

There’s a circuit somewhere in the phone that serves as a clock. It might even be part of the CPU. One neat thing we figured out a long time ago is certain crystals vibrate at predictable frequencies when you run electricity through them. That’s why you see a lot of watches say they have a “quartz movement”. Both watches and computers take advantage of this.

So basically a tiny quartz crystal gets installed in a thing that can count how many times it vibrates. Then some electricity is applied. The person who designed the circuit set it up so once the right number of vibrations happens, a “tick” happens. That “tick” might be once per second, but usually it’s much faster so smaller amounts of time can be measured. The smallest amount of time that can be measured is whatever one vibration of that crystal takes.

So even when your phone is “off”, it’s probably still running a tiny circuit that updates the clock. This only takes a teeny tiny amount of electricity. Many simple watches can go 3+ years on one battery charge. So your phone can stay off for a long time before that clock circuit drains the battery.

PCs have this too. If you open most cases, you’ll find a small watch battery attached to he motherboard. This is used to keep the clock running even when there is no power. There’s also a battery inside some early Game Boy games like Pokemon Crystal that had a clock. By now many of the batteries have run out and those clock-based features don’t work anymore if you turn off the game! Pretty much anything that has an “off” state and keeps the time is likely using a small battery-backed quartz clock to do so.

These clocks aren’t always the most accurate, though. Very accurate ones are more expensive. That’s why computers tend to sync with an internet time source. My last PC could be as much as 5 minutes wrong if it went a day without internet connectivity.

GPS. The so called “positioning” satellite really send out times and dates. GPS programs can use this to form locations and such but it tells the device the time and date.

There are a few different ways:

* Some devices like TVs are never completely “off” – even when you turn the TV “off”, there are some circuits that are still powered, such as a “realtime clock” chip.
* Some devices like computers will have their realtime clock chip powered by a watch battery, so even when you unplug the device it will still keep track of time.
* Some devices like your phone or your TV’s cable box will just connect to a network and ask a dedicated timekeeping service what time it is.
* GPS navigation devices get their time from the GPS satellites every time they connect.

Most devices like phones, computers and the like will have a number of independent sources for getting the correct time.

– an internal clock: That clock is not powered down when you power down the rest of the machine. It needs very little power to keep going and will have a tiny (backup) battery in some cases. Should you really not power the device for a very,very long time (or have the backup battery die or so): it’ll fail back to a start date -bad thing, see further.

– the GSM networks: the cell phone networks broadcast the time (relatively accurate) as part of their signal. A phone can detect these signals as soon as it power up its hardware – no need to actually be active on the network to get to basic information of any and all networks in the area. [I’m supposing CDMA networks work the same as GSM networks in the respect]

– GPS: the GPS/GLONASS/… satellites broadcast a signal from which an extremely accurate time can be derived (a very exact time is needed to use the positioning technology itself)

– NTP servers over the Internet. NTP (Network Time Protocol) is a way to get very accurate time by interacting with a (set of) distant server(s) even over a slow connection to still get a rather accurate time.

Most devices that care about having highly accurate time will know which sources give them the most accuracy and will use as many sources as possible and fallback/initialize time from a potential less accurate source first only to then refine later on as they can get access to more accurate signals as needed.

There are other less common sources of accurate time less likely to be used by phones: mainly radio sources broadcasting the time such as DCF77 and similar in the USA.

​

Why is it very important for modern computers to have a decent date/time idea – even when no software is one the device ?

The reason lies in security protocols such as SSL (the S in HTTPS e.g.): these are certificate based and certificates have a range of date/time on them when they are valid. Outside of that time they are invalid. That’s also why computer e.g. that have been put out of use for years often require getting the time/date set correctly before you can reinstall software onto them sometimes: they cannot validate the digital signatures if they don’t have a correct idea of the current date/time.

To everyone who was kind enough to answer, thank you so much! I totally understand this now. 🙂