Some uses of Linux date-d

Source: Internet
Author: User
Tags locale month name

the format output type character in the date command has the following meanings:
A%%a of the current locale (for example: Day, representing Sunday)%a the full name of the current locale (e.g., Sunday)%b the month name of the current locale (e.g.: one, for January)%b the full name of the current locale (e.g. January)% C Date and time of the current locale (e.g. Thursday, March 3, 2005 23:05:25)%c century; for example,%Y, typically omitting the last two digits of the current year (for example:%d) by the date of the month (ex: N)%d on a monthly date; equals%m/%d/%y% E The date of the month, add a space, equal to the%_d%f full date format, equivalent to the last two bits of the%y-%m-%d%giso-8601 format year (see%G)%giso-8601 format year (see%V), generally only with%V%h equals%b%h hours (00-23 )%i hours (00-12)%j year-to-date (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 newline%n nanoseconds (000000000-999999999)%p the "Morning" or "afternoon" under the current locale, the output is empty when unknown%p is similar to%p, but the loss Lowercase letter%r 12-hour clock time under current locale (e.g. 11:11:04 pm) hours and minutes of%r24 hour, equivalent to%h:%m%s seconds since UTC 1970-01-01 00:00:00%s seconds (00-60)%t output tabulation The tab%t time, which is equal to%h:%m:%s%u week, 1 represents the week of the year in Monday%u, with Sunday being the first day of the Week (00-53)%viso-8601 format specification of the week, and Monday as the first day of each week (01-53)%w the day of the Week ( 0-6), 0 represents Monday%w of the Week of the year, in Monday, the date description under the current locale of the first day of the Week (00-53)%x (for example: 12/31/99)%x time description under current locale (e.g. 23:13:48)%y year last two digits (00-99) %y year%z +HHMM digital time zone (for example, -0400)%:z +hh:mm Digital time zone (for example, -04:00)%::z +hh:mm:ss Digital time zone (for example, -04:00: XX)%:::z digital time zone with the necessary precision (for example, -04,+05:30)%z time zone abbreviations sorted by alphabet (for example, EDT) 



Date-d a little bit of common examples and instructions:

date-d ' 2 days ago '//Show 2 day ago date-d ' second ago '//show 60 seconds ago date-d ' 3 months 1 day '//show March 1 days after date-d ' Dec ' + %j//show December 25 on which day of the year date-d ' 1970-01-01 00:00:30 +0000 ' +%s   //The number of seconds since UTC time 1970-01-01 00:00:00

Some uses of Linux date-d

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.