[ntp:questions] Re: Jonathan Buzzard's radioclkd and FreeBSD

Terje Mathisen terje.mathisen at hda.hydro.com
Mon Nov 10 19:28:41 UTC 2003


Mea Culpa!

I forgot the multiplication by 86400:

Terje Mathisen wrote:
> Here's the hardest part, going from YMD to day number. Subtract the day 
> number of the epoch, multiply by 86400 and add the number of seconds in 
> the current day:
> 
> t = ymd2days((unsigned) tm->tm_year + 1900, (unsigned) tm->tm_mon + 1, 
> (unsigned) tm->tm_day);
> 
> t -= STARTDATE_OFFSET;

missing line:

   t *= 86400;
> 
> t += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;

Terje
-- 
- <Terje.Mathisen at hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"




More information about the questions mailing list