Advance

Set Timezone on CentOS 7 Linux

Set Timezone on CentOS 7 Linux
1
(1)

In the following of CentOS 7 Linux tutorials, In this article we are going to learn, how to set Timezone on CentOS 7 Linux. As you know, setting the time and date of the operating system on servers is very important and is a requirement for operating in the world of internet and service. In this tutorial, you will get acquainted with the timedatectl and Date commands and you will learn how it works.

 

Set Timezone on CentOS 7 Linux

1- To see the time position as well as your server time information, you can enter the following command.

timedatectl

After entering the above command, the output will be displayed as follows.

If the time and date of CentOS 7 need to be changed, stay tuned.

2- You can do the following to set your system clock.

timedatectl set-time 18:23:45

By entering the above command, your system time will change to 22:23:45.

Recommended Article: How To Install MongoDB 4 In CentOS 8

3- To set the time and date of the operating system simultaneously, you can proceed as follows.

timedatectl set-time "2017-04-15 22:37:22"

So far, you’ve learned how to set the time and date of the CentOS 7 Linux, Here’s how to set up TimeZone.

 

Buy Linux VPS

How to change date and time on CentOS 7 Linux

1- To set the time zone, you must proceed as follows.

timedatectl set-timezone America/NewYork

By entering the above command, the server’s time zone to NewYork will change.

2- If you are considering another time zone, you can find the list of time zones by the following command.

timedatectl list-timezones

3- Or you can use the following mode to search among time zones.

timedatectl list-timezones | grep -i york

After entering the above command, the area is displayed when the word york is used.

4- Finally, you can use the following command to get the whole list of time zones of a continent.

timedatectl list-timezones | grep America

5- You can also set your CentOS 7 Linux clock and date to the NTP server.

timedatectl set-ntp yes

Please note:  you can use the word no instead of the word yes instead of the NTP server to disable the setting.

So far, you’ve learned how to use the timedatectl command, but you can also use the date command to set the time and date on Linux.

 

Set the time and date by the Date command

1- Use the following structure to set the time of CentOS 7 with the date command.

Structure

date --set HH:MM:SS

Example

date --set 18:26:10

2- Use the following mode to set the date of CentOS 7 by the date command.

Structure

date --set YYYY-MM-DD

Example

date --set 2020-02-29    

3- Finally, if you need to set the time and date at the same time, enter the following command.

date --set 2020-2-28 18:26:12
Recommended Article: What are the some features of Linux?

Here’s how to set the time and date of CentOS 7 Linux to date and timedatectl commands.

If you are using CentOS 6 Linux, you can refer to the time and date setting of Linux CentOS 6.

 

Dear user, we wish this tutorial would be helpful for you, to ask any question or review the conversation of our users about this article, please visit Ask page. Also to improve your knowledge, there are so many useful tutorials ready to on Eldernode training.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day