CentOS 7修改方式以下:
# lsb_release -a --查看系統版本-CentOS Linux release 7.6
# timedatectl --查看當前系統時區
# ls -l /etc/localtime
# timedatectl list-timezones | grep 'Dubai' 或者grep 'Shanghai'查看國內時期。這裏我要修改成Dubai時間。
Asia/Dubai
# timedatectl set-timezone Asia/Dubai
# ll /etc/localtime
lrwxrwxrwx 1 root root 32 Apr 21 18:58 /etc/localtime -> ../usr/share/zoneinfo/Asia/Dubai
You need to use the ln command to set timezone on Centos 6. Type the following commands as root:
cp /etc/localtime /root/old.timezone rm /etc/localtime ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime Verify new settings by typing the following two commands: date ls -l /etc/localtime