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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-7-12 08:56:35 | 显示全部楼层 |阅读模式
[root@ceph1 ~]# tzselect + q' u! e  z1 H: i. O) A/ E& f# f
Please identify a location so that time zone rules can be set correctly.3 s$ c; Q% [0 t: Q
Please select a continent or ocean.
: S7 O# ~) n3 C 1) Africa+ P5 u- j* C, r! h2 \
2) Americas
( h  h: h2 H0 } 3) Antarctica" d* d: @- k. e4 d; N
4) Arctic Ocean
% ~/ w$ O0 g( d 5) Asia. G1 M" i/ L# D8 p3 ]/ G1 v
6) Atlantic Ocean3 m$ N+ s3 g. U7 ^2 H
7) Australia# p4 u9 O! p( X3 |' d% I6 A
8) Europe
& m! j$ C2 y3 |8 C( n  ^2 I 9) Indian Ocean4 W/ @& k; o' r. n- p
10) Pacific Ocean
  ^& _1 g) R/ n( Z2 h11) none - I want to specify the time zone using the Posix TZ format.7 o# b* X5 h. M5 N7 D$ F& W2 L& _
#? 59 ]3 Y6 K7 G; i5 ~% o' ]) C
Please select a country.. L( R7 I9 o6 ?1 b/ l: R
1) Afghanistan    18) Israel      35) Palestine
& |0 g1 t/ t' H" m 2) Armenia    19) Japan      36) Philippines4 r; }8 b% {( D3 N6 Z- q- k: c
3) Azerbaijan    20) Jordan      37) Qatar
% ]/ a  n% k+ i1 w, v2 I4 { 4) Bahrain    21) Kazakhstan     38) Russia4 m( a7 e+ Y2 \7 O) t4 N
5) Bangladesh    22) Korea (North)     39) Saudi Arabia5 r" ]7 ?! T" Z3 r1 I3 Y
6) Bhutan    23) Korea (South)     40) Singapore
0 ~  ~$ \2 }7 R( X, k6 v 7) Brunei    24) Kuwait      41) Sri Lanka7 w7 u# R6 _* e" O  {! g: ]' _
8) Cambodia    25) Kyrgyzstan     42) Syria
: |, X5 Y5 X7 i' @ 9) China    26) Laos      43) Taiwan6 k" X9 b. t5 z( p
10) Cyprus    27) Lebanon      44) Tajikistan
9 B$ U% Z' u1 |6 u4 @11) East Timor    28) Macau      45) Thailand5 @* L, ]$ Q7 R
12) Georgia    29) Malaysia      46) Turkmenistan9 _/ U- l# P  r: E* J' \7 D& \
13) Hong Kong    30) Mongolia      47) United Arab Emirates
3 p) g& q( Y: t* r: M# m14) India    31) Myanmar (Burma)     48) Uzbekistan5 Y) H: n( g: s! e/ k# o
15) Indonesia    32) Nepal      49) Vietnam
: T2 x6 ?$ n$ u- W# @% d9 a16) Iran    33) Oman      50) Yemen
4 @0 e* L, G: o4 r! R0 h# ]17) Iraq    34) Pakistan
. H1 T$ O% j" a! g1 p) u#? 93 `( u3 p1 m' V3 D, w
Please select one of the following time zone regions.0 j# q, d' g1 x6 }6 Z( c
1) Beijing Time
3 D$ o9 p; B( n$ h& \4 Y! @9 H2) Xinjiang Time
( x( X6 w0 u: a6 Q  C9 l: P( h6 Q#? 1/ C) Y$ D5 z! }) v. {
The following information has been given:
; ?. @5 G2 s- y  u8 e! |1 ? China
1 Y4 Z9 K, Y. ~) [! D: l/ H2 { Beijing Time
( Q4 x% O2 q8 H: ~, jTherefore TZ='Asia/Shanghai' will be used.* Q3 I2 h( a5 B7 z
Local time is now: Mon Jul 12 08:54:21 CST 2021.2 j5 y5 _( J) x' R. W) G
Universal Time is now: Mon Jul 12 00:54:21 UTC 2021.
* w3 o3 I1 S) m7 z& f% g9 hIs the above information OK?
; J; H3 Z, Q% G, c8 p( @1) Yes
* f6 l4 b# L+ d, _4 m: [2) No
) @& f8 d+ t/ w7 s* Z9 j) l$ T# t#? 1# p' x; l7 w8 z. \+ V3 _& `
You can make this change permanent for yourself by appending the line
7 o: D2 c# u& Y# F TZ='Asia/Shanghai'; export TZ
% y/ E( V- {3 a2 N3 q! d: uto the file '.profile' in your home directory; then log out and log in again.  @& S( Z: m0 `1 ?1 j+ u- c% m- Z! G/ `
Here is that TZ value again, this time on standard output so that you% l( ]5 G' Y/ _- x( j
can use the /usr/bin/tzselect command in shell scripts:& c7 Z3 W4 Q& R) x( d  U( C
Asia/Shanghai
, b) F& s7 s/ q' b8 |[root@ceph1 ~]#
; k0 t) _2 E/ J# D
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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