[ntp:questions] Calculating NTP timestamp in C program

bg_ie at yahoo.com bg_ie at yahoo.com
Mon Jul 10 23:11:34 UTC 2006


Hi,

I wish to write a C program which obtains the system time and hence
uses this time to print out its ntp equivalent.

Am I right in saying that the following is correct for the seconds part
of the ntp time?

long int ntp.seconds = time(NULL) + 2208988800;

How might I calculate the fraction part?

Thanks very much for your help,

Barry.
-- 
comp.lang.c.moderated - moderation address: clcm at plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.




More information about the questions mailing list