I want to find out correct time on iOS devices even though user have set wrong time manually. In the setting->General->Date & Time there is option of Set Automatically if that option is uncheck by the user then how can i find the correct time programmatically.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use NTP protocol for getting a current time or serve a time from your server and get it on application launch.
Apple doesn't provide by default any way to get time from NTP unfortunately and all time related function are using local time that user can change.
回答2:
I have a 'web service' on my site which serves you the current time in milliseconds since the Unix epoch, one request, one response, nothing else.
回答3:
I think this is the wrong place for this question. Try Apple's forums.
Because there is no way to get current time form ios device when user update time manually.
Sweet & smart .........