Way back in Jan 2014 grabbed a test iPhone & after charging I was greeted with the above.
After various exclamations along the lines of “Holy fishsticks, Batman!” we did get the iPhone enabled & this did not involve a time machine or me waiting the 23,053,554 minutes for the device.
Below is how & some guess work as to what happened.
The Guess Work
So what seems to have happened is the following:
- The iPhone was disabled & left on.
- The iPhone drained it’s battery completely whilst being in the drawer.
- With a full battery drain & subsequent power on, the iPhone’s clock reverted to a previous date.
Days Of Future Past
So let’s take the 23,053,554 minutes, a quick Google convert shows that as 43.8323 years.
Deduct that from the day of the tweet, 14/01/2014 & we end up somewhere about 1970.
1970? First big clue.
Where have we seen that before? How about every time a computers clock fully resets? Why that date? Well as per this article on Wikipedia:
“Unix time (also known as POSIX time or Epoch time) is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970,[note 1] not counting leap seconds.”
As OS X has a Unix core, we can leverage the date command to calculate dates.
Looking at the linked man page gives us:
-r seconds Print the date and time represented by seconds, where seconds is the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970; see time(3)), and can be specified in decimal, octal, or hex.
So, lets again convert 23,053,554 minutes, this time to seconds (1383213240), & then armed with the seconds try the date command as per the below:
date -r 1383213240
This returned the below which lead to a eureka moment:
Thu 31 Oct 2013 09:54:00 GMT
So what did we do? We took the minutes the iPhone said it was disabled for & returned a date.
This would appear to show that when an iOS device is disabled a date & time is written somewhere, that until that date & time elapses the device is disabled.
In this iPhones case, it was waiting for the above date.
Back To The Future
With the time known that the device would become enabled, why was it not enabled on 14/01/2014?
Well, as mentioned the iPhone thought that the date was 01/01/1970. And in seeing that I remembered some previous posts on NTP & realised that the device needed a network connection in order to update it’s time with it’s set NTP.
However, around iOS 7, iOS devices with a passcode set will not connect to a wireless network until unlocked.
Luckily this was an iPhone & so a SIM could be used, after installing the SIM & a few restarts later the devices clock had updated to the correct date & time & the device was enabled.
(If the iPhone’s SIM slot didn’t work, was an iPod or a non-cellular iPad then the method mentioned here could be used to give the device network connectivity & then allow it to update it’s clock).
Incidentally, in James Ridsdales JNUC2015 talk, he mentioned an issue with DEP enrollments he had encountered due to skipping the “Location Services” stage of setup assistant.
This was due to the iDevices clock being wrong, & therefore not being able to validate the certificates the iDevice is presented for DEP.
Not skipping the “Location Services” stage of setup assistant allows the iDevice to update it’s time & complete the DEP enrollment.
Apple actually has a page available here where they advise:
At the top of this post I wrote “we did get the iPhone enabled & this did not involve a time machine or me waiting the 23,053,554 minutes for the device.”
Well, yes the iPhone was enabled but sadly the passcode was still unknown & so I put the device into recovery mode & erased it.
Cool Story, Bro
I’ve brought this up once or twice on the ##osx-server IRC & MacAdmins.org Slack & thought it was time to share it here too.
Many thanks to frogor, magervalp, flammable & jeremyaghost (amongst others) for filling in the blanks with this.