[ntp:questions] ntpd sets clock to the year 1939

Garrett Wollman wollman at csail.mit.edu
Wed Mar 28 01:42:18 UTC 2007


In article <euc9t4$1p1h$1 at hedeland.org>, Per Hedeland <per at hedeland.org> wrote:

>And just to hopefully dispel some myths about *that*, i.e. Unix/POSIX
>time representation: First of all it really has nothing to do with NTP
>timestamps, but obviously ntpd needs to convert between the two. And it
>(currently) uses a 32-bit *signed* quantity for the seconds, with the
>value 0 in Jan 1970.

Depends on your operating system and platform.  Viz.:

wollman at khavrinen(5)$ cat >foo.c
#include <stdio.h>
#include <time.h>

int
main(void)
{
        
	printf("sizeof(time_t) is %zu characters\n", sizeof(time_t));
}
wollman at khavrinen(6)$ make foo
cc -O -pipe   foo.c  -o foo
wollman at khavrinen(7)$ ./foo
sizeof(time_t) is 8 characters
wollman at khavrinen(10)$ uname -sm
FreeBSD amd64

(As it turns out, FreeBSD is Y2038-ready on all 64-bit platforms.
Other operating systems will vary, and there may be other limitations
and sanity checks that prevent you from setting a particular date in
the far past or future.)

-GAWollman

-- 
Garrett A. Wollman   | The real tragedy of human existence is not that we are
wollman at csail.mit.edu| nasty by nature, but that a cruel structural asymmetry
Opinions not those   | grants to rare events of meanness such power to shape
of MIT or CSAIL.     | our history. - S.J. Gould, Ten Thousand Acts of Kindness




More information about the questions mailing list