The date command for the Linux Basic command

Source: Internet
Author: User

1. Time Command: Date

The pass parameter to the date command applies ' + ' (plus), in the passed argument

%y represents the year

%m represents the Month

%d indicates days

%h = Hour (indicates the time is 00-23)

%m = minutes

%s = seconds

%s (the number of seconds to represent the Unix timestamp)

1.1 For example Date +%y-%m-%d

The result of this on my machine is:

The output of the date command is formatted with the passed parameters for the current time

1.2 For example date + '%y-%m-%d%h:%m:%s '

1.3 Getting the Unix timestamp for the current time

Date +%s

1.4 Using the date command to get a UNIX timestamp at a specific time

This shows the Unix timestamp for October 8, 2014.

The date command for the Linux Basic 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.