• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How is the Android OS telling the time?

Ambi89

Lurker
Jul 21, 2016
3
1
So after googling this I can not find a direct answer to my questions. 1. How is the android telling time? Is it using GPS to tell time and how does that work? 2. Are the time zones on the OS calculated by GPS also or is that information taken from some where else?
 
Devices use NTP to sync the time with pool.ntp.org. NTP is configured in /system/etc/gps.conf. You have to be root to edit this file.

Thank you for that, @rurocking :).

@Ambi89, here's my settings/info from my Nexus 5 for that file:

ScaryAlien@LV-426 ~
$ adb shell cat /system/etc/gps.conf | grep -i ntp
NTP_SERVER=time.gpsonextra.net

# NTP_SERVER=asia.pool.ntp.org
# NTP_SERVER=europe.pool.ntp.org
# NTP_SERVER=north-america.pool.ntp.org​
 
Upvote 0
NTP is the software/cloud aspect but there's also a hardware part in our phones. On a typical computer there's a clock chip that's used by the user interface to show the date and time. You could pull the power cord and remove the CMOS battery, and that would eventually wipe the stored date/time. On our phones an equivalent clock chip is integrated into our phones' SoC (System on a Chip). There's no CMOS battery involved but there is a small capacitor, all that's necessary for the trickle charge required to retain date/time info. That's why you can remove the battery (for models that allow it) and the date/time is still retained. The clock chip stores the date/time, NTP is still required to keep the info up to date.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones