1, command line run
sudo tzselect
2. Select the Continent (Asian Asia region)
[Email protected]:~$sudoTzselect[sudo] Password forWaichung:please Identify a location TimeZone rules can be set correctly. pleaseSelecta continent or ocean.1) Africa2) Americas3) Antarctica4) Arctic Ocean5) Asia6) Atlantic Ocean7) Australia8) Europe9) Indian OceanTen) Pacific Ocean One) None-i want to specify the Timezone using the Posix TZ format.#?5
3, select the country (here to choose China)
PleaseSelecta country.1) Afghanistan -) Israel *) Palestine2) Armenia +) Japan $) Philippines3) Azerbaijan -) JordanPanax Notoginseng) Qatar4) Bahrain +) Kazakhstan -) Russia5) Bangladesh A) Korea (north) the) Saudi Arabia6) Bhutan at) Korea (south) +) Singapore7) Brunei -) Kuwait A) Sri Lanka8) Cambodia -) Kyrgyzstan the) Syria9) China -) Laos +) TaiwanTen) Cyprus -) Lebanon -) Tajikistan One) East Timor -) Macau $) Thailand A) Georgia in) Malaysia $) Turkmenistan -) Hong Kong -) Mongolia -) Arab Emirates -) India to) Myanmar (Burma) -) Uzbekistan the) Indonesia +) Nepal the) Vietnam -) Iran -) Oman -) Yemen -) Iraq the) pakistan#?9
4. Choose Beijing-GMT
Select Time zone regions. 1 ) Beijingtime2) Xinjiang time#1
5. Select Yes
The following information has been Given:china Beijing Timetherefore TZ='Asia/shanghai'would be used. Local TimeIs Now:thu - the: +: -Cst .. Universal Time is Now:thu - -: +: -Utc .. is the above information OK?1) Yes2) no#?1You can MakeThis change permanent foryourself by appending the line TZ='Asia/shanghai'; export Tzto thefile '. profile' inchyour home directory; ThenLog out and loginchagain. Here is the TZ value again, this TimeOn, output So, youcan Use the/usr/bin/tzselect commandinchShell Scripts:asia/shanghai
Method 1: Add a line to the. profile file in the user directory, and then source ~/.profile to make it effective
Export tz='asia/shanghai'
Mode 2: Copy the appropriate time zone file into/etc directory
sudo CP /usr/share/zoneinfo/asia/shanghai /etc/localtime
6. Synchronization Time
sudo ntpdate pool.ntp.org - ntpdate[:26982time 193.228. 143.14 Offset-0.154279 sec
Ubuntu uses Tzselect to modify time zones