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

沒有留言:

Windows Server因為Windows update後,導致自動重啟或是自動重新開機

從 Windows Server 2016 開始,微軟確實改變了更新機制,使其行為更接近消費端的 Windows 10,這在伺服器管理上引發了不少討論。 以下為您確認微軟在 Windows Server 2016 上的具體行為: 1. 預設行為:自動下載與安裝 在 Windows...