Shell Programming Advanced 1.3data Command

Source: Internet
Author: User

The date command is the command that displays the DateTime

Date

Friday, January 01, 2016 15:05:01 CST

The option to modify the time is-s

" 2016-01-01 12:56:10 "

View Calendar

Aa.

Annual Calendar

Cal-y

Time to synchronize the server

Yum Install Ntp-y
Ntpdate ntp.fudan.edu.cn

Use of date

Date +%
F Month Day
T hours and seconds
Y four digits of the year
Y two digits of the year
M month
D-Day
W this year's the first few weeks
W weeks
H time
M min
s S
s how many seconds away from 1970-01-01 00:00

Combination usage

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

2016-01-01 16:11:30

option of date-D, date two days ago

" -2 days " +%f

2015-12-30

" -2 month " +%f

2015-11-01

Hour min sec can be

---restore content ends---

Shell Programming Advanced 1.3data Command

Related Article

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.