Find correct time on iOS device

人走茶凉 提交于 2019-12-04 05:29:32

问题


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 .........



来源:https://stackoverflow.com/questions/21238254/find-correct-time-on-ios-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!