易陆发现互联网技术论坛

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

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

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

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

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

x
[root@ceph1 ~]# tzselect ; f3 f9 N( I3 G1 |3 r" G0 T" y) i1 A
Please identify a location so that time zone rules can be set correctly.
, l7 a2 `9 m% v% A. z$ oPlease select a continent or ocean.
6 P& t6 j# L6 K- K* Z' u8 P* Q9 Q 1) Africa9 ]' v. Z& R$ A' K
2) Americas
2 k. q( r+ m; L1 Y& R 3) Antarctica
" ?% k0 ~, Y2 j 4) Arctic Ocean2 O. v& t! f0 B
5) Asia2 x5 @! Y) e9 g3 K' L3 o
6) Atlantic Ocean
+ d; X5 j- P" |- ~. p0 b5 M) s" d& j 7) Australia( c8 I' ?: [2 V
8) Europe& ^$ q. l+ G5 i6 @
9) Indian Ocean
1 Z% V% o' z6 H4 B* m# u10) Pacific Ocean
! X$ Y2 I+ S* B" U5 L5 w. N2 }11) none - I want to specify the time zone using the Posix TZ format.  U# ^. t0 a- s; Z' ^7 P3 h$ P
#? 5
+ f+ a  w! D  X% q) J% h; _Please select a country.
" ]: S# Y* Y$ J" r) a' S. u% A$ ^ 1) Afghanistan    18) Israel      35) Palestine
) V9 ?3 {+ r* G( }% R) c6 g6 _ 2) Armenia    19) Japan      36) Philippines
6 k/ R! A# s8 b+ j9 q8 `6 V 3) Azerbaijan    20) Jordan      37) Qatar
, j! K1 H- K7 m2 S; e4 I 4) Bahrain    21) Kazakhstan     38) Russia$ O  T0 N1 j' _' a. G
5) Bangladesh    22) Korea (North)     39) Saudi Arabia
2 t* N. s( Z3 E 6) Bhutan    23) Korea (South)     40) Singapore
7 _! t! ?: `8 R3 M/ N 7) Brunei    24) Kuwait      41) Sri Lanka( F5 v" g8 m1 b
8) Cambodia    25) Kyrgyzstan     42) Syria" y0 ?$ f! t* H# Y5 }6 J
9) China    26) Laos      43) Taiwan) \- |9 E( ?9 _6 B# b
10) Cyprus    27) Lebanon      44) Tajikistan9 L& D6 b# f% V8 n7 v
11) East Timor    28) Macau      45) Thailand' m3 z7 e& G8 ^* Y; ?7 X
12) Georgia    29) Malaysia      46) Turkmenistan
. ~4 G/ r3 o. z& s1 r6 N13) Hong Kong    30) Mongolia      47) United Arab Emirates
  T1 j2 A* Z1 B' l7 R14) India    31) Myanmar (Burma)     48) Uzbekistan5 B  k1 D0 ?1 M' W
15) Indonesia    32) Nepal      49) Vietnam
8 u7 a, e4 E* L8 o" D. c1 V8 C16) Iran    33) Oman      50) Yemen
5 T2 d9 K3 k' S1 h17) Iraq    34) Pakistan
9 B4 }& o( E% ?7 V. Z#? 9; K# n/ F8 p  g  U1 r+ s0 {
Please select one of the following time zone regions.0 D2 c! V  e% l- y  E2 u
1) Beijing Time2 N4 i( m8 W3 `+ ^& X6 M  M
2) Xinjiang Time3 N$ [5 B" u" v& l
#? 1: Y* b$ ~1 k! T
The following information has been given:$ X) R/ [, ]! H, X5 f! \7 t" Z
China! s* x% z0 c! e' u' W' L, R8 P
Beijing Time
( w& x5 D- I: k0 z' ITherefore TZ='Asia/Shanghai' will be used.( G( `5 O4 u" j0 K
Local time is now: Mon Jul 12 08:54:21 CST 2021.
/ p6 O+ N/ @$ D7 X& N8 ~Universal Time is now: Mon Jul 12 00:54:21 UTC 2021.
8 Y" Q7 h- U/ J* r0 a9 y5 ^Is the above information OK?
; ~0 Q) F) R1 \1) Yes0 t/ ?: f- B0 J
2) No6 |+ R# s7 Z8 {5 O8 p% C  n3 r% F% [
#? 1
: N  o* k) s, c: v6 Y2 n5 z% k# WYou can make this change permanent for yourself by appending the line, R2 Q* g8 k( r: d, Z% I/ |7 }* b
TZ='Asia/Shanghai'; export TZ+ w% D4 F: d# f) s
to the file '.profile' in your home directory; then log out and log in again.
$ E" z# w& z& r7 o  fHere is that TZ value again, this time on standard output so that you
9 z2 Z& r. D0 y4 L4 i, Ucan use the /usr/bin/tzselect command in shell scripts:
  k  O) f$ N9 v2 yAsia/Shanghai: Q5 h3 h+ ^1 x& @
[root@ceph1 ~]#
# V- a6 F. w6 D) E' x: S9 Q
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 21:39 , Processed in 0.057105 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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