Linux System Time Management

Source: Internet
Author: User
Tags local time

One, time zone configuration

Show Time zone

[Email protected] ~]# date-r

Mon, Dec 2016 14:02:47 +0800

[Email protected] ~]#

[Email protected] ~]# date +%z

+0800

[Email protected] ~]#

The main is the back of the +0800, East eight district

Modify Time Zone

[Email protected] ~]# Vim/etc/sysconfig/clock

[Email protected] ~]# Cat/etc/sysconfig/clock

Zone= "Asia/shanghai"

[Email protected] ~]# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

Cp:overwrite '/etc/localtime '? Y

[Email protected] ~]#

The time zone information exists/usr/share/zoneinfo/below, the local time zone information exists/etc/localtime, using the TAB key technique, can modify the time zone arbitrarily.

Tzselect, interactive command, I tried useless effect, not recommended.

Second, time-related directives

Concept: There are 2 Linux time

System time: Also called software time (SYS), January 1, 1970 to the current time of the number of seconds

BIOS time: Also called hardware time (HC)

Display time:

[[Email protected] ~]# date 121914372015

Saturday, December 19, 2015 14:37:00 CST

[Email protected] ~]#

[Email protected] ~]# Hwclock-r

December 19, 2016 Monday 14:37 58 sec -0.523154 seconds

[Email protected] ~]#

[Email protected] ~]# hwclock-w

[Email protected] ~]# Hwclock-r

December 19, 2015 Saturday 14:37 29 sec -1.054204 seconds

[Email protected] ~]#

[Email protected] ~]#

Note:

Format the date:

#date mmddhhmmyyyy

MM: Month

DD: Date

HH: Hours

MM: Minutes

YYYY: The Public

#hwclock [RW]

-R: That is read, reading the current time parameters in the BIOS

-W: Write, writes the current Linux system time to the BIOS

Linux Web-time:

#ntpdate [NTP Ip/hostname]

For example:

#ntpdate time.windows.com


This article is from the "Behind" blog, make sure to keep this source http://laozhu.blog.51cto.com/755494/1883967

Linux System Time Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.