Linux命令列操作修改系統時區

來源:互聯網
上載者:User

# 儲存設定
$ sudo mv /etc/localtime /etc/localtime.old
# 設定時區
 
$ sudo ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
# 這裡已經改完了
 
# 更新某些檔案,這個檔案是由system-config-date命令讀取的
 
$ sudo vim /etc/sysconfig/clock
# 也可以用下面命令修改,會彈出一個GUI的操作介面
 
$ sudo system-config-date
# 從時間伺服器更新時間
 
$ sudo rdate -s nist1-ny.ustiming.org
# 系統時間同步到硬體
 
$ sudo hwclock --systohc
 
 
另外關於時區的一點知識分享:
 
GMT Greenwich Mean Time 格林尼治標準時間
UT Universal Time 世界時間
UTC Coordinated Universal Time UTC+0:00 國際標準時間
HKT Hong Kong Time UTC+8:00 香港標準時間
Linux下用date命令都能看到當前的時區。
Linux下中國時區都是用CST表示的。
但是這個表示方法非常不合理。因為CST同時代表了下面4個時區。
CST Central Standard Time (USA) UTC-6:00
CST Central Standard Time (Australia) UTC+9:30
CST China Standard Time UTC+8:00
CST Cuba Standard Time UTC-4:00


摘自 L_kernel的專欄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.