Change timezone linux centos 7
Just log out and log in again, or execute source /etc/profile or source ~/.bash_profile to take effect immediatelyĪt this time, execute date again to check the date and you can find that the time zone is changed to Beijing time. Here is that TZ value again,this time on standard output so that youĬan use the /usr/bin/tzselect command in shell scripts:Īdd the line TZ='Asia/Shanghai' export TZ to /etc/profile (valid for all users) or ~/.bash_profile (valid for current users) To the file '.profile'in your home directory then log out and log in again. You can make this change permanent for yourself by appending the line
![change timezone linux centos 7 change timezone linux centos 7](https://linuxhint.com/wp-content/uploads/2017/01/CentOS-7-img6-768x530.jpg)
Therefore TZ='Asia/Shanghai' will be used. The following information has been given: Please select one of the following time zone regions.1) Beijing Time Please select a country.1) Afghanistan 18) Israel 35) Palestineĥ) Bangladesh 22)Korea(North)39) Saudi Arabiaġ2) Georgia 29) Malaysia 46) Turkmenistanġ3) Hong Kong 30) Mongolia 47) United Arab Emiratesġ4) India 31)Myanmar(Burma)48) Uzbekistan Please select a continent or ocean.1) Africaġ1) none - I want to specify the time zone using the Posix TZ format.
![change timezone linux centos 7 change timezone linux centos 7](https://linuxhint.com/wp-content/uploads/2018/04/p4-1.png)
Please identify a location so that time zone rules can be set correctly.
![change timezone linux centos 7 change timezone linux centos 7](https://www.basezap.com/wp-content/uploads/2018/04/9.jpg)