Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Siddze

macrumors newbie
Original poster
Jul 8, 2020
8
1
When we turn on the Airplane mode and take out SIM from the iPhone and then manually change the Time, Date and Time Zone, the moment you toggle back Automatic Date & Time button, iPhone magically sets back to the exact right Time Date and Time Zone. This happens outside home as well as inside. I can understand that iPhone can decode GPS signals when outside under an open sky, but how does it correct its system time without any communication. Can anyone explain this spooky behavior?
 

casperes1996

macrumors 604
Jan 26, 2014
7,550
5,729
Horsens, Denmark
Well you've said it all, basically. To get the exact time after having been without any battery power whatsoever would require communication with a time server, but even a little charge is enough to keep the RTC going (real time clock). And I mean way less than is required to keep the phone turned on so this goes even after it turns off from no battery.

The way time works on the device is simply a big number going up, usually in nanoseconds since 1970; The Unix Epoch. Apple in some of their software uses OS X time which starts in 2001, but I'm pretty sure the hardware still counts from 1970; In any case, time zone is irrelevant to this number. Time zone is applied after the fact as a ± modifier to the value. Date is represented as a massive number of nanoseconds and then we just put that number in the context of a time zone to give the user a time they can relate to. So when you change your time zone or time settings on the phone, you're not changing the number that actually represents time. You're just changing the modifier that is added or subtracted from it. when representing time. So a GPS signal is all that is needed to get the time zone and new modifier needed to somewhat accurately represent time, though leap seconds may not necessarily be accounted for without communicating with a time server, I don't know
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,009
4,625
Simple explanation: if wifi on, phone is pinging time.apple.com, Apple's time server. That's same on Macs, but there you can change to a different time server, if you want (I point to NIST's, time.nist.gov).
 

Siddze

macrumors newbie
Original poster
Jul 8, 2020
8
1
Let me rephrase my question, when I manually change Time Zone, Time & Date in Date & Time Settings [ Example from my reference Delhi, India, Wed 8 Jul @ 20:19 IST to Wed 7 Jul 14:00 EDT], take out the SIM, keep the Airplane Mode and toggle back the Automatic Date & Time button and voila iPhone would automatically sets back to the exact right Time Date and Time Zone. So When I manually change the time in ios / software, I believe I also force RTC to change count, right? I have seen that in Flights when I change Time Zone and I pointed iPhone through the window seat toward the sky and it changes its time and tries to approximate time zone. I believe it picks up the GPS signal and decodes time and position and approximates Time Zone the Plane is flying over.
So the question is how come iPhone get the right time inside the house without clear view of the sky, so evidently it can not use GPS, what does it use?
 
Last edited:

Siddze

macrumors newbie
Original poster
Jul 8, 2020
8
1
Simple explanation: if wifi on, phone is pinging time.apple.com, Apple's time server. That's same on Macs, but there you can change to a different time server, if you want (I point to NIST's, time.nist.gov).
Wifi isn't on. Please read the Thread once more. I switched on the Airplane Mode.
 

C DM

macrumors Sandy Bridge
Oct 17, 2011
51,392
19,460
Let me rephrase my question, when I manually change Time Zone, Time & Date in Date & Time Settings [ Example from my reference Delhi, India, Wed 8 Jul @ 20:19 IST to Wed 7 Jul 14:00 EDT], take out the SIM, keep the Airplane Mode and toggle back the Automatic Date & Time button and voila iPhone would automatically sets back to the exact right Time Date and Time Zone. So When I manually change the time in ios / software, I believe I also force RTC to change count, right? I have seen that in Flights when I change Time Zone and I pointed iPhone through the window seat toward the sky and it changes its time and tries to approximate time zone. I believe it picks up the GPS signal and decodes time and position and approximates Time Zone the Plane is flying over.
So the question is how come iPhone get the right time inside the house without clear view of the sky, so evidently it can not use GPS, what does it use?
It could be that it remembers the last date & time zone that was set automatically and reverts to that first when you switch back to automatic setting (and then tries to refresh it to update it if possible and needed).
 
  • Like
Reactions: ApfelKuchen

zorinlynx

macrumors G3
May 31, 2007
8,265
18,140
Florida, USA
iOS has three different ways of finding the time:

- GPS
- Cellular network
- NTP

It stands to reason that it will use any of these sources that are available. I'm not sure the priority, but if I were to guess I'd expect cellular network to be first, followed by NTP, then if there's no network available, GPS.
 

bhodinut

macrumors regular
Jan 31, 2013
203
147
There's a hardware clock that gets updated by outside services. If you cut off all access the hardware clock keeps pretty good time without outside "tweaks".
 
  • Like
Reactions: ApfelKuchen

jorgk

macrumors regular
Mar 20, 2013
111
43
... inside the house without clear view of the sky, so evidently it can not use GPS ...
Sorry, why do you think the phone can not use GPS? It does not need to 'see' the GPS satellites, it's enough to receive their (electromagnetic) signals.
 

Isamilis

macrumors 68020
Apr 3, 2012
2,121
1,033
When the phone’s clock updated (manually or automatically), it update the absolute time in the phone (GMT+0?). For display, the phone will add +/- based on your location. When you turn on the phone with airplane mode, it will use the absolute time in the phone, and adjust the time accordingly based on your location (or historical location).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.