

hwclockĪt this point the settings are complete and you can see your date and time by entering the date command, like below command. hwclock -systohc -localtimeĦ- You can use the following command to ensure that the changes are applied. Please note: You must enter your desired time zone in the first line.ĥ- Enter the following command to write the changes made in the hardware clock. ZONE="America/NewYork" UTC=false ARC=falseįinally, save the file by hitting the Esc key and entering the phrase :wq vi /etc/sysconfig/clockĤ- In the opened file, enter the following statement. You can use different sites to get the time zone and its name.Īfter going through the above steps, you need to change the time zone of your system’s hardware clock.ģ- Open the etc/sysconfig/clock file with the vi editor.

In the above example, we have selected the time zone of NewYork. But in certain circumstances, if we need to do the changes in timezone configuration, we can also do. While installing the CentOS operating system, we are configuring the timezone in it. The timezone is very important in terms of the synchronization that comes into the picture. rm -rf /etc/localtimeĢ- Then specify your time zone with the following command.Ĭommand Structure ln -s /usr/share/zoneinfo/"Time_Zone" /etc/localtimeĮxample: ln -s /usr/share/zoneinfo/America/NewYork /etc/localtime The following article provides an outline for CentOS Set Timezone. Another way to create a link is to use datectl.Recommended Article: Tutorial MariaDB installation on Debian 10īuy Linux VPS Set Timezone on CentOS 6 Linuxġ- First, delete the file where your time zone is currently stored. In this article, two ways are used to modify the time zone. 2- If you are considering another time zone, you can find the list of time zones by the following command. timedatectl set-timezone America/NewYork By entering the above command, the server’s time zone to NewYork will change.
#CHANGE TIMEZONE LINUX CENTOS HOW TO#
We can see that we have switched to CST China standard time How to change date and time on CentOS 7 Linux 1- To set the time zone, you must proceed as follows. ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime If the time zone symbol in the old version of / etc / zoneitimer does not exist, you can change it to the previous version of / etc / zoneitimer.Ĭheck the time zone file under / usr / share / zoninfo, ~]# timedatectl set-timezone Europe/Berlin Then use the set timezone option to change the time zone, such as Europe / Berlin: To list all available time zones, use the command:

System clock synchronized: yes NTP service: activeīefore you change the time zone, you need to find the name of the time zone you want to use. ~]# timedatectl Local time: Tue 16:35:23 CST Timedatectl is a commandLine utility that allows you to view and change the time and date of the system. For example, the cron daemons execute cron jobs using the time zone of the system, and the timestamps in the log files are based on the time zone of the same system. A time zone is basically a region of the globe that observes a uniform standard time for constitutional, business and cultural purposes. In the CentOS environment, the time zone is nothing. For many system related tasks and processes, using the correct time zone is essential. Change Timezone on CentOS 7 Server - Do it Now This article covers how to change timezone in CentOS 7. But in certain circumstances, if we need to do the changes in timezone configuration, we can also do that.
