LINUX Note-date command

Source: Internet
Author: User
Tags set time

Show Current time:

Command:

  [Email protected]:~$ date  Thu 03:01:17 PDT  [email protected]:~$ date ' +%x '  08/31/201 7 

Display date and set time:

Command: Date--date 08:42:00

The date-d parameter uses:

date-d "Nov 22" This year's November 22 is Wednesday

Date-d ' 2 weeks ' 2 weeks after the date

Date-d Tomorrow +%y%m%d

Date-d Yesterday +%y%m%d

date-d last-month +%y%m (months last month)

Date-d Next-month +%y%m (next month is a few months)

With the ago command, you can get past dates:

Date-d ' days ago (30 day before date)

Use negative numbers to get the opposite date:

Date-d ' Dec 14-2 weeks ' (relative: Dec 14 date Two weeks before this date)

Date-d ' -100 days ' (100 day old date)

LINUX Note-date command

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.