2021年4月27日 星期二

Centos7 時區 指令範例

Centos7 時區 指令範例

linux 指令久沒用,很容易忘記。
-----------------

查看時區的設定為何?
# timedatectl

 

設定目前"日期":
# timedatectl set-time <YYYY-MM-DD>

設定目前"時間":
# timedatectl set-time <HH:MM:SS>

 

啟用UTC時間:
# timedatectl set-local-rtc no

關閉UTC時間,使用本地時間:
# timedatectl set-local-rtc yes

 

查看所有時區:
# timedatectl list-timezones

設定時區區域:
# timedatectl set-timezone Asia/Taipei

 

與NTP server同步:
# timedatectl set-ntp yes

 

與NTP Server同步後再寫到Hardware Clock:
# ntpdate -s time.stdtime.gov.tw
# hwclock --systohc

沒有留言:

VMware VCenter 6.7設定Log Server失敗

VMware VCenter 6.7設定Log Server失敗 使用vCenter 6.7 設定步驟 開啟 VAMI 介面:開啟瀏覽器,輸入 https://<您的vCenter_IP>:5480。  登入:使用 root 帳號及其密碼登入。  進入 Syslog:...