找回密码
 注册
查看: 2622|回复: 0

ubuntu设置时区相关步骤tzselect

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-6-29 10:15:40 | 显示全部楼层 |阅读模式
root@ubuntu:~# tzselect 8 a) [- U' p: u; P" f
Please identify a location so that time zone rules can be set correctly.
- `6 O6 ~) p! d" Z( f; `: ?Please select a continent, ocean, "coord", or "TZ".: R( D/ A7 \* I  J$ R  h3 G5 L! I; M
1) Africa
- N  ^# D- z, ]# Z 2) Americas
  l+ O) L" I3 j/ @1 \* W 3) Antarctica
6 w* m- g2 J2 [3 @" `0 ^: i- ^ 4) Asia  a# y0 d) r3 h4 J) T5 }% q
5) Atlantic Ocean
% U1 V9 u' p  m) B" c" c 6) Australia
: P: x2 k% `$ n( s 7) Europe) T9 [$ N6 N- }0 u3 z
8) Indian Ocean( t3 C3 H' K+ `, ?5 L/ l
9) Pacific Ocean# T' u1 G$ _6 u" W# c4 P
10) coord - I want to use geographical coordinates.# r& s" `8 W' G8 f" h7 H
11) TZ - I want to specify the timezone using the Posix TZ format.5 ~# ]3 ^* E5 d! r7 }
#? 4
7 u5 a3 w2 X9 w8 l* V, pPlease select a country whose clocks agree with yours.
0 V8 f! B. d- z4 x0 _ 1) Afghanistan    18) Israel      35) Palestine8 ~( f" n# Y; y1 ~9 B( _
2) Armenia    19) Japan      36) Philippines6 J" ?% L8 `6 X
3) Azerbaijan    20) Jordan      37) Qatar
7 G8 C$ ~# ?1 o% e 4) Bahrain    21) Kazakhstan     38) Russia& l: c: j7 \" N# ?
5) Bangladesh    22) Korea (North)     39) Saudi Arabia
6 _9 W0 e- [, ^8 B: N8 v3 {. C 6) Bhutan    23) Korea (South)     40) Singapore
1 g, I3 _7 a' c7 s9 ?* D. b 7) Brunei    24) Kuwait      41) Sri Lanka
, k6 R9 H% I6 _! s& V 8) Cambodia    25) Kyrgyzstan     42) Syria
) X) o2 o! j# Z  K8 B 9) China    26) Laos      43) Taiwan
: z5 h; V! e$ ]10) Cyprus    27) Lebanon      44) Tajikistan' O' P. g) s4 ?
11) East Timor    28) Macau      45) Thailand
1 |' O* ^3 W5 G$ Y: Z12) Georgia    29) Malaysia      46) Turkmenistan
2 a, i  c2 l) {; J# o- |13) Hong Kong    30) Mongolia      47) United Arab Emirates
; @# A) C4 _; R- A. n14) India    31) Myanmar (Burma)     48) Uzbekistan
5 z( V6 @3 s. M  e5 R15) Indonesia    32) Nepal      49) Vietnam8 p% T2 d4 G1 \6 H- Y
16) Iran    33) Oman      50) Yemen
" {. e7 Q/ Q, d. [5 t5 @17) Iraq    34) Pakistan
9 K* x1 X' J  I# O6 S* f#? 9
1 h4 k" f( R/ j% UPlease select one of the following timezones./ Z7 S+ A2 c- X( p* t" \* M, f
1) Beijing Time
- F9 v( ~5 {! t& _  S' b2) Xinjiang Time3 s0 `4 N( c9 a+ G
#? 1
) ^' G+ S4 `9 m3 ]The following information has been given:
5 J# G4 r3 Z  y  ~) G5 |: R# ?# W China
. `/ U; p7 N, q1 J; d: [ Beijing Time8 ^; H1 Q: }- v1 x  _# @. R. a
Therefore TZ='Asia/Shanghai' will be used.
4 y- u8 K! ^5 J9 OSelected time is now: Tue Jun 29 10:12:36 CST 2021.% ]+ }4 ~, g# L4 \" Z3 L3 Y7 E8 P
Universal Time is now: Tue Jun 29 02:12:36 UTC 2021.
% R0 c4 \. `5 n1 AIs the above information OK?
* n! N4 P8 O$ x1) Yes& w7 w" ~6 F3 c" w7 }! B
2) No% j( d: r. ~. B( L" g/ P# p
#? 1
: n' E, }4 S: r. [0 \) ~You can make this change permanent for yourself by appending the line' t+ S* @/ r8 i4 q
TZ='Asia/Shanghai'; export TZ# r+ }1 z0 `, Q! r2 h
to the file '.profile' in your home directory; then log out and log in again.3 L" H5 T0 y  |
Here is that TZ value again, this time on standard output so that you
9 J, v# I4 }2 ~  X' @can use the /usr/bin/tzselect command in shell scripts:8 o" W$ j  U; J6 ]
Asia/Shanghai
% ?3 {4 O6 C" ?" F' C- F  r. Uroot@ubuntu:~# date
) Z6 |. @) c1 i/ ]/ ITue 29 Jun 2021 10:12:46 AM CST# J, |, T0 H' z5 X# Y. {$ X

$ g- Q! i( J6 L- J( p  |' _8 z& F. ]1 e+ w% r6 U8 F0 S6 a
或者cp timezonf文件:$ t8 x. D' M* Y* {/ C0 f/ i
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime   ?% m5 D$ v0 Y, \% x8 t
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
7 Q( C7 ^$ s7 C. q1 x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 04:30 , Processed in 0.016983 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表