date命令:查看当前时间
DESKTOP-R5E7NDM:~ # date
Wed Nov 27 02:07:58 UTC 2019
同步网络时间
安装ntp服务命令:
DESKTOP-R5E7NDM:~ # zypper in ntp
Loading repository data...
Reading installed packages...
Resolving package dependencies...
ntpdate 服务器IP:同步服务器时间
ntp常用服务器:
中国国家授时中心:210.72.145.44
NTP服务器(上海) :ntp.api.bz
美国:time.nist.gov
复旦:ntp.fudan.edu.cn
微软公司授时主机(美国) :time.windows.com
台警大授时中心(台湾):asia.pool.ntp.org
DESKTOP-R5E7NDM:~ # ntpdate -dv ntp.api.bz
27 Nov 04:39:23 ntpdate[900]: ntpdate 4.2.8p13@1.3847-o (1)
Looking for host ntp.api.bz and service ntp
host found : 114.118.7.163
未完,还是没同步,修改时区
tzselect
DESKTOP-R5E7NDM:~ # tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
1) Africa
2) Americas
3) Antarctica
4) Asia
5) Atlantic Ocean
6) Australia
7) Europe
8) Indian Ocean
9) Pacific Ocean
10) coord - I want to use geographical coordinates.
11) TZ - I want to specify the timezone using the Posix TZ format.
#? 4
Please select a country whose clocks agree with yours.
1) Afghanistan 14) India 27) Lebanon 40) Singapore
2) Armenia 15) Indonesia 28) Macau 41) Sri Lanka
3) Azerbaijan 16) Iran 29) Malaysia 42) Syria
4) Bahrain 17) Iraq 30) Mongolia 43) Taiwan
5) Bangladesh 18) Israel 31) Myanmar (Burma) 44) Tajikistan
6) Bhutan 19) Japan 32) Nepal 45) Thailand
7) Brunei 20) Jordan 33) Oman 46) Turkmenistan
8) Cambodia 21) Kazakhstan 34) Pakistan 47) United Arab Emirates
9) China 22) Korea (North) 35) Palestine 48) Uzbekistan
10) Cyprus 23) Korea (South) 36) Philippines 49) Vietnam
11) East Timor 24) Kuwait 37) Qatar 50) Yemen
12) Georgia 25) Kyrgyzstan 38) Russia
13) Hong Kong 26) Laos 39) Saudi Arabia
#? 9
Please select one of the following timezones.
1) Beijing Time
2) Xinjiang Time
#? 1
最后一步
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
DESKTOP-R5E7NDM:~ # date
Wed Nov 27 14:03:49 CST 2019