Linux basic command date command, linuxdate command

Source: Internet
Author: User

Linux basic command date command, linuxdate command

1. Time Command: date

The parameter passed to the date command applies to '+' (plus sign). In the parameter passed

% Y indicates year

% M indicates month

% D Indicates day

% H indicates the hour (the time is 00-23)

% M indicates minute

% S indicates second

% S (unix timestamp seconds)

1.1 For example, date + % Y-% m-% d

The result on my machine is:

The output result of the date command is to format the parameters passed at the current time.

1.2 For example, date + '% Y-% m-% d % H: % M: % s'

1.3 obtain the unix timestamp of the current time.

Date + % s

1.4 Use the date command to obtain the unix timestamp of a specific time

The preceding example shows how to obtain the unix timestamp of January 1, October 8, 2014.


In linux, how does one use the date command? Beginner Learning

Date -- help
For more information, see Manual man date.
You can view all commands in this way.

How to Use the date command in linux


Enter only date to display the current time
-D or -- date is used to display a specific date and time, and can be output in format



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.