Steve Wampler <[EMAIL PROTECTED]>: >Clint Jeffery wrote: >> >> OK, if I remember it right, we recently had a discussion of finding the >> local timezone, which was finally ended when the original poster relayed a >> suggestion that our (POSIX-based) system interface actually had a portable >> method of obtaining the needed information. >> >> Believe it or not, I have a follow-up. My PC at home gets WAYYYY out of >> sync on its clock, and I want to write a daemon to auto-reset it once a >> day from some public Internet clock. >> >> * What is the coolest/simplest protocol for getting the correct time >> from a remote server?
NTP is the coolest, daytime is the simplest. Libtp supports daytime, but it was just written as the simplest possible protocol to test the discipline before going on to better things, and I never bothered to expose it to Unicon. >> * What OS'es run such a server routinely? Any decent Unix distribution comes with NTP daemons and ntpdate, although the big commercial guys are usually a couple versions behind. Microsoft has some time thingy that's probably not worth investigating as there are NTP daemons for Windows too. >> * Is it possible to write such a daemon, portably, in Unicon? I see we have >> gettimeofday but apparently not settimeofday. >> >> All suggestions are welcome > >Have a look at the NTPv4 protocol. It's amazingly accurate (to a >precision >beyond that of most (all?) PCs and, more importantly, used by the >Internet >standard time servers. For most purposes, NTP can be considered arbitrarily accurate. The people behind it are time freaks. Some have atomic clocks in their houses. There's a Microsoft guy who wrote a multi-protocol time client for Windows who has a collection of varying kinds atomic clocks in a rack in his house. If you reboot much, just run ntpdate with a few servers at startup (ask NMSU admins where their timeservers are). At home I just run ntpdate whenever I notice the clock is off because I'm too lazy to set up ntpd for real, but if you have a *really* bad clock, ntpd will keep it in sync and even do things locally to make it more accurate. Steve _______________________________________________ Unicon-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unicon-group
