本文共 2077 字,大约阅读时间需要 6 分钟。
目录
timeconfig
system-config-date
[root@ntp ~]# cat /etc/sysconfig/clockZONE="Asia/Harbin"UTC=trueARC=false
# tzselectPlease identify a location so that time zone rules can be set correctly.Please select a continent or ocean. 1) Africa 2) Americas 3) Antarctica 4) Arctic Ocean 5) Asia 6) Atlantic Ocean 7) Australia 8) Europe 9) Indian Ocean10) Pacific Ocean11) none - I want to specify the time zone using the Posix TZ format.#?
重新启动后生效
列出时区
# timedatectl list-timezones
设置时区
# timedatectl set-timezone Asia/Hong_Kong
查看时区
# timedatectl
可用时区 /usr/share/zoneinfo
[root@ntp ~]# ls /usr/share/zoneinfoAfrica Asia Canada Cuba EST Factory GMT0 Hongkong Iran Japan Mexico Navajo Poland PRC ROK Universal W-SUAmerica Atlantic CET EET EST5EDT GB GMT-0 HST iso3166.tab Kwajalein Mideast NZ Portugal PST8PDT Singapore US zone.tabAntarctica Australia Chile Egypt Etc GB-Eire GMT+0 Iceland Israel Libya MST NZ-CHAT posix right Turkey UTC ZuluArctic Brazil CST6CDT Eire Europe GMT Greenwich Indian Jamaica MET MST7MDT Pacific posixrules ROC UCT WET
执行 hwclock 后会立即生效
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime# hwclock
演示如下,你可以看到时区从 EDT 变为 CST
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime# dateFri Jul 4 05:57:25 EDT 2014# hwclockFri 04 Jul 2014 06:12:14 PM CST -0.219192 seconds# dateFri Jul 4 18:12:17 CST 2014
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by Disqus 原文出处:Netkiller 系列 手札 本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。