SHELL DATE Command Detailed

Source: Internet
Author: User

How to use: Date [-u] [-D DATESTR] [-S datestr] [--UTC] [--universal] [--DATE=DATESTR] [--SET=DATESTR] [--help] [--version] [+f ORMAT] [MMDDHHMM[[CC]YY][.SS]]

Description: Date can be used to display or set the system's Day and time, in terms of display, the user can set the format to be displayed, the format is set to a plus sign followed by a number of tags, where the list of available tags is as follows:

In terms of time:

%: Print out

%%n: Next line

%t: Jump Grid

%H: Hours (00..23)

%I: Hours (01..12)

%k: Hours (0..23)

%l: Hours (1..12)

%M: minutes (00..59)

%p: Show local AM or PM

%r: Direct Display time (12-hour format, HH:MM:SS [ap]m)

%s: The number of seconds from January 1, 1970 00:00:00 UTC to date%s: seconds (00..61)

%T: Direct Display time (24-hour system)

%x: Equivalent to%h:%m:%s

%Z: Show Time zone

Date aspects:

%a: Day of the Week (Sun. Sat)

%A: Day of the Week (Sunday). Saturday)

%b: Month (Jan). DEC)

%B: Month (January). December)

%c: Display date and time directly

%d: Day (01..31)

%d: Show date directly (MM/DD/YY)

%h: With%b

%j: The first day of the Year (001..366)

%m: Month (01..12)

%u: Week of the Year (00..53) (in Sunday as the first day of the week)

%w: The day of the Week (0..6)

%W: Week of the Year (00..53) (with Monday as the first day of the week)

%x: Show date directly (MM/DD/YY)

%y: Last two digits of the year (00.99)

%Y: Full year (0000..9999)

If you do not start with a plus sign, you want to set the time, and the time format is MMDDHHMM[[CC]YY][.SS],

Where MM is the month,

DD is the day,

HH for hours,

MM for minutes,

CC is the first two digits of the year,

YY is two digits after the year,

SS is the number of seconds

Put the meter:

-D datestr: Displays the time set in the DATESTR (non-system time)

Help: Display Auxiliary message

-S DATESTR: Set the system time to the time set in Datestr

-U: Show current GMT

–version: Show version number


SHELL DATE Command Detailed

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.