开发者

Getting system time in iPhone

开发者 https://www.devze.com 2023-03-06 19:09 出处:网络
I know that there is a method [NSDate date] which returns current date and time from iPhone clock. But if this clock time was changed开发者_StackOverflow社区 manually it would rune my code.

I know that there is a method [NSDate date] which returns current date and time from iPhone clock. But if this clock time was changed开发者_StackOverflow社区 manually it would rune my code. Is there any opportunity to get world time, not current time from iPhone?


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

Following uris might help you to write your own implementation:

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号