Change the server date and time in CentOS

Published July 25, 2016

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.

Disclaimer: Our website is supported by our users. We sometimes earn affiliate links when you click through the affiliate links on our website.

Last Updated: July 25, 2016.     This post was originally written on July 25, 2016.