Getting System Time on iPhone

I know that there is a method [NSDate date], which returns the current date and time from the iPhone clock. But if this time was manually changed, it would run my code. Is it possible to get world time, not current time from the iPhone?

+1
source share
1 answer

Yes, you can have the correct current time using ntp / sntp.

The following uris can help you write your own implementation:

Simple NTP Client for iOS: http://code.google.com/p/ios-ntp/

NSDate from a time server: http://pathoneycutt.com/2010/12/nsdate-from-time-server/

+1
source

Source: https://habr.com/ru/post/949071/


All Articles