查看/修改Linux時區和時間

來源:互聯網
上載者:User

 

 

一、時區

    1. 查看當前時區

            date -R

    2. 修改設定時區

       方法(1)

            tzselect

       方法(2) 僅限於RedHat Linux 和 CentOS

            timeconfig

       方法(3) 適用於Debian

            dpkg-reconfigure tzdata

     3. 複製相應的時區檔案,替換系統時區檔案;或者建立連結檔案

            cp /usr/share/zoneinfo/$主時區/$次時區 /etc/localtime

         在中國可以使用:

            cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

二、時間

      1、查看時間和日期

              date

      2、設定時間和日期

           將系統日期設定成1996年6月10日的命令

              date -s 06/22/96

           將系統時間設定成下午1點52分0秒的命令

              date -s 13:52:00

      3. 將目前時間和日期寫入BIOS,避免重啟後失效

              hwclock -w

 

 

備忘:

      更詳細的命令說明請參加man

 

參考:

      http://www.bitscn.com/linux/system_manage/200604/6898.html

      http://www.hypexr.org/linux_date_time_help.php

      http://www.debianadmin.com/ntp-server-and-client-configuration-in-debian.html

      http://www.time.ac.cn/stime.asp

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.