agarwal_achhnera
agarwal_achhnera

Reputation: 2456

Why hwclock and date display different results and how to correct it

In my Linux Ubuntu 14.04 LTS machine date is shown incorrectly. When I try to run hwclock and date commands from the terminal they display different results:

sudo hwclock
Thursday 14 August 2014 04:38:09 PM IST  -0.766043 seconds

date
Thu Aug 14 11:08:30 IST 2014

Here hwclock time is right, but date is wrong. How can I correct it.

Thanks

Upvotes: 9

Views: 7519

Answers (1)

konsolebox
konsolebox

Reputation: 75498

Looks like your hardware clock is set to local time. Run this:

hwclock --localtime --hctosys

See hwclock --help for more info.

You should configure your boot-time settings so that this would be the default action when restoring your system time from the hardware clock. Check the documentation of your distro.

Upvotes: 12

Related Questions