Set Server Time Zones with Timedatectl

This article provides a guide to setting the server time and server time zone settings using timedatectl.

Get Server Time

To check the current time on your Linux server, login to the console and run the following command:

timedatectl status

The response should be similar to the example below.

timedatectl status response

Set Server Time

To set the server time on your Linux server, login to the command line and run the following command:

timedatectl set-time [YYYY-MM-DD HH:MM:SS]

Using the pattern above, enter the desired date and time, with the units in descending order from longest to shortest (Year...Seconds).

Set Server Time Zone

To set the server time zone on your Linux server, run the following command:

timedatectl set-timezone "America/Chicago"

Using the pattern above, enter the desired time zone using either UTC or Tz database, with the time zone enclosed in quotes.

  • server time, timedatectl
  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server. From the command line,...

htaccess RewriteRule Examples

Here are some useful mod_rewrite RewriteRule redirect examples that you can use in your .htaccess...

Using htaccess File to Block IPs

If your webserver is Apache, you may block access to your website from specific IP addresses...

Enable Browser Caching with htaccess File

Enable browser caching to reduce website loading times, by taking advantage of caching of...