0

I have a tablet (no phone network, just WiFi) running Android 12. In the Settings | Date and Time sub-dialog when I select Automatic date & time, there is a 3 way choice:

  • Use network provided time
  • Use GPS provided time
  • Off

What does the first option mean? It sure sounds like NTP, but there is no interface to pick a NTP server. Some wifi routers provide a NTP server address with their DHCP replies, but I don't think mine does, and in any case a mobile device can't rely on that, right?

Strangely on my phone, also Android 12, the Automatic Date & Time widget is just a binary switch, on or off (though the phone definitely has GPS). I think "on" here means the mobile network. But how come this interface differs between two devices with the same Android release?

1
  • "But how come this interface differs between two devices with the same Android release?" since Android is open-sourced, most likely manufacturer's customization.
    – Andrew T.
    Jan 4 at 2:11

1 Answer 1

4

Network time means Android will get the time from a NTP server.

By default Android uses to my knowledge the server time.android.com (see here) but different manufacturer may change this in their devices so the default NTP server in Samsung or other devices may be different.

Android has no UI to change the NTP server but I think changing it via adb should be possible.

You can get the configured NTP server using this command (tested on Android 13 & 14):

adb shell cmd network_time_update_service dump

It outputs something like:

mPollingIntervalMs=PT18H
mPollingIntervalShorterMs=PT1M
mTryAgainTimesMax=3
mTryAgainCounter=0

NtpTrustedTime:
getNtpConnectionInfo()=NtpConnectionInfo{mServer='time.android.com', mPort='123', mTimeoutMillis=5000}
mTimeResult=TimeResult{mTimeMillis=2024-01-04T00:54:46.354Z, mElapsedRealtimeMillis=PT292H1M14.032S, mCertaintyMillis=9}
mTimeResult.getAgeMillis()=PT7H24M43.324S

Since Android 14 and higher multiple NTP servers are supported. On a Samsung device located in Germany I have seen the following time servers configured:

ntp://time.android.com`
ntp://europe.pool.ntp.org
ntp://2.android.pool.ntp.org
ntp://de.pool.ntp.org
1
  • Hi, good answer :) This already tells me most I wanted to know. But, the adb bit doesn't quite work, I get No shell command implementation.
    – q.undertow
    Jan 4 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .