Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Network Time Protocol for iPhone

Tags:

iphone

ntp

I am writing an application that requires accurate timing. After asking this question, I have decided to investigate using NTP or maybe Simple NTP.

Is there any open source implementation of these protocols for the iPhone? So far I have managed to find a broken link. I am also aware that NTP has a C reference implementation, so I am trying to see how much effort it would require to make it work on the iPhone.

Update: I thought I had a working link, but it is to the Wayback Machine, which only saves text, not files link that works.

like image 586
Casebash Avatar asked Feb 15 '10 22:02

Casebash


People also ask

What is Apple's NTP server?

Time server. The name of the Network Time Protocol (NTP) server that is used to set the time on macOS devices. For example, time.euro.apple.com . This setting is supported on macOS 10.12. 4+ devices.

Does Apple use NTP?

Yes it uses standard port 123 UDP. Like the article says create an A record for time.apple.com and set the IP to your NTP server and that's it.

What protocol does network time use?

Network Time Protocol (NTP) is an internet protocol used to synchronize with computer clock time sources in a network. It belongs to and is one of the oldest parts of the TCP/IP suite.

What devices use NTP?

Possible clients include computers, phones, clocks, CCTV systems, clocking-in systems, payment terminals and more. Many devices have NTP client software built-in. If not, TimeSync software is easy to install on Windows devices, allowing you to synchronise a range of clients for a variety of purposes.


2 Answers

There's a small iOS library named ios-ntp. I have used it in one project in the past and it seemed to work reasonably well.

As of mid 2013 the original ios-ntp project has a few missing pieces, so I have mirrored the original svn repository to github. You can checkout out a working version of the code here: https://github.com/jessedc/iOS-ntp

like image 178
Jessedc Avatar answered Sep 23 '22 05:09

Jessedc


I would probably start by pulling code from OpenNTPD.

like image 36
Rob Napier Avatar answered Sep 22 '22 05:09

Rob Napier