0

Received an error earlier this afternoon that the time was wrong. Investigated it and found out that the time on the server (represented as PST) was few minutes ahead of local time.

I ran the following command to update the time:

sudo service ntp stop
sudo ntpd -gq
sudo service ntp start

The issue I now have is the PST time is represented as UTC.

To be specific, if it's 4:58 PM here California, the PST time on my server returns the UTC time (but time-zoned as PST).

~# date
Wed Nov 30 00:56:44 PST 2016
~# hwclock -r
Wed 30 Nov 2016 12:57:43 AM PST  -1.025184 seconds

I have ntp installed, ran:

sudo ntpdate -s time.nist.gov

But no cigar.

Any recommendations on how to fix this?

Update


I manually edited the time using:

~# sudo date --set="2016-11-29 17:15:26.990"

Ran sudo ntpdate -s time.nist.gov hoping that the offset is small enough to make it sync. But it didn't work as expected.

0

First, you don't mention if you stopped the ntp service prior to running the ntpdate command. I believe that I got the error that the needed socket was in use when I tried it.

Second, if the ntpdate command works as you have specified, it will SLEW the time and NOT STEP (jump) the time. Thus, it might take a bit of time for the clocks to get into synchronization.

What I generally do is (as root) to step the time during operations is:

 service ntpd stop
 ntpdate -b <timesource>
 service ntpd start

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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