林威治时间多了
8
小时,因为我们会比½早看到太阳啦!
那我怎么知道目前的时区设定是正确的呢?
就透过
timedatectl
这个指令吧!
[root@study ~]#
timedatectl [commamd]
选项
参数
list
-
timezones
:列出系
上所有支持的
时区
set
-
timezone
时区
位置
set
-
time
时间
set
-
ntp
定网
# 1.
示目前的
时区
时间
等信息
[root@study ~]#
timedatectl
Local time: Tue 2015
-
09
-
01 19:50:09 CST
#
本地
时间
Universal time: Tue 2015
-
09
-
01 11:50:09 UTC
# UTC
时间
,可
称为
格林威治
时间
RTC time: Tue 2015
-
09
-
01 11:50:12
Timezone: Asia/Taipei (CST, +0800)
#
就是
时区啰
NTP enabled: no
NTP
synchronized: no
RTC in local TZ: no
DST active: n/a
# 2.
示出是否有
New_York
时区
?若有,
则请½
目前的
时区
更新一下
[root@study ~]#
timedatectl list
-
timezones | grep
-
i new
America/New_York
America/North_Dakota/New_Salem
[root@study ~]#
timedatectl set
-
timezone "America
/New_York"
[root@study ~]#
timedatectl
Local time: Tue 2015
-
09
-
01 07:53:24 EDT
Universal time: Tue 2015
-
09
-
01 11:53:24 UTC
RTC time: Tue 2015
-
09
-
01 11:53:28
Timezone: America/New_York (EDT,
-
0400)
[root@study ~]#
timedatectl
set
-
timezone "Asia/Taipei"
#
最后
是要
得改回
湾时区
喔!不要忘
了!
.
时间的调整
由于鸟哥的测试机使用的是虚拟机,预设虚拟机使用的是
UTC
时间而不是本地时间,所以在预设的
情况下,测试机每次开机都会快上
8
小时
...
所以就需要来调整一下时间啰!时间的格式可以是
yyyy-mm-dd HH:MM
』的格式!比½方便记忆喔!
# 1.
½时间调
整到正确的
时间点
上!
[root@study ~]#
timedatectl set
-
time "2015
-
09
-
01
12:02"