[ntp:questions] Re: Question about synchronizing client and server clock

John Howells John.Howells at marconi.com
Tue Jan 6 08:38:02 UTC 2004



Terje Mathisen wrote:

> NT's _ftime counts 100 ns intervals, starting from 1600 (?), 

1st January 1601. Although I do not believe it is stated anywhere, this
is presumably chosen so that all leap year "multiples" (every 4 years,
every 100 years, and every 400 years) are the last modulo the multiple,
which makes conversion between a date and an FTIME easier than any other
origin (assuming all dates use the Gregorian calendar). I.e. assuming
normal integer division you can do:

	int	Years = Target_Year - 1601;
	int	Days_To_Start_Of_Year = Years * 365 +
			( Years / 4 ) -
			( Years / 100 ) +
			( Years / 400 );

which is not so simple with any other origin.

John Howells



More information about the questions mailing list