1. Download our Official Android App: Forums for Android!

Support How is the Android OS telling the time?

Discussion in 'Android Help' started by Ambi89, Jul 21, 2016.

  1. Ambi89

    Ambi89 Lurker
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    3
    Joined:
    Jul 21, 2016

    Jul 21, 2016
    3
    1
    16
    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?
     

    Advertisement

  2. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,293
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,293
    23,645
    2,138
    Male
    space alien ;)
    Indy
    Hey @Ambi89, welcome to our AndroidForums :).

    I'm guessing that the underlying Linux kernel is connecting to a network time server to get the current time (i.e., either via a wifi or 3G/4G network connection).
     
    Bg260 and psionandy like this.
  3. Ambi89

    Ambi89 Lurker
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    3
    Joined:
    Jul 21, 2016

    Jul 21, 2016
    3
    1
    16
    Do you have any other information on that?
     
  4. rurocking

    rurocking Newbie
    Rank:
    None
    Points:
    48
    Posts:
    27
    Joined:
    Dec 28, 2011

    Dec 28, 2011
    27
    12
    48
    Male
    Senior Software Engineer
    Kitchener, ON Canada
    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.
     
  5. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,293
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,293
    23,645
    2,138
    Male
    space alien ;)
    Indy
    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​
     
  6. Ambi89

    Ambi89 Lurker
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    3
    Joined:
    Jul 21, 2016

    Jul 21, 2016
    3
    1
    16
    Awesome thanks I think I got all the information I need.
     
    scary alien likes this.
  7. svim

    svim Android Expert
    Rank:
     #44
    Points:
    608
    Posts:
    3,738
    Joined:
    Dec 19, 2013

    Dec 19, 2013
    3,738
    2,781
    608
    Illinois
    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.
     
    Jhayzone and scary alien like this.

Share This Page

Loading...