centos 修改时区_mysql 修改时区_centos7 修改时区
Time zone: Asia/Shanghai (CST, +0800)
NTPenabled: yes
NTP synchronized: yes
RTC in local TZ: no
DSTactive: n/a
[root@node3 ~]#
1、cp /usr/share/zoneinfo/asia/shanghai /etc/localtime。ln -s /usr/share/zoneinfo/asia/shanghai /etc/localtime。ln -s /usr/share/zoneinfo/asia/shanghai /etc/localtime 。
链接到上海时区文件
ln -sf /usr/share/zoneinfo/Asia/Shanghai/etc/localtime
执行完上述过程后centos 修改时区,重启机器,即可看到时区已经更改。
其实是马上生效了。
此时查看timedatectl也可以看到时区改了。
方法三,不好用,重启或者系统有异常时会还原成原来的时区。(难道是我的系统问题?)
#tzselect
选择5asia,9china,1北京,1yes。
提示在/root/profile下加入
TZ='Asia/Shanghai'; export TZ
并且#source /root/profile
[root@node2 ~]# tzselect
Please identify a location so that time zone rules can be setcorrectly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZformat.
Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea(North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) SriLanka
8) Cambodia 25)Kyrgyzstan 42)Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27)Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29)Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) UnitedArab Emirates
14) India 31) Myanmar (Burma) 48)Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
The following information has been given:
China
Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Fri Nov 30 11:29:18 CST 2018.
Universal Time is now: Fri Nov 30 03:29:18UTC 2018.
Is the above information OK?
1) Yes
2) No
You can make this change permanent for yourself by appendingthe line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log outand log in again.
Here is that TZ value again, this time on standard output sothat you
in csh, this command sets the environment variable path, such that the shell will search for files in the /bin, /usr/bin, /usr/sbin and /usr/local/bin directories, in that order.。shell scripts where the underling shell accepts a ''-c'' argument can use the linux/sh386 format. upx decompresses the shell scriptinto low memory, then maps the shell and passes the entire text of the script as an argument with a leading ''-c''. it does not use space in /tmp, and does notuse /proc.。the/usr/java symbolic link can change the default java platform because there are symbolic links in/usr/bin (also known as/bin) that use it. (for example, the/usr/bin/java link refers to/usr/java/bin/java, which is the java 2 runtime environment). many java applications are compatible with later versions of the java platform, but some applications might be less compatible.。
Asia/Shanghai
[root@node2 ~]#
方法二:好用
链接到上海时区文件
#ln -s /usr/share/zoneinfo/asia/shanghai /etc/localtime。ln -s /usr/share/zoneinfo/asia/shanghai /etc/localtime。ln -s /usr/share/zoneinfo/asia/shanghai /etc/localtime 。
执行完上述过程后centos 修改时区,重启机器,即可看到时区已经更改。
其实是马上生效了。
让美彻底放弃冷战思维除非衰退加速