Re: Is 'right' wrong?

[email protected] (Paul Jarc) Sun, 23 Jan 2005 00:01:19 -0500
Newsgroups gmane.comp.lib.libtai
Organization What did you have in mind? A short, blunt, human pyramid?
Message-ID <[email protected]>
Lloyd Zusman <[email protected]> wrote:
> But that is not what happens on my machine in this case.  In this
> scenario, there is a 22-second discrepancy between my time_t value and
> the human-readable value.

That's not a meaningful comparison.  You can compare simultaneous
time() values from two machines, or two simultaneous "date" outputs.
But a time_t value and the human-readable string are of two different
kinds.

>> I would say time_t counts only non-leap seconds, but localtime()
>> expects it to count leap seconds as well, so your human-readable
>> format will appear to be 22 seconds behind what other machines say.
>
> They are 22 seconds behind what other non-leap-second-counting machines
> say, and 44 seconds behind what leap-second-counting machines say.

If you are talking about comparing different machines' time() values,
then it appears that your machine's clock is genuinely 44 seconds
behind where you want it to be.  Here's how to fix it:
- Make sure /etc/leapsecs.dat exists.
- Set your timezone to a right/ zone.
- Restart clockspeed.
- Feed it with sntpclock/taiclock.  Feed it again later so clockspeed
  will no longer be confused about how fast your hardware clock is.

Now, when you compare your clock to other clocks, remember that yours
may be genuinely off.  clockspeed will slowly correct it, but until
then, you should not expect your "date" to match someone else's.  Use
sntpclock|clockview and look at the "after" time.  *That* should match
other systems' clocks, even if your clock is currently off.  Your
clock will eventually come into sync.

> Do you know of any reliable public taiclock servers?  I'd rather go
> straight to one of those, if possible.

I just started one up on taiclock.dogmap.org.  If you need seriously
good precision, this probably isn't good enough, but it's close enough
to set your watch.  Right now I get:
$ sntpclock `dnsip north-america.pool.ntp.org` | clockview 
before: 2005-01-22 23:46:03.073954000000000000
after:  2005-01-22 23:46:03.089865999931007623


paul