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

ubuntu设置时区相关步骤tzselect

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-6-29 10:15:40 | 显示全部楼层 |阅读模式
root@ubuntu:~# tzselect , R- L3 d: a- `* t  {5 ~5 a
Please identify a location so that time zone rules can be set correctly.
, y& ]" a+ `5 NPlease select a continent, ocean, "coord", or "TZ".' X% k. `; M9 B# U7 `) w, T. N- b
1) Africa  Z0 _5 T) S3 e4 c& M
2) Americas
' g( P9 U: Y! l* N, q7 h6 r9 p  m 3) Antarctica, D" l) A% m8 x7 f
4) Asia
: e: n/ A9 r% Z 5) Atlantic Ocean
7 l/ D- b& a+ T! m# ?2 Z+ l1 y2 X 6) Australia7 N3 d: D& v1 C
7) Europe
* s4 J+ [3 T8 m2 x. y/ | 8) Indian Ocean
: p: W6 u; P7 I* U+ a) V 9) Pacific Ocean
7 b0 s1 ~# X) K7 n  L" t2 K10) coord - I want to use geographical coordinates.
7 |9 f" u- b' J: }9 V; v! J11) TZ - I want to specify the timezone using the Posix TZ format.
3 [& y8 ]" _( S5 ?; C#? 4( U* O5 f0 c/ k8 b, `
Please select a country whose clocks agree with yours.- ^9 {" X; d5 Y/ n. B
1) Afghanistan    18) Israel      35) Palestine
1 l$ G. t, r: h# m5 q' ~ 2) Armenia    19) Japan      36) Philippines
3 b* ?) \; u4 o6 r, c2 n0 X: Z( ]- U4 ? 3) Azerbaijan    20) Jordan      37) Qatar) v+ g. j( y4 r$ I
4) Bahrain    21) Kazakhstan     38) Russia9 e: c' x! F3 K$ q! y
5) Bangladesh    22) Korea (North)     39) Saudi Arabia" O: ^2 B5 o# ?9 H, A& K
6) Bhutan    23) Korea (South)     40) Singapore( _+ p6 K& L  w/ _/ t# X5 L
7) Brunei    24) Kuwait      41) Sri Lanka/ [+ Y* R3 \1 {0 d- o
8) Cambodia    25) Kyrgyzstan     42) Syria
. r3 H3 G1 T% a! z3 B% p% m 9) China    26) Laos      43) Taiwan6 x" g( @7 I8 S# m) ~
10) Cyprus    27) Lebanon      44) Tajikistan
" |. x" h5 h: b+ e7 Z11) East Timor    28) Macau      45) Thailand
5 u  _" z+ v, ~! `12) Georgia    29) Malaysia      46) Turkmenistan
' ]: X+ w5 i( s/ d* y8 D3 _13) Hong Kong    30) Mongolia      47) United Arab Emirates
0 X% W% f5 ]1 }14) India    31) Myanmar (Burma)     48) Uzbekistan
9 |0 F* F! a8 z8 ?15) Indonesia    32) Nepal      49) Vietnam
2 P4 y7 Q& H6 ]) ]16) Iran    33) Oman      50) Yemen
; ~1 }; q% k- `0 o! T. L" X; }17) Iraq    34) Pakistan! |  p# o" E. o3 S  f3 }  U0 N1 P3 b( y
#? 9
2 i# o! \/ `, w- WPlease select one of the following timezones., o5 x0 T$ h. V; B* N# R
1) Beijing Time3 ?# O: E  l+ ?  A2 d! E
2) Xinjiang Time* x9 X" r6 X: I+ r
#? 1/ W! x8 K, I  P0 _' `4 k5 H
The following information has been given:) ^# {6 ~9 a8 J( [6 z8 I0 b
China
0 J" K/ W+ ?* ^+ \, v% ^ Beijing Time' T. w" A- i) Y
Therefore TZ='Asia/Shanghai' will be used.
" J( r) y" K/ H: f& t! w( W: BSelected time is now: Tue Jun 29 10:12:36 CST 2021.1 Y8 d4 y8 G- s3 e0 H* B* p
Universal Time is now: Tue Jun 29 02:12:36 UTC 2021.: v; C- q% F! @5 j
Is the above information OK?( n. D; ]6 Q) X- b( E
1) Yes
) [4 ]* E' K3 V* {2) No' A3 s& r# Y9 ?3 o+ F; i. _
#? 1' E. i- t2 Z2 e8 |1 S5 ]
You can make this change permanent for yourself by appending the line
3 \& o7 }$ }4 H* N7 |: n TZ='Asia/Shanghai'; export TZ
) }. U8 Z4 E, X' vto the file '.profile' in your home directory; then log out and log in again.
0 z- t. A* t, @" C( ^5 |: qHere is that TZ value again, this time on standard output so that you& B( c8 I8 T4 Z! }7 ~* O
can use the /usr/bin/tzselect command in shell scripts:; V+ n' J1 `1 N; T4 L/ L+ R
Asia/Shanghai: m6 s* H1 r! _' t" @$ a
root@ubuntu:~# date* g  W+ X3 z  R0 |$ F. w2 h
Tue 29 Jun 2021 10:12:46 AM CST) L8 H" {8 q' b( E* k0 S

* A& j: u' Q) P4 |: w4 z5 S4 I: y7 k8 q7 ^
或者cp timezonf文件:" i( W# C6 w9 x$ B, b
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# q( p2 S9 W) Q' qln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
5 L* I2 Q7 F$ l. w7 p! Q2 k5 O6 K: u) j: b
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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