【CentOS】localtime

來源:互聯網
上載者:User

標籤:centos localtime zoneinfo

[[email protected] etc]# ls -al localtime*

lrwxrwxrwx. 1 root root 38 11月 26 03:32 localtime -> ../usr/share/zoneinfo/America/New_York

[[email protected] etc]# date

2016年 03月 12日 星期六 00:00:57 EST

[[email protected] etc]#


////// ln -s ../usr/share/zoneinfo/Asia/Shanghai localtime


[[email protected] etc]# rm -rf localtime

[[email protected] etc]# ls -s ../usr/share/zoneinfo/A

Africa/     Antarctica/ Asia/       Australia/

America/    Arctic/     Atlantic/

[[email protected] etc]# ls -s ../usr/share/zoneinfo/A

Africa/     Antarctica/ Asia/       Australia/

America/    Arctic/     Atlantic/

[[email protected] etc]# ls -s ../usr/share/zoneinfo/Asia/Shanghai localtime

ls: 無法訪問localtime: 沒有那個檔案或目錄

4 ../usr/share/zoneinfo/Asia/Shanghai

[[email protected] etc]# ln -s ../usr/share/zoneinfo/Asia/Shanghai localtime

[[email protected] etc]# ls -al localtime*                                           lrwxrwxrwx. 1 root root 35 3月  12 13:02 localtime -> ../usr/share/zoneinfo/Asia/Shanghai

[[email protected] etc]#



[[email protected] sysconfig]# timedatectl

      Local time: 六 2016-03-12 05:10:37 UTC

  Universal time: 六 2016-03-12 05:10:37 UTC

        RTC time: 六 2016-03-12 05:10:37

       Time zone: Asia/Shanghai (UTC, +0000)

     NTP enabled: yes

NTP synchronized: yes

 RTC in local TZ: no

      DST active: n/a

[[email protected] sysconfig]#



timedatectl set-timezone Asia/Shanghai


[[email protected] sysconfig]# timedatectl --help

timedatectl [OPTIONS...] COMMAND ...


Query or change system time and date settings.


  -h --help                Show this help message

     --version             Show package version

     --no-pager            Do not pipe output into a pager

     --no-ask-password     Do not prompt for password

  -H --host=[[email protected]]HOST    Operate on remote host

  -M --machine=CONTAINER   Operate on local container

     --adjust-system-clock Adjust system clock when changing local RTC mode


Commands:

  status                   Show current time settings

  set-time TIME            Set system time

  set-timezone ZONE        Set system time zone

  list-timezones           Show known time zones

  set-local-rtc BOOL       Control whether RTC is in local time

  set-ntp BOOL             Control whether NTP is enabled

[[email protected] sysconfig]#





【CentOS】localtime

相關文章

聯繫我們

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