Date display time and date in Linux synchronized with Hwclock time

Source: Internet
Author: User
Tags time and date

1.Date Displays system time, date

Date + "%y-%m-%d%h:%m:%s"

2015-07-02 14:32:15

Date%Y four-bit format printing year

Date%y Two-bit format printing year

Date%m Month

Date%d Day

Date%H Hours

Date%M minutes

Data%s seconds

2. time of the day before use

Date-d "-1 day" +%d

One hour before use

Date-d "-1 Hour" +%h

One minute before use

Date-d "-1 min" +%m

3. system time (date) and hardware time (Hwclock) settings and synchronization

Date-s ' mm/dd/yyyy HH:MM:SS '

Date-s ' 07/02/2015 14:55:30 ' Set system time

Write system time to hardware time

Hwclock-w set hardware time from current system time

Hwclock-s Setting the system time from the current hardware time

Date display time and date in Linux synchronized with Hwclock time

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.