Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have ntpd running on a box. I want to see how the time on the box compares to the time retrieved from ntp.ubuntu.com. Is there an easy way to do this?

share|improve this question
    
I take it you just want to see the time there and not actually change your computer's time to match it? –  DerfK Jan 10 '11 at 20:37
    
Yep, that's right. –  John Bachir Jan 10 '11 at 20:50

3 Answers 3

up vote 7 down vote accepted

ntpq -p ntp.ubuntu.com

From man ntpq:

...
-p     Print  a list of the peers known to the server as well as a summary of their state. This is equivalent to the peers interactive command.
...

Edit: The host is timing out right now. ntpq -p pool.ntp.org will return a valid result.

share|improve this answer
2  
ntpdate is deprecated so it's best to get in habit of using ntpq instead. However I still use ntpdate all the time myself, old habits die hard. –  Phil Hollenback Jan 10 '11 at 20:43

You can use ntpdate to query a time server

ntpdate -q ntp.ubuntu.com

share|improve this answer
    
Thanks! Maybe you can answer this question too serverfault.com/questions/220836/… –  John Bachir Jan 10 '11 at 20:48

Actually, the command ntpq -c "rv 0 clock" ntp.ubuntu.com will return the time of the server in standard format : this is the result from ca.pool.ntp.org :

clock=d1b5aa9c.b8f9697a  Wed, Jun 29 2011  9:43:56.722
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.