Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

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

like image 459
agarwal_achhnera Avatar asked Aug 14 '14 11:08

agarwal_achhnera


1 Answers

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.

like image 62
konsolebox Avatar answered Oct 03 '22 00:10

konsolebox