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
date MMDDhhmmYYYY
Run this command:
date 072522172010
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.
Related Posts
If you have any questions, please contact me at arulbOsutkNiqlzziyties@gNqmaizl.bkcom. You can also post questions in our Facebook group. Thank you.