易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 2292|回复: 0
收起左侧

linux使用tzselect命令设置系统时间

[复制链接]
发表于 2021-7-12 08:56:35 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
[root@ceph1 ~]# tzselect
3 z9 k) H; |8 c) j) v0 @3 uPlease identify a location so that time zone rules can be set correctly.
$ F+ s4 n! L- x/ p5 G6 QPlease select a continent or ocean.0 n% o5 o( w7 m- Z: Z
1) Africa3 u) n% t! o. S6 C+ D
2) Americas
: K7 {8 b: h4 B& y$ T+ |  z 3) Antarctica3 Q* U: {# f1 `  h* l" b' E, [8 X
4) Arctic Ocean
5 O: \/ j7 A+ ^- E 5) Asia: }8 v% `& e$ R  w
6) Atlantic Ocean, O3 Q7 G! M3 l7 }( A- E
7) Australia; a! c# d: w3 Y* M! E- j
8) Europe7 A' M1 y; c4 G
9) Indian Ocean
/ S2 L, {- X0 S5 Q! @1 z) o" o10) Pacific Ocean
& q$ L; G! f: s6 R5 B9 d11) none - I want to specify the time zone using the Posix TZ format.# ]" O& f8 |/ N% S" N) W
#? 5
, ?, ]' Q8 ~2 G+ i* T' E9 J& [* ]Please select a country.
% G" O: F8 E- o8 F0 c; Q 1) Afghanistan    18) Israel      35) Palestine! Y( e  p0 [+ f* A- {. K# j
2) Armenia    19) Japan      36) Philippines
- ^! T) G; \& v/ w3 i; ]0 m 3) Azerbaijan    20) Jordan      37) Qatar) x8 F/ p" x  Q; E
4) Bahrain    21) Kazakhstan     38) Russia
; e. }# g. v  J* ~ 5) Bangladesh    22) Korea (North)     39) Saudi Arabia
/ F: {" t! ?! L& F: d  _( g 6) Bhutan    23) Korea (South)     40) Singapore# U; O4 P  K& j
7) Brunei    24) Kuwait      41) Sri Lanka% [: E. r, o# l) J
8) Cambodia    25) Kyrgyzstan     42) Syria
% [# j5 N: }3 f: A9 x4 R- D) T" N$ ? 9) China    26) Laos      43) Taiwan( b  N+ o, W- W/ D8 ~/ r9 `; v
10) Cyprus    27) Lebanon      44) Tajikistan
/ g, {( i- G) }( l11) East Timor    28) Macau      45) Thailand
* V% ]# j/ Q8 g5 _" _' Q$ [* l6 A3 }12) Georgia    29) Malaysia      46) Turkmenistan* ^% y" K( U0 A/ L3 e' A$ h4 M
13) Hong Kong    30) Mongolia      47) United Arab Emirates
7 X! x8 S4 v4 I" g! s; |14) India    31) Myanmar (Burma)     48) Uzbekistan: p2 [6 x/ }4 N$ w- _2 {7 U7 @
15) Indonesia    32) Nepal      49) Vietnam
4 M, K  Q5 ^* t! S: f16) Iran    33) Oman      50) Yemen1 W/ U' [( G9 z5 g" @( \& _: w. @
17) Iraq    34) Pakistan
# I/ I# h/ m3 W9 F#? 94 K  ]$ P& S! @
Please select one of the following time zone regions.
- D$ t9 Z( k' r) n8 V8 W' j1) Beijing Time
  L6 M2 n; i' G6 K  M2) Xinjiang Time- Q$ o/ K# s+ u% u! C$ L
#? 12 V9 c: M& A" w+ X- V) u
The following information has been given:
. o  g9 |' [4 U China
9 e8 c1 P' n) @7 N! c$ @* { Beijing Time
* W# z9 a* j) F5 f7 {Therefore TZ='Asia/Shanghai' will be used.$ L4 v, c" y8 e( ]0 ~
Local time is now: Mon Jul 12 08:54:21 CST 2021.
/ ^. |6 y' A) @5 @0 B9 mUniversal Time is now: Mon Jul 12 00:54:21 UTC 2021.9 ~( P+ {( _  q* u9 \, x* K* o- l
Is the above information OK?* Y; Z0 q3 U$ B" Z
1) Yes, z& K! d' _8 z5 r) W
2) No
" E; a& X: A! L0 R#? 1: L' z3 H% V* }- V
You can make this change permanent for yourself by appending the line
3 a  X5 v+ b1 T1 K TZ='Asia/Shanghai'; export TZ- N3 L) l' ^0 f3 n8 Y
to the file '.profile' in your home directory; then log out and log in again.; T$ |2 N* b3 t! L  ~% X9 Z' E
Here is that TZ value again, this time on standard output so that you
) ?4 z2 N( j& Q9 y! `can use the /usr/bin/tzselect command in shell scripts:; x$ B! b( v/ M0 z' F, J
Asia/Shanghai
. G, R- D. W5 u/ k9 ?5 E[root@ceph1 ~]# . X" U: ~- Y: Y" M; [! H
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:37 , Processed in 0.040735 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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