Change the server date and time in CentOS
This is a short tutorial on changing the server time in CentOS. At work, I use CentOS servers with versions 6.4, 6.5 and 7.0. To change the server date and time to July 25, 2016, the syntax is
Run this command:
Verify that the date has changed.
$ date Wed Jul 25 22:10:49 EDT 2016
The date has been changed. However, it will revert after a reboot. To make the datetime change permanent, follow these steps.
First, login as root.
sudo su -
Next, run these steps.
rm /etc/localtime ln -s /usr/share/zoneinfo/GMT /etc/localtime date 072522172010 hwclock --systohc
After a reboot, you will notice that the date and time have been permanently updated.
Created on 25 July 2016