Hello. My name's Kate. I love Linux, WordPress - own a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: available

You are on the Nineteen Labs » Date and Time in CentOS, How to fix ntpd? article.

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

Share : These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • SphereIt
  • BlinkList
  • Reddit
  • StumbleUpon

Add a Comment

XHTML You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu