Setting your date and time correctly on your Linux server is very important. Your server logs and other important information will all reflect the timezone of your server. In most cases, you will want to set your server’s time to match your own local time, but if your server is remote or hosting sites for people primarily located in another timezone, you might choose a different one.
On Red Hat Enterprise Linux or CentOS, you can use the setup program or redhat-config-date
to set the timezone. The setup program, although run from the command line, uses a semi-graphical interface to make it easier.
On a Debian-based distribution, use dpkg-reconfigure tzdata
to set the timezone.
With all of these commands, they will include onscreen instructions that will walk you through the process. Once you have changed the time, you can verify that your settings are correct by running date
. For example:
$ date
Thu Apr 17 14:47:12 EDT 2014
In the case of my system, it is 2:47 PM on Thursday April, 17 2014, and the timezone is Eastern Daylight Time.
Want to contribute?
You could earn up to $300 by adding new articles
Suggest an update
Request an article