Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine the actual time and date in iOS (not the time of the device)

In iOS, I need to know the actual time (UTC), not the time of the device. In other words, it should not be possible for the user to tamper with the time or date.

Anything that requires a network connection is not good (so accessing a time server is not an option).

AFAIK, there are 2 theoretical ways of achieving this:

  • Use the timestamp from the GPS satellite signal
  • Get the current time from the carrier

Problem is that this information is not exposed by any API in iOS.

Is there another way?

like image 705
Philippe Leybaert Avatar asked Aug 17 '12 12:08

Philippe Leybaert


People also ask

Why doesn’t my iPhone display the time on the network?

Some networks don’t support network time, so in some countries or regions, iPhone may not be able to automatically determine the local time. 24-Hour Time: (not available in all countries or regions) iPhone displays the hours from 0 to 23. To change the default date and time, turn off Set Automatically, then change the date and time displayed.

How do I change the default time on my iPhone?

24-Hour Time: (not available in all countries or regions) iPhone displays the hours from 0 to 23. To change the default date and time, turn off Set Automatically, then change the date and time displayed.

What happened to timestamps on iPhone text messages?

Timestamps used to appear at the top of each text message on your iPhone. Now, iPhone message timestamps for individual texts seem to have disappeared, but they’re only hidden. You don’t always need to know what time a text was received, but if you wonder how to see the date and time someone texted you, we have the answer.

How do I find the activation date of my iPhone?

To start the conversation again, simply ask a new question. There is no way to determine the "activation date" of any given iPhone. The best you can do is find out if it's still under warranty and when the warranty expires. A forum where Apple customers help each other with their products. Learn more. Sign up with your Apple ID to get started.


1 Answers

Most solutions you could possibly find (including getting GPS data from CoreLocation to access the time information) are flawed because they are depending on the actual device to access time time. You will need to connect to a time server (i would suggest to check for NTP server). I was looking at the core telephony framework and couldn't find anything that would provide the network time. You might want to fill a bug report and request apple to expand one of the classes to include the time.

like image 187
J2theC Avatar answered Nov 15 '22 22:11

J2theC