Date of the Linux command

Source: Internet
Author: User

Date Usage 1:

Format: Date [OPTION] ... [+format]

FORMAT controls the output. Interpreted sequences is:


Percent a literal%

%a Locale ' s abbreviated weekday name (e.g., Sun)

%A locale ' s full weekday name (e.g., Sunday)

%b Locale ' s abbreviated month name (e.g., Jan)

%B locale ' s full month name (e.g., January)

%c locale ' s date and time (e.g., Thu Mar 3 23:05:25 2005)

%c century; Like%Y, except omit the last of the digits (e.g., 20)

%d day of month (e.g., 01)

%d date; Same as%m/%d/%y

%e Day of month, space padded; Same as%_d

%F full date; Same as%y-%m-%d

%g last digits of the year of the ISO week number (see%G)

%G year of the ISO week number (see%V); Normally useful only with%V

%h Same as%b


%H Hour (00..23)

%I Hour (01..12)

%j Day of the Year (001..366)

%k Hour, Space padded (0..23); Same as%_h


%l Hour, Space padded (1..12); Same as%_i


%m Month (01..12)


%M minute (00..59)


%n a newline


%N nanoseconds (000000000..999999999)


%p locale ' s equivalent of either AM or PM; blank if not known


%P like%P, but lower case


%r locale ' s 12-hour clock time (e.g., 11:11:04 PM)


%R 24-hour hour and minute; Same as%h:%m


%s seconds since 1970-01-01 00:00:00 UTC


%s second (00..60)


%t a tab


%T time; Same as%h:%m:%s


%u day of week (1..7); 1 is Monday


%u week number of year, with Sunday as First day of week (00..53)


%V ISO Week number, with Monday as First day of week (01..53)


%w Day of Week (0..6); 0 is Sunday


%W Week number of year, with Monday as First day of week (00..53)


%x locale ' s date representation (e.g., 12/31/99)


%x locale ' s time representation (e.g., 23:13:48)


%y last digits of the year (00..99)


%Y year


%z +hhmm numeric time zone (e.g.,-0400)


%:z +hh:mm numeric time zone (e.g., -04:00)


%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)


%:::z numeric time zone with:to necessary precision (e.g.,-04, +05:30)


%Z Alphabetic time zone abbreviation (e.g., EDT)


By default, the date pads numeric fields with zeroes. The following optional flags may follow '% ':


-(hyphen) do not pad the field


_ (underscore) pad with spaces


0 (zero) pad with zeros


^ Use upper case if possible


# Use opposite case if possible

For example:

1. Day of the Month

$ date +%y%m%d20150107

2. Year date, only after two

~$ Date +%y%m%d150107


3. Hour minute seconds

~$ Date +%h%m%s233045

4. Date and Time

~$ Date +%y%m%d%h%m%s20150107233145


Cond......

Date of the Linux 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.