简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM