[ntp:questions] Re: Calculating NTP timestamp in C program

Keith Thompson kst-u at mib.org
Wed Aug 9 16:50:35 UTC 2006

rlb at hoekstra-uitgeverij.nl (Richard Bos) writes:
> It may be, btw, that your first time cannot fit in a time_t at all; for
> example, on many common systems the NTP start time will be before the
> earliest representable time, albeit not much before. Not much is, alas,
> enough in this case. (To be less circumlocutory, the epoch under POSIX
> is 00:00:00 on 1970-01-01; time_t, on such systems, is a signed long
> int; and if that system is 32-bits and uses 32-bit longs, as many do,
> 2**15 seconds is just over 68 years, making the most negative time_t
> represent a time somewhere in 1901... just over a year after NTP's
> 1900-01-01 :-/ ).

You mean 2**31 seconds, not 2**15 seconds.

(This being comp.lang.moderated, I'll probably be one of at least half
a dozen people pointing this out.)

Keith Thompson (The_Other_Keith) kst-u at mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.
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