Skip to content

Instantly share code, notes, and snippets.

@TrevorS
Last active January 2, 2016 21:29
Show Gist options
  • Select an option

  • Save TrevorS/8363461 to your computer and use it in GitHub Desktop.

Select an option

Save TrevorS/8363461 to your computer and use it in GitHub Desktop.
Setting the timezone and correcting the time on a RHEL server. Example uses MTD timezone.
# Set the timezone in the system configuration.
sudo vim /etc/sysconfig/clock
# Symlink the correct timezone (in this case MDT) into /etc/localtime
sudo ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
# Correct the date/time using ntpdate.
sudo ntpdate 0.north-america.pool.ntp.org
# Make sure ntpd is running.
sudo service ntpd restart
# Configure ntpd to run at boot-up.
sudo chkconfig ntpd on
# Set the hardware clock to the corrected system clock.
sudo hwclock -w
# To check your system clock:
date
# To check your hardware clock:
sudo hwclock --show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment