Date and Time in CentOS, How to fix ntpd?
A few days a go, i was asked to fix date and time in one of servers. The date and the time between Linux Kernel system time and hardware wasn’t properly set up. And when i tried ntpd, it was failed (i’m still trying to figure out why).
Timezone configuration is correct. So i don’t need to worry about timezone, which is in UTC.
The problem is the date correct, but the time in Linux Kernel system time and hardware clock aren’t match at all. There are about +7 hours different with the correct UTC time in a Linux Kernel time system, and -7 hours different with the correct UTC time in a hardware clock.
Set up date and time :
Display the time and date
# date
Display UTC
# date --utc
Display current hardware clock time
# hwclock --show
Since the time in Linux Kernel time doesn’t match with the current time
# date -s "18:56:00"
Set the hardware clock from the system clock (kept by the Linux kernel)
# hwclock --systohc






Add a Comment