Ads 468x60px

##EasyReadMore##

12 12月, 2017

時間區域設置

# 列出可用時區 /usr/share/zoneinfo
ls /usr/share/zoneinfo
Africa Asia Canada Cuba EST Factory GMT0 Hongkong Iran Japan Mexico Navajo Poland PRC ROK Universal W-SU
America Atlantic CET EET EST5EDT GB GMT-0 HST iso3166.tab Kwajalein Mideast NZ Portugal PST8PDT Singapore US zone.tab
Antarctica Australia Chile Egypt Etc GB-Eire GMT+0 Iceland Israel Libya MST NZ-CHAT posix right Turkey UTC Zulu
Arctic Brazil CST6CDT Eire Europe GMT Greenwich Indian Jamaica MET MST7MDT Pacific posixrules ROC UCT WET

# 設置時區
timedatectl set-timezone Asia/Hong_Kong
# 查看時區
timedatectl
# 修改時區並立即生效
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock
# 演示如下,你可以看到時區從 EDT 變為 CST
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date
# Fri Jul 4 05:57:25 EDT 2014
# 執行 hwclock 後會立即生效
hwclock
# Fri 04 Jul 2014 06:12:14 PM CST -0.219192 seconds
date
# Fri Jul 4 18:12:17 CST 2014

Refer:
  第 5 章 区域设置 - https://goo.gl/MqY9u5

0 意見:

張貼留言

 
Blogger Templates